Commit graph

19 commits

Author SHA1 Message Date
Colin Surprenant
ab05082a89 merge feature/java_persistence into 5.x 2016-10-31 17:03:40 -04:00
Guy Boertje
8cec4fa514 add Event method_missing to give better error messages for #[] and #[]=
Change strings and regexs to CONSTANTS.

move method missing code to event.rb

doh - put Event class in already defined Logstash module

Fixes #6045
2016-10-13 10:43:34 -04:00
Colin Surprenant
5824080871 renamed namespace com.logstash to org.logstash
few auto-rename glitches fixes

few auto-rename glitches fixes

few auto-rename glitches fixes

few auto-rename glitches fixes

few auto-rename glitches fixes
2016-09-12 15:05:59 -04:00
Tal Levy
b545b83390 Migrate Logstash to Log4j2 Logging (#5651)
Migrate to use Log4j2 for Logstash logging
2016-08-26 18:11:22 +00:00
Guy Boertje
9020acedf0 Implementation - Java Event type casting conversion optimization (#4999)
* add RubyJavaObject and Valuefier classes and use, junit and rspec pass

* add benchmark

* update benchmark
Deep fetch      6.015M (± 4.4%) i/s -     60.086M

* change warmup to 30 seconds

* support for rubyValue = RubyNil, shortcut null when asking for javaValue

* prevent Lists and Maps from being converted to RubyJavaValue too

* camel case: is_ruby_nil

* rename method, use renamed method, make serializable and add junit test

* encapsulate refs to RubyJavaObject to setableValue, use StringBuilder

* remove unused newObj

* some fixes after PR review

* wip

* ruby and java tests pass with BiValues.

* Benchmarks are still good

* Fixes for spec failures in normal event specs

* integrate JavaProxy support into BiValues

* edit a TODO

* rebase master and updates from PR review.

* revert the use of JavaUtil.convertJavaToUsableRubyObject

* allow initTimestamp to handle NullBiValue

* remove TimeBiValue, convert Joda DateTime and Ruby Time to Timestamp beforehand
2016-07-21 09:13:01 +01:00
Guy Boertje
c937160364 Fix Javafier for MapJavaProxy, ArrayJavaProxy, ConcreteJavaProxy. (#5474)
* Fix Javafier for MapJavaProxy, ArrayJavaProxy, ConcreteJavaProxy.
+ JUnit tests + Rspec test

* fix splat imports
* use a method instead of switch case code and throw an error if we don't
know how to handle the wrapped type.
* Add hand crafted map to use in rspec from Java directly and rspec test
* changes for review comments.
2016-06-17 12:27:52 -07:00
Colin Surprenant
5cdd434612 optimize Java Map initialization 2016-05-25 15:06:36 -04:00
Colin Surprenant
537d6a2780 refactor Ruby Event getter and setter
refactor wip gemfiles

refactor Java Event getter and setter

bump plugin-api to 2.0

use plugin-api 2.0

switch to core-event-java

include logstash-core-event-java.jar jar file so that gem dependency using the source tree work

updated core plugins to core-api 2.0

added grok for refactor branch

fix rebased specs

remove temp plugins github paths

remove commented out tmp alias_method
2016-05-06 13:47:03 -04:00
Colin Surprenant
6769dc4853 support RubyBignum in Javafier
cosmetics

Fixes #4900
2016-03-29 20:05:11 +00:00
Colin Surprenant
f3c29faeaf correctly handle BigDecimal Rubyfying
BigDecimal fix spec
2016-03-18 09:54:29 -04:00
Colin Surprenant
fa5b154ef8 from_json should not generate new Event on blank/empty json input 2016-02-10 16:25:25 -05:00
Colin Surprenant
ad6cb41726 new Event#from_json method
from_json POC

add Event#from_json with corresponding specs

pre-inititalize error class constants

tests for Event#from_json

support array of events in from_json, upgrade to latest jackson

add test for partially invalid json array
2016-02-09 11:46:44 -05:00
Colin Surprenant
cefd6be94f proper java to ruby conversions and specs
proper java to ruby convertion and specs

missing ruby conversions

add missing timestamp= method

added usec method

missing constants

added usec, tv_usec, year methods

clean ruby_to_hash_with_metadata method

rework boolean cast

add BigDecimal

missing import

reworked Ruby to JAva type conversion

better nil objects handling and better debug trace
2015-12-15 16:39:08 -05:00
Colin Surprenant
3690944e49 fix nil value field reference assignment in Java Event
fix fieldref nil value assignment

add fieldref nil value assignment spec

better spec description and better expectation
2015-12-10 17:08:07 -05:00
Colin Surprenant
264c23811d expose DEFAULT_LOGGER and remove nil/null support 2015-12-10 16:19:50 -05:00
Colin Surprenant
619a590c72 add comments 2015-12-10 16:19:50 -05:00
Colin Surprenant
372e1d73ff typo 2015-12-10 16:19:50 -05:00
Colin Surprenant
29ea7f495b support injectable Ruby logger in Java event and related specs 2015-12-10 16:19:49 -05:00
Colin Surprenant
d74d41cb30 logstash-core & logstash-core-event extraction to support logstash-core-event-java impl, relates to #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 #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
2015-11-16 16:40:19 -05:00