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
This commit is contained in:
Colin Surprenant 2015-10-21 17:34:10 -04:00
parent e28f188e12
commit d74d41cb30
153 changed files with 1041 additions and 508 deletions

View file

@ -0,0 +1 @@
require "logstash-core-event-java/logstash-core-event-java"

View file

@ -0,0 +1,31 @@
# encoding: utf-8
require "java"
module LogStash
end
# TODO: (colin) integrate jar loading with gradle and verify dev vs prod environment setups
# insert all jars in this directory into CLASSPATH
Dir.glob(File.join(File.expand_path("..", __FILE__), "*.jar")).each do |jar|
$CLASSPATH << jar unless $CLASSPATH.include?(jar)
end
# TODO: (colin) correctly handle dev env build/ dir and local jar
# local dev setup
classes_dir = File.expand_path("../../../build/classes/main", __FILE__)
if File.directory?(classes_dir)
# if in local dev setup, add target to classpath
$CLASSPATH << classes_dir unless $CLASSPATH.include?(classes_dir)
else
# otherwise use included jar
raise("TODO build dir not found and no jar file")
end
require "jruby_event_ext"
require "jruby_timestamp_ext"
require "logstash/event"
require "logstash/timestamp"

View file

@ -0,0 +1,8 @@
# encoding: utf-8
# The version of logstash core event java gem.
#
# Note to authors: this should not include dashes because 'gem' barfs if
# you include a dash in the version string.
LOGSTASH_CORE_EVENT_JAVA_VERSION = "3.0.0.dev"

View file

@ -0,0 +1 @@
require "logstash-core-event-java/logstash-core-event-java"

View file

@ -0,0 +1,24 @@
# encoding: utf-8
require "logstash/namespace"
require "logstash/json"
# transcient pipeline events for normal in-flow signaling as opposed to
# flow altering exceptions. for now having base classes is adequate and
# in the future it might be necessary to refactor using like a BaseEvent
# class to have a common interface for all pileline events to support
# eventual queueing persistence for example, TBD.
class LogStash::ShutdownEvent; end
class LogStash::FlushEvent; end
module LogStash
FLUSH = LogStash::FlushEvent.new
# LogStash::SHUTDOWN is used by plugins
SHUTDOWN = LogStash::ShutdownEvent.new
end
# for backward compatibility, require "logstash/event" is used a lots of places so let's bootstrap the
# Java code loading from here.
# TODO: (colin) I think we should mass replace require "logstash/event" with require "logstash-core-event"
require "logstash-core-event"

View file

@ -0,0 +1,28 @@
# encoding: utf-8
require "logstash/namespace"
require "logstash-core-event"
module LogStash
class TimestampParserError < StandardError; end
class Timestamp
include Comparable
# TODO (colin) implement in Java
def <=>(other)
self.time <=> other.time
end
# TODO (colin) implement in Java
def +(other)
self.time + other
end
# TODO (colin) implement in Java
def -(value)
self.time - (value.is_a?(Timestamp) ? value.time : value)
end
end
end