Skip to content

Commit

Permalink
compress -> compressed
Browse files Browse the repository at this point in the history
  • Loading branch information
ganmacs committed Sep 1, 2016
1 parent 1e55447 commit 3808249
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def on_message(msg, chunk_size, peeraddr)
# PackedForward
option = msg[2]
size = (option && option['size']) || 0
es_class = (option && option['compress'] == 'gzip') ? CompressedMessagePackEventStream : MessagePackEventStream
es_class = (option && option['compressed'] == 'gzip') ? CompressedMessagePackEventStream : MessagePackEventStream
es = es_class.new(entries, nil, size.to_i)
es = check_and_skip_invalid_event(tag, es, peeraddr) if @skip_invalid_event
es = add_source_host(es, peeraddr[2]) if @source_hostname_key
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin/out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def send_data(node, tag, chunk)
IO.copy_stream(chunk_io, sock)
end

option = { 'size' => chunk.size_of_events, 'compress' => @compress }
option = { 'size' => chunk.size_of_events, 'compressed' => @compress.to_s }
option['chunk'] = Base64.encode64(chunk.unique_id) if @require_ack_response
sock.write option.to_msgpack

Expand Down
8 changes: 4 additions & 4 deletions test/plugin/test_in_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ def test_set_compress_to_option
[_time, record].to_msgpack(v)
entries += compress(v)
end
chunk = ["tag1", entries, { 'compress' => 'gzip' }].to_msgpack
chunk = ["tag1", entries, { 'compressed' => 'gzip' }].to_msgpack

d.run do
Fluent::Engine.msgpack_factory.unpacker.feed_each(chunk) do |obj|
option = d.instance.send(:on_message, obj, chunk.size, PEERADDR)
assert_equal 'gzip', option['compress']
assert_equal 'gzip', option['compressed']
end
end

Expand All @@ -316,15 +316,15 @@ def test_create_CompressedMessagePackEventStream_with_gzip_compress_option
[_time, record].to_msgpack(v)
entries += compress(v)
end
chunk = ["tag1", entries, { 'compress' => 'gzip' }].to_msgpack
chunk = ["tag1", entries, { 'compressed' => 'gzip' }].to_msgpack

# check CompressedMessagePackEventStream is created
mock(Fluent::CompressedMessagePackEventStream).new(entries, nil, 0)

d.run do
Fluent::Engine.msgpack_factory.unpacker.feed_each(chunk) do |obj|
option = d.instance.send(:on_message, obj, chunk.size, PEERADDR)
assert_equal 'gzip', option['compress']
assert_equal 'gzip', option['compressed']
end
end
d.emits
Expand Down

0 comments on commit 3808249

Please sign in to comment.