Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated java source/tests, jars, ruby source and gradle (#1)
* Here it is! * fix CHANGELOG, CONTRIBUTORS and Gemfile * DissectorError is not registered with JRuby and its not part of JrJackson * Found simple Index of bytes to be faster than KMP or Horspool for small delims and source (in terms of String Search where normally bigger needles are sought in bigger haystacks) KMP Benchmark Mode Cnt Score Error Units DissectorBenchmark.aWarmupVLong avgt 40 1.724 ± 0.010 us/op DissectorBenchmark.bVLongDelims avgt 40 1.808 ± 0.073 us/op DissectorBenchmark.cLongDelims avgt 40 1.479 ± 0.024 us/op DissectorBenchmark.dOneDelim avgt 40 1.312 ± 0.010 us/op DissectorBenchmark.eTwoDelim avgt 40 1.321 ± 0.007 us/op IndexOfBytes Benchmark Mode Cnt Score Error Units DissectorBenchmark.aWarmupVLong avgt 40 1.608 ± 0.048 us/op DissectorBenchmark.bVLongDelims avgt 40 1.559 ± 0.006 us/op DissectorBenchmark.cLongDelims avgt 40 1.437 ± 0.012 us/op DissectorBenchmark.dOneDelim avgt 40 1.408 ± 0.028 us/op DissectorBenchmark.eTwoDelim avgt 40 1.287 ± 0.004 us/op * Moved the indexOf from BruteForce and IndexOfBytes to the Delim classes Deleted BruteForce and IndexOfBytes * handle the no delimiter case "%{a}%{b}-%{c}", "a" field -> "" value * add new jar * add field format validation for %{+&field} and %{&+field} definitions * begin to add data type conversion (will not compile yet) * complete data type conversion (Java side) * whole bunch of renaming and reorg after chat with daniel mitterdorfer * refactor triggered by review comments * OK here are the changes from the review process * rearranged and reformatted code according to IntelliJ defaults * last few fixes for PR * update build instructions to trigger travis build * fix travis perhaps * doh! * damn devutils * damn bundle exec * maybe this will build on travis * and again * and again * and again, more debug info * OK so we have switched to RC1 and org.logstash * add the check task to ensure JUnit tests run before the jar is created * refactor travis yaml
- Loading branch information
Guy Boertje
committed
Oct 15, 2016
1 parent
9bc2866
commit 00cd005
Showing
48 changed files
with
2,381 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ vendor | |
# build dirs | ||
build | ||
.gradle | ||
gradle | ||
|
||
# Intellij | ||
.idea | ||
*.iml | ||
logstash-core-event-java.jar | ||
|
||
gradle.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
sudo: false | ||
language: ruby | ||
cache: bundler | ||
jdk: oraclejdk8 | ||
rvm: | ||
- jruby-1.7.23 | ||
- jruby-1.7.25 | ||
script: | ||
- bundle exec rspec spec | ||
- bundle exec rake travis_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
These instructions are for the JAVA build NOT Ruby Gem build and publish. | ||
|
||
#### History | ||
This is a Logstash plugin with a large amount of Java code. | ||
|
||
The Java source is dependent on the logstash-core jar and the logstash-core-event jar. | ||
These jars can be found in the gems that are resolved via the `s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"` line in the gemspec. | ||
So different versions of these gems can be installed as time goes by. The gradle build dependencies cannot refer to a static location and version. | ||
|
||
These Rake tasks allow for Gradle to be dependent on Rubygems. | ||
- `rake vendor` - this task calls "./gradlew vendor" but only after have done the "bundle_install" rake task | ||
- `rake bundle_install` - this task calls `bundle install` then puts the output of `bundle show logstash-core` and `bundle show logstash-core-event` into the "gradle.properties" file. | ||
|
||
#### Procedure | ||
Each time a new gem version of `logstash-core-plugin-api` is released we need to run `rake vendor` to verify that any changes to the Java in logstash-core and logstash-core-event are still compatible with their usage in this plugin. | ||
|
||
Run `rake vendor` | ||
|
||
#### Travis | ||
Travis is set to use `rake write_gradle_properties` before its build task | ||
|
||
#### More Information | ||
See the Gradle "vendor" task to understand how the the jar is generated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
## 2.0.0 | ||
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully, | ||
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895 | ||
- Dependency on logstash-core update to 2.0 | ||
|
||
## 1.0.5 | ||
- Initial commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
source 'https://rubygems.org' | ||
gemspec | ||
gemspec | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,58 @@ | ||
require "logstash/devutils/rake" | ||
|
||
require 'rubygems' | ||
require 'rubygems/package_task' | ||
require 'fileutils' | ||
require 'rspec/core/rake_task' | ||
|
||
# Please read BUILD_INSTRUCTIONS.md | ||
|
||
desc "Compile and vendor java into ruby" | ||
task :vendor => [:bundle_install] do | ||
sh("./gradlew check vendor") | ||
puts "-------------------> vendored dissect jar via rake" | ||
end | ||
|
||
desc "Compile and vendor java into ruby for travis, its done bundle install already" | ||
task :travis_vendor => [:write_gradle_properties] do | ||
sh("./gradlew check vendor") | ||
puts "-------------------> vendored dissect jar via rake" | ||
end | ||
|
||
desc "Do bundle install and write gradle.properties" | ||
task :bundle_install do | ||
`bundle install` | ||
delete_create_gradle_properties | ||
end | ||
|
||
desc "Write gradle.properties" # used by travis | ||
task :write_gradle_properties do | ||
delete_create_gradle_properties | ||
end | ||
|
||
spec = Gem::Specification.load('logstash-filter-dissect.gemspec') | ||
Gem::PackageTask.new(spec) do | ||
desc 'Package gem' | ||
task :package => [:vendor] | ||
end | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
task :check => [:vendor, :spec] | ||
|
||
task :travis_test => [:travis_vendor, :spec] | ||
|
||
def delete_create_gradle_properties | ||
root_dir = File.dirname(__FILE__) | ||
gradle_properties_file = "#{root_dir}/gradle.properties" | ||
lsc_path = `bundle show logstash-core` | ||
lsce_path = `bundle show logstash-core-event` | ||
FileUtils.rm_f(gradle_properties_file) | ||
File.open(gradle_properties_file, "w") do |f| | ||
f.puts "logstashCoreGemPath=#{lsc_path}" | ||
f.puts "logstashCoreEventGemPath=#{lsce_path}" | ||
end | ||
puts "-------------------> Wrote #{gradle_properties_file}" | ||
puts `cat #{gradle_properties_file}` | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Thu May 26 17:21:25 BST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT. | ||
|
||
require 'jar_dependencies' | ||
require_jar('org.logstash.dissect', 'jruby-dissect-library', '1.0.5') |
Oops, something went wrong.