logstash-codec-compress_spooler 0.1.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1159352fd102c1467d2bcd568b695dd1b187af5f
4
+ data.tar.gz: 0f66e2a1c109ea67640b70ca94f0b0a95cda299b
5
+ SHA512:
6
+ metadata.gz: 0ca026dfd889fc7ff7d6bf148da8d10f8ecf231f7e12736ebaea864bb54ce750c314aeb9bc4d948e70a36502daf0a54ea2092d3e14b7d1f2f9ef8ba75100b1ae
7
+ data.tar.gz: d6f4ab70a534a364113978cc320f4855c8233916a84c6b2b558170fd45e718235083c82138b56289f99a6314922c32c31b8bcae4d6b3bf458634b5747be44215
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *.gem
2
+ Gemfile.lock
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+ gem "logstash", :github => "elasticsearch/logstash", :branch => "1.5"
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2012-2014 Elasticsearch <http://www.elasticsearch.org>
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ @files=[]
2
+
3
+ task :default do
4
+ system("rake -T")
5
+ end
6
+
7
+ require "logstash/devutils/rake"
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+ require "logstash/codecs/base"
3
+
4
+ class LogStash::Codecs::CompressSpooler < LogStash::Codecs::Base
5
+ config_name 'compress_spooler'
6
+ milestone 1
7
+ config :spool_size, :validate => :number, :default => 50
8
+ config :compress_level, :validate => :number, :default => 6
9
+
10
+ public
11
+ def register
12
+ require "msgpack"
13
+ require "zlib"
14
+ @buffer = []
15
+ end
16
+
17
+ public
18
+ def decode(data)
19
+ z = Zlib::Inflate.new
20
+ data = MessagePack.unpack(z.inflate(data))
21
+ z.finish
22
+ z.close
23
+ data.each do |event|
24
+ event = LogStash::Event.new(event)
25
+ event["@timestamp"] = Time.at(event["@timestamp"]).utc if event["@timestamp"].is_a? Float
26
+ yield event
27
+ end
28
+ end # def decode
29
+
30
+ public
31
+ def encode(data)
32
+ if @buffer.length >= @spool_size
33
+ z = Zlib::Deflate.new(@compress_level)
34
+ @on_event.call z.deflate(MessagePack.pack(@buffer), Zlib::FINISH)
35
+ z.close
36
+ @buffer.clear
37
+ else
38
+ data["@timestamp"] = data["@timestamp"].to_f
39
+ @buffer << data.to_hash
40
+ end
41
+ end # def encode
42
+
43
+ public
44
+ def teardown
45
+ if !@buffer.nil? and @buffer.length > 0
46
+ @on_event.call @buffer
47
+ end
48
+ @buffer.clear
49
+ end
50
+ end # class LogStash::Codecs::CompressSpooler
@@ -0,0 +1,32 @@
1
+ Gem::Specification.new do |s|
2
+
3
+ s.name = 'logstash-codec-compress_spooler'
4
+ s.version = '0.1.1'
5
+ s.licenses = ['Apache License (2.0)']
6
+ s.summary = "codec that processes compressed spooled data"
7
+ s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
8
+ s.authors = ["Elasticsearch"]
9
+ s.email = 'richard.pijnenburg@elasticsearch.com'
10
+ s.homepage = "http://www.elasticsearch.org/guide/en/logstash/current/index.html"
11
+ s.require_paths = ["lib"]
12
+
13
+ # Files
14
+ s.files = `git ls-files`.split($\)
15
+
16
+ # Tests
17
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
+
19
+ # Special flag to let us know this is actually a logstash plugin
20
+ s.metadata = { "logstash_plugin" => "true", "logstash_group" => "codec" }
21
+
22
+ # Gem dependencies
23
+ s.add_runtime_dependency 'logstash', '>= 1.4.0', '< 2.0.0'
24
+
25
+ if RUBY_PLATFORM == 'java'
26
+ s.platform = RUBY_PLATFORM
27
+ end
28
+ s.add_runtime_dependency 'msgpack-jruby'
29
+
30
+ s.add_development_dependency 'logstash-devutils'
31
+ end
32
+
@@ -0,0 +1 @@
1
+ require "logstash/devutils/rspec/spec_helper"
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-codec-compress_spooler
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: java
6
+ authors:
7
+ - Elasticsearch
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logstash
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.4.0
20
+ - - <
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.0
23
+ requirement: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 1.4.0
28
+ - - <
29
+ - !ruby/object:Gem::Version
30
+ version: 2.0.0
31
+ prerelease: false
32
+ type: :runtime
33
+ - !ruby/object:Gem::Dependency
34
+ name: msgpack-jruby
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirement: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ prerelease: false
46
+ type: :runtime
47
+ - !ruby/object:Gem::Dependency
48
+ name: logstash-devutils
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ prerelease: false
60
+ type: :development
61
+ description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
62
+ email: richard.pijnenburg@elasticsearch.com
63
+ executables: []
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - .gitignore
68
+ - Gemfile
69
+ - LICENSE
70
+ - Rakefile
71
+ - lib/logstash/codecs/compress_spooler.rb
72
+ - logstash-codec-compress_spooler.gemspec
73
+ - spec/codecs/compress_spooler_spec.rb
74
+ homepage: http://www.elasticsearch.org/guide/en/logstash/current/index.html
75
+ licenses:
76
+ - Apache License (2.0)
77
+ metadata:
78
+ logstash_plugin: 'true'
79
+ logstash_group: codec
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.4.4
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: codec that processes compressed spooled data
100
+ test_files:
101
+ - spec/codecs/compress_spooler_spec.rb