fluent-plugin-webhdfs 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a23088f567c4fe47907a5e411a3af7eb0d380e38
4
- data.tar.gz: b33cc9662b3b56734bb0a82681e0925c41167be3
3
+ metadata.gz: 6037c3f039431852ee3f19e0fde88a37a00636c3
4
+ data.tar.gz: 4dbc0b1bbaf6d921bcd4331392ed0e5ac980e28b
5
5
  SHA512:
6
- metadata.gz: 0611d377387664c3de86ba93ac030450e593ffaf52cac32ea819191efa2e8544e3348cf6715b2df8d776a439ca54d2cdba40fef784237f1a78fb8038c40d131a
7
- data.tar.gz: ab4b691ae3ed374d5fbec3f9f6ab8605f9a7563f520ac40fc66c7c7d842fabc784f04e54a92eaccc9cb6a7e6eedc6ed474359e9695d11cfedf1e5da4514f92d8
6
+ metadata.gz: c4f58538cb9ee701da053b7a3d5a3c60f338e25a6de00980b6ed29817c08d37910d84bf9bb314e1936353aa45cd282d10601e8e8fea897c65583513b305ac58b
7
+ data.tar.gz: 7cc16b12bd77d47b50b0368c7f7dbc58188f9a8e980acb41e1d45428a48f47aade6d3b357c113cdeee8410e3784747300df17707c28f4eaf9107cfd0376c7e24
data/.travis.yml CHANGED
@@ -24,3 +24,11 @@ script: bundle exec rake test
24
24
  gemfile:
25
25
  - Gemfile
26
26
  - gemfiles/fluentd_v0.12.gemfile
27
+ - gemfiles/fluentd_v0.14.gemfile
28
+
29
+ matrix:
30
+ exclude:
31
+ - rvm: 2.0.0
32
+ gemfile: Gemfile
33
+ - rvm: 2.0.0
34
+ gemfile: gemfiles/fluentd_v0.14.gemfile
data/Appraisals CHANGED
@@ -1,4 +1,10 @@
1
1
  appraise "fluentd v0.12" do
2
2
  gem "fluentd", "~>0.12.0"
3
+ gem "snappy"
4
+ end
5
+
6
+ appraise "fluentd v0.14" do
7
+ gem "fluentd", "~>0.14.0"
8
+ gem "snappy"
3
9
  end
4
10
 
data/README.md CHANGED
@@ -131,6 +131,7 @@ If you want to compress data before storing it:
131
131
  </match>
132
132
 
133
133
  Note that if you set `compress gzip`, then the suffix `.gz` will be added to path (or `.bz2`, `sz`, `.lzo`).
134
+ Note that you have to install snappy gem if you want to set `compress snappy`.
134
135
 
135
136
  ### Namenode HA / Auto retry for WebHDFS known errors
136
137
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "fluent-plugin-webhdfs"
5
- gem.version = "0.5.1"
5
+ gem.version = "0.5.2"
6
6
  gem.authors = ["TAGOMORI Satoshi"]
7
7
  gem.email = ["tagomoris@gmail.com"]
8
8
  gem.summary = %q{Fluentd plugin to write data on HDFS over WebHDFS, with flexible formatting}
@@ -18,10 +18,10 @@ Gem::Specification.new do |gem|
18
18
  gem.add_development_dependency "rake"
19
19
  gem.add_development_dependency "test-unit"
20
20
  gem.add_development_dependency "appraisal"
21
+ gem.add_development_dependency "snappy", '>= 0.0.13'
21
22
  gem.add_runtime_dependency "fluentd", '>= 0.10.59'
22
23
  gem.add_runtime_dependency "fluent-mixin-plaintextformatter", '>= 0.2.1'
23
24
  gem.add_runtime_dependency "fluent-mixin-config-placeholders", ">= 0.3.0"
24
25
  gem.add_runtime_dependency "webhdfs", '>= 0.6.0'
25
26
  gem.add_runtime_dependency "bzip2-ffi"
26
- gem.add_runtime_dependency "snappy", '>= 0.0.13'
27
27
  end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "fluentd", "~>0.14.0"
6
+
7
+ gemspec :path => "../"
@@ -127,6 +127,8 @@ class Fluent::WebHDFSOutput < Fluent::TimeSlicedOutput
127
127
 
128
128
  begin
129
129
  @compressor = COMPRESSOR_REGISTRY.lookup(@compress || 'text').new
130
+ rescue Fluent::ConfigError
131
+ raise
130
132
  rescue
131
133
  $log.warn "#{@comress} not found. Use 'text' instead"
132
134
  @compressor = COMPRESSOR_REGISTRY.lookup('text').new
@@ -4,7 +4,11 @@ module Fluent
4
4
  WebHDFSOutput.register_compressor('snappy', self)
5
5
 
6
6
  def initialize(options = {})
7
- require "snappy"
7
+ begin
8
+ require "snappy"
9
+ rescue LoadError
10
+ raise Fluent::ConfigError, "Install snappy before use snappy compressor"
11
+ end
8
12
  end
9
13
 
10
14
  def ext
@@ -1,24 +1,53 @@
1
1
  require "helper"
2
2
  require "fluent/plugin/buf_memory"
3
- require "snappy"
3
+ begin
4
+ require "snappy"
5
+ rescue LoadError
6
+ end
4
7
 
5
8
  class CompressorTest < Test::Unit::TestCase
6
9
  class Snappy < self
10
+
11
+ CONFIG = %[
12
+ host namenode.local
13
+ path /hdfs/path/file.%Y%m%d.log
14
+ ]
15
+
7
16
  def setup
17
+ omit unless Object.const_defined?(:Snappy)
18
+ Fluent::Test.setup
8
19
  @compressor = Fluent::WebHDFSOutput::SnappyCompressor.new
9
20
  end
10
21
 
22
+ def create_driver(conf=CONFIG,tag='test')
23
+ Fluent::Test::OutputTestDriver.new(Fluent::WebHDFSOutput, tag).configure(conf)
24
+ end
25
+
11
26
  def test_ext
12
27
  assert_equal(".sz", @compressor.ext)
13
28
  end
14
29
 
15
30
  def test_compress
16
- chunk = Fluent::MemoryBufferChunk.new("test")
17
- chunk << "hello snappy\n" * 32 * 1024
31
+ d = create_driver
32
+ if d.instance.respond_to?(:buffer)
33
+ buffer = d.instance.buffer
34
+ else
35
+ buffer = d.instance.instance_variable_get(:@buffer)
36
+ end
37
+
38
+ if buffer.respond_to?(:generate_chunk)
39
+ chunk = buffer.generate_chunk("test")
40
+ chunk.concat("hello snappy\n" * 32 * 1024, 1)
41
+ else
42
+ chunk = buffer.new_chunk("test")
43
+ chunk << "hello snappy\n" * 32 * 1024
44
+ end
45
+
18
46
  io = Tempfile.new("snappy-")
19
47
  @compressor.compress(chunk, io)
20
48
  io.open
21
- assert(chunk.size > io.read.bytesize)
49
+ chunk_bytesize = chunk.respond_to?(:bytesize) ? chunk.bytesize : chunk.size
50
+ assert(chunk_bytesize > io.read.bytesize)
22
51
  io.rewind
23
52
  reader = ::Snappy::Reader.new(io)
24
53
  assert_equal(chunk.read, reader.read)
@@ -73,11 +73,15 @@ kerberos true
73
73
  lzo: ['lzo_command', Fluent::WebHDFSOutput::LZOCommandCompressor])
74
74
  def test_compress(data)
75
75
  compress_type, compressor_class = data
76
- d = create_driver %[
76
+ begin
77
+ d = create_driver %[
77
78
  namenode server.local:14000
78
79
  path /hdfs/path/file.%Y%m%d.%H%M.log
79
80
  compress #{compress_type}
80
- ]
81
+ ]
82
+ rescue Fluent::ConfigError => ex
83
+ omit ex.message
84
+ end
81
85
  assert_equal 'server.local', d.instance.instance_eval{ @namenode_host }
82
86
  assert_equal 14000, d.instance.instance_eval{ @namenode_port }
83
87
  assert_equal '/hdfs/path/file.%Y%m%d.%H%M.log', d.instance.path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-webhdfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-05 00:00:00.000000000 Z
11
+ date: 2016-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: snappy
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 0.0.13
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 0.0.13
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: fluentd
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -122,20 +136,6 @@ dependencies:
122
136
  - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: snappy
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: 0.0.13
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: 0.0.13
139
139
  description: For WebHDFS and HttpFs of Hadoop HDFS
140
140
  email:
141
141
  - tagomoris@gmail.com
@@ -152,6 +152,7 @@ files:
152
152
  - Rakefile
153
153
  - fluent-plugin-webhdfs.gemspec
154
154
  - gemfiles/fluentd_v0.12.gemfile
155
+ - gemfiles/fluentd_v0.14.gemfile
155
156
  - lib/fluent/plugin/out_webhdfs.rb
156
157
  - lib/fluent/plugin/webhdfs_compressor_bzip2.rb
157
158
  - lib/fluent/plugin/webhdfs_compressor_gzip.rb