Commit graph

51 commits

Author SHA1 Message Date
Jordan Sissel
ea2530c8d8 Add test coverage for listIndex
Fixes #6226
2016-12-06 18:33:45 -05:00
Jordan Sissel
4e65c1a3a1 have listIndex take a size instead of the List.
Fixes #6226
2016-12-06 18:33:44 -05:00
Jordan Sissel
c262d53765 Move list offset calculation (for negative index values, etc) to a static method.
Fixes #6226
2016-12-06 18:33:44 -05:00
Jordan Sissel
235dc12c09 Allow negative array indexes to mean an offset from the end of the array, where -1 means the last element.
Fixes #6226
2016-12-06 18:33:44 -05:00
Jordan Sissel
c8131b146a Add test to cover negative array offsets in field references. It currently fails.
Fixes #6226
2016-12-06 18:33:44 -05:00
Guy Boertje
eba128c968 Allow for exception instances to get serialized in JSON logging 2016-11-30 15:43:57 -08:00
Pier-Hugues Pellerin
413dc350d2 Chagne PluginRegistry -> PLUGIN_REGISTRY
Fixes #6109
2016-11-11 09:43:44 -05:00
Colin Surprenant
cb8d80a46f fix tagging edge cases
add comment and use Arrays.asList()

brain fart between camelCase and snake_case
2016-11-04 14:03:50 -04:00
Colin Surprenant
761f9f1bc9 merge feature/java_persistence into master 2016-11-01 17:13:23 -04:00
Guy Boertje
054dee96f1 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:33 -04:00
Tal Levy
fbaf82ac0e Fix generated jar dependencies for ls-event-java (#5967)
This file was incorrectly checked-in with a jackson-annotations
dependency of `2.7.3`. jackson-databind depends on `2.7.0` of the
annotations library.
2016-09-28 22:02:30 +02:00
Colin Surprenant
5eb583b49c 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 14:45:07 -04:00
Suyog Rao
65a8676a86 Bump master to 6.0.0-alpha1 (#5880)
* Bump master to 6.0.0-alpha1
2016-09-08 08:33:27 -07:00
Tal Levy
1b2f7a7668 Migrate Logstash to Log4j2 Logging (#5651)
Migrate to use Log4j2 for Logstash logging
2016-08-25 10:30:22 -07:00
Colin Surprenant
31392e7fb0 base SignalEvent class and cleanup LogStash namespace 2016-08-23 17:12:19 -04:00
Suyog Rao
e7dcdd66ba Bump to 5.0.0-alpha6, next release (#5751) 2016-08-09 23:33:15 -07:00
Suyog Rao
8bb01d6358 Fix the require_jar warning about jackson jars
jrjackson was using 2.7.3 whereas core was using 2.7.0. Upgraded jrjackson
to 0.4.0 and core libs to match jars in jrjackson

Fixes #5159

Fixes #5750
2016-08-09 21:00:22 -04:00
Guy Boertje
1002d50524 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-20 20:03:03 +01:00
Joao Duarte
4cf8031a49 bump to 5.0.0-alpha5
Fixes #5585
2016-07-05 10:03:22 -04:00
Joao Duarte
a859bd4a3f add single command release task and other release support tooling
Purpose:

* manage releases through a minimum number of rake tasks
* simplify building of snapshot builds
* create staged artifacts, candidates for releases, that required no changes to become releases
* this means the snapshot release process will not involve publishing gems, therefore:
* the gem artifacts should only be published to rubygems as a final artifact, at the time of GA

Changes:

* release artifacts no longer depend on gems of core components
* all core components are used locally AS-IS to minimize code changes between snapshot, RC and GA
* `versions.yml` describes the versions of all logstash parts and package
  * `rake version:set[version]` manage the yaml file and push the changes to the gemspecs/version.rb files
  * `rake version:set_plugin_api[version]` manage the yaml file and push the changes to the gemspecs/version.rb files
  * `rake artifact:all` generates SNAPSHOT artifacts: tar.gz, zip, rpm, deb
  * `RELEASE=1 rake artifact:all` creates release candidate artifacts + 4 gems: logstash-core, logstash-core-event, logstash-core-event-java and logstash-core-plugin-api

implements #5416 and #5414

Fixes #5460
2016-06-20 04:23:48 -04:00
Guy Boertje
d48896a0b1 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:26:17 -07:00
Colin Surprenant
5e5c0c0844 optimize Java Map initialization 2016-05-25 15:02:56 -04:00
Tal Levy
f2d8be1009 have Event#toMap return copy
Fixes #5296
2016-05-16 19:40:57 +00:00
Colin Surprenant
40301af835 remove unnecessary jar file introduced for the plugin-api-v2 transition 2016-05-06 14:34:16 -04:00
Colin Surprenant
ee2c8af8c8 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:33:31 -04:00
Colin Surprenant
d89fd802e2 Ruby and Java Event Accessors lut invalidation
lut invalidation spec

fix lut invalidation

extra comment

fix lut invalidation, invalid target path, with tests

post review fixes
2016-04-25 11:01:30 -04:00
Suyog Rao
e971dacfce Bump current master to 5.0.0.dev
Fixes #4906
2016-03-29 16:26:31 +00:00
Colin Surprenant
43f78cf3a2 support RubyBignum in Javafier
cosmetics
2016-03-28 18:32:51 -04:00
Pier-Hugues Pellerin
15aed859de Update the gem.authors and gem.email with the Elastic information
Fix #4880
2016-03-23 17:36:10 -07:00
Colin Surprenant
f3c29faeaf correctly handle BigDecimal Rubyfying
BigDecimal fix spec
2016-03-18 09:54:29 -04:00
Colin Surprenant
a1ac7e699f renamed newTimetsamp to newTimestamp 2016-03-17 18:54:41 -04:00
Colin Surprenant
8d592240ad return current time usec, not epoch usec, with millisec precision, support BigDecimal in Timestamp#at
return current time usec, not epoch usec, with millisec precision, because you know, Joda

correctly support BuigDecimal in Timestamp#at

specs for Timestamp#usec and Timestamp#at with all supported type

typo

more specs
2016-03-17 15:02:20 -04:00
Suyog Rao
b9369abc0e Revert commit 4f7299a
Need to revert bump to 5.0.0.dev because individual plugins
will not install on top of this version.

In plugins' gemspec, the constraint is
`s.add_runtime_dependency "logstash-core", ">= 2.0.0", "< 3.0.0"`

This needs to be mass updated, and then bumped to 5.0.0

Fixes #4828
2016-03-17 02:12:56 +00:00
Joao Duarte
4f7299a555 bump to 5.0.0.dev
Fixes #4814
2016-03-17 00:02:03 +00: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
1260f63a2a force ruby-maven version 2016-02-04 17:09:05 -05:00
Colin Surprenant
3a4c1ec7e4 use static Jackson mapper 2016-01-29 17:37:51 -05:00
Colin Surprenant
40b0685468 fix jar generation for artifact packaging 2016-01-26 17:52:13 -05:00
Colin Surprenant
5a522a0037 code cleanups and integration work for defaulting to Java Event implementation
cleaned dependencies, removed Guava code

default to java event

also compile java event

use json-unit for json result assertions

remove Java 8 specific constructs to be able to compile on Java 7

use jar-dependencies

better jar file loading

copy jar into lib after build

add post-build copy and clean of gem jar and re-indented file

fix jar destination

include generated jar in gem

remove useless ArrayList constructions

add tests for KeyNode.join method

remove useless  shadow and disable unchecked warnings

update gradle dependency to 2.8

fix deprecated asserEquals usage

simplify convoluted list contruction

fix array fields nil values handling

moar nil value tests

simplify for loop
2016-01-26 12:39:35 -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
62a585dbce fix missing methods in Java Timestamp
add utc and gmtime, force UTC in setTime

add missing specs for utc and gmtime

add missing to_f

add missing specs for to_f and to_i
2015-12-10 17:28:42 -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
6a415a3e28 explicit imports 2015-12-10 16:19:51 -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
6a3e0215a3 support clear_cache and cache_size methods in StringInterpolation, adjust specs
Fixes #4325
2015-12-10 00:59:56 +00:00
Colin Surprenant
aaaa6de51a use sprintf un toString
Fixes #4325
2015-12-10 00:59:56 +00:00