lib/fluent/plugin/webhdfs_compressor_snappy.rb in fluent-plugin-webhdfs-1.2.4 vs lib/fluent/plugin/webhdfs_compressor_snappy.rb in fluent-plugin-webhdfs-1.2.5
- old
+ new
@@ -14,12 +14,13 @@
def ext
".sz"
end
def compress(chunk, tmp)
- w = Snappy::Writer.new(tmp)
- chunk.write_to(w)
- w.close
+ Snappy::Writer.new(tmp) do |w|
+ w << chunk.read
+ w.flush
+ end
end
end
end
end