-
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
core Event class Java rewrite #4191
Comments
wip initial Accessors, Event, EventImpl, Path, Timestamp and PathTest wip wip FieldReference and Accessors implementation rename targetCache to lut and set it protected initial Accessors tests todo comment more tests Timestamp implementation Timestamp tests fix method name add Long constructor event initialization, timestamp handling and json serialization add <> type information custom json serializer for Timestamp remove toJson test initial Event test more tests comments debug traces initial jruby Event wrapper and specs added PathCache implemented includes added clone wrap all Event methods Rakefile to build and jar missing getters and implement overwrite support Date conversion proper cast and coercion replace Ruby Event with Java Event test for field reference setter type coercion disable specs timestap setter should also set in map, accept more timestamp types pre cache timestamp and expose isTimestamp constructor from DateTime expose proper Ruby Timestamp object Ruby Timestamp basic specs also load JRuby Timestamp transpose Java<->Ruby Timestamp fix timestamp specs new jar cleanup object construction
This implementation is different from the master version since instead of doing JIT Template compilation on every events we create a data structure of a compiled templates. This template is cached in a concurrent hashmap and used on other requests. fixing conflict
First the case with single fieldref Add support for +%s => epoch Small comments concerning the caching mechanism and the memory usage Make the #sprintf method work with Array and Hash
event clone append in Ruby tag & append add timestamp assignment spec comment out original classes fix at signature implemented del remove from array del test
more event java updates - updated metadata - moved #append to java - other small test fixes commit gradle wrapper jar
…re-event-java impl, relates to elastic#4191 fixed timezone issue extracted logstash-core and reorganized specs extracted logstash-core-event extract java Event into logstash-core-event-java in a proper gem remove obsolete jruby_event bootstrapping fix require path add java code bootstrap use logstash-core-event/logstash-core-event.rb remove obsolete files basic instructions LogStash::Json need to be initialized from event update jruby and gradle versions update compile:logstash-core-event-java rake task WIP tasks refactor fix gem.files skip test if class is not defined fix gem related tasks for new structure add gem spec dirs in core tests bootstrap java implementation when requiring timestamp new Cloner class and Event clone impl fix array fields assignments, see elastic#4140 don't rely on json implementation ordering fix skipped last iterpolation char remove implementation specific unnecessary check also require ruby classes define error class in ruby raise exception on invalid format remove implementation specific tests and extract and put logger related test in pending missing bits for having all core timestamp specs pass run all core specs remove leftover comment regex missing encoding header revert to logstash-core-event by default finished proper gemification useless require dynamically pick specs depending on logstash-core-event-* implementation logstash root package version missing file for proper gemification do not build java event by default always check for root logstash lib dir fix concurrent-ruby version confict fix rebase conflict re-enable specs user vars instead of constants move non core code in bootstrap document version files move version file remove useless code use version in logstash-core fix gem files list put back concurrent-ruby version constrain as in master add dependency on logstash-core-event remove dependency on logstash-core to avoid circular dependency fix rebase conflict remove circular dependency fix specs update README
wip initial Accessors, Event, EventImpl, Path, Timestamp and PathTest wip wip FieldReference and Accessors implementation rename targetCache to lut and set it protected initial Accessors tests todo comment more tests Timestamp implementation Timestamp tests fix method name add Long constructor event initialization, timestamp handling and json serialization add <> type information custom json serializer for Timestamp remove toJson test initial Event test more tests comments debug traces initial jruby Event wrapper and specs added PathCache implemented includes added clone wrap all Event methods Rakefile to build and jar missing getters and implement overwrite support Date conversion proper cast and coercion replace Ruby Event with Java Event test for field reference setter type coercion disable specs timestap setter should also set in map, accept more timestamp types pre cache timestamp and expose isTimestamp constructor from DateTime expose proper Ruby Timestamp object Ruby Timestamp basic specs also load JRuby Timestamp transpose Java<->Ruby Timestamp fix timestamp specs new jar cleanup object construction
This implementation is different from the master version since instead of doing JIT Template compilation on every events we create a data structure of a compiled templates. This template is cached in a concurrent hashmap and used on other requests. fixing conflict
First the case with single fieldref Add support for +%s => epoch Small comments concerning the caching mechanism and the memory usage Make the #sprintf method work with Array and Hash
event clone append in Ruby tag & append add timestamp assignment spec comment out original classes fix at signature implemented del remove from array del test
more event java updates - updated metadata - moved #append to java - other small test fixes commit gradle wrapper jar
…re-event-java impl, relates to elastic#4191 fixed timezone issue extracted logstash-core and reorganized specs extracted logstash-core-event extract java Event into logstash-core-event-java in a proper gem remove obsolete jruby_event bootstrapping fix require path add java code bootstrap use logstash-core-event/logstash-core-event.rb remove obsolete files basic instructions LogStash::Json need to be initialized from event update jruby and gradle versions update compile:logstash-core-event-java rake task WIP tasks refactor fix gem.files skip test if class is not defined fix gem related tasks for new structure add gem spec dirs in core tests bootstrap java implementation when requiring timestamp new Cloner class and Event clone impl fix array fields assignments, see elastic#4140 don't rely on json implementation ordering fix skipped last iterpolation char remove implementation specific unnecessary check also require ruby classes define error class in ruby raise exception on invalid format remove implementation specific tests and extract and put logger related test in pending missing bits for having all core timestamp specs pass run all core specs remove leftover comment regex missing encoding header revert to logstash-core-event by default finished proper gemification useless require dynamically pick specs depending on logstash-core-event-* implementation logstash root package version missing file for proper gemification do not build java event by default always check for root logstash lib dir fix concurrent-ruby version confict fix rebase conflict re-enable specs user vars instead of constants move non core code in bootstrap document version files move version file remove useless code use version in logstash-core fix gem files list put back concurrent-ruby version constrain as in master add dependency on logstash-core-event remove dependency on logstash-core to avoid circular dependency fix rebase conflict remove circular dependency fix specs update README
All default plugins are now passing specs, all related PRs are tracked in #4264. Merge fest can now start. |
quick benchmark update, I tested the config defined in https://gist.github.com/colinsurprenant/8143a0dfd30830d57b03 using 4 workers
|
That's an impressive increase! |
…re-event-java impl, relates to elastic#4191 fixed timezone issue extracted logstash-core and reorganized specs extracted logstash-core-event extract java Event into logstash-core-event-java in a proper gem remove obsolete jruby_event bootstrapping fix require path add java code bootstrap use logstash-core-event/logstash-core-event.rb remove obsolete files basic instructions LogStash::Json need to be initialized from event update jruby and gradle versions update compile:logstash-core-event-java rake task WIP tasks refactor fix gem.files skip test if class is not defined fix gem related tasks for new structure add gem spec dirs in core tests bootstrap java implementation when requiring timestamp new Cloner class and Event clone impl fix array fields assignments, see elastic#4140 don't rely on json implementation ordering fix skipped last iterpolation char remove implementation specific unnecessary check also require ruby classes define error class in ruby raise exception on invalid format remove implementation specific tests and extract and put logger related test in pending missing bits for having all core timestamp specs pass run all core specs remove leftover comment regex missing encoding header revert to logstash-core-event by default finished proper gemification useless require dynamically pick specs depending on logstash-core-event-* implementation logstash root package version missing file for proper gemification do not build java event by default always check for root logstash lib dir fix concurrent-ruby version confict fix rebase conflict re-enable specs user vars instead of constants move non core code in bootstrap document version files move version file remove useless code use version in logstash-core fix gem files list put back concurrent-ruby version constrain as in master add dependency on logstash-core-event remove dependency on logstash-core to avoid circular dependency fix rebase conflict remove circular dependency fix specs update README
I am calling this issue closed, Java Event is merged and all core and plugins specs are passing. I will followup with a post-merge review process issue and we can create new issues as needed. |
Overview
Rewrite the
Event
class in pure Java and its supporting classes likeTimestamp
andAccessors
and keep 100% compatibility with current implementation of other core logstash components and all plugins.Purpose
Event
is the main object which encapsulates data and provides and API for the plugins to perform processing on the event content. HavingEvent
implemented in pure Java will improve performance, make possible faster serialization by avoiding costly type conversion between JRuby and Java which in turn will help with an efficient persistence implementation.Also, these critical and costly operations are related to the
Event
where the Java implementation should provide performance improvement:Event
data manipulation in the config is done using the logstash field reference syntax (ex.[foo][bar][baz]
). This is implemented in theAccessors
class. an optimized implementation should improve performance.Event#sprintf()
) The config syntax provides string interpolation in field references. The Ruby implementation was known to be slow and the Java implementation should provides a noticeable improvement. String interpolation is heavily used in all configs.Strategy
Event
implementation from logstash-core and make it a proper self-contained gem which should be drop-in replaceable with an alternate implementation. This is completed in logstash-core, logstash-core-event, logstash-core-event-java #4123 and the gem islogstash-core-event
.The text was updated successfully, but these errors were encountered: