-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java plugin API (beta) #10232
Java plugin API (beta) #10232
Conversation
8df4d03
to
9de56f1
Compare
…implementation of UUID filter
…_matched behavior for Java filters
…imestamp#usec bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this is absolutely amazing work. I have left a couple comments in-line.
@@ -98,11 +98,11 @@ | |||
expect(subject.sprintf("bonjour")).to eq("bonjour") | |||
end | |||
|
|||
it "should raise error when formatting %{+%s} when @timestamp field is missing" do | |||
it "should not raise error when formatting %{+%s} when @timestamp field is missing" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of just expecting it not to raise an error, we should set up expectations for what the new behaviour actually is.
@@ -1,50 +0,0 @@ | |||
package co.elastic.logstash.api.v0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a little surprised to see the API version being stripped from the package name, since we had discussed the value of having it in previous iterations. Is this because we expect plugin authors to compile their plugins against an exact version of Logstash in order to catch mismatches at compile-time? This feels like a step backwards to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per our conversation, we'll add API version verification to the Java plugin installation process before this features goes GA.
@@ -68,6 +68,11 @@ public String toString() { | |||
return iso8601Formatter.print(this.time); | |||
} | |||
|
|||
public long toEpochMilli() { | |||
return (new Duration(JAN_1_1970.toDateTime(DateTimeZone.UTC), this.time).getMillis()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not send org.joda.BaseDateTime#getMillis()
?
public class Stdin implements Input, Consumer<Map<String, Object>> { | ||
|
||
private static final Logger logger = LogManager.getLogger(Stdin.class); | ||
private final Logger LOGGER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The all-caps variable name makes me think that this would be static. Since it is instance-specific, should we go back to calling it logger
?
@yaauie, I've made all the changes you requested on this PR with the exception of the API version verification that will be deferred until the next release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏼
Thanks for the review, @yaauie! |
Opening a PR to track commits on this branch