File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -641,11 +641,7 @@ def content_type
641
641
end
642
642
643
643
def compress ( chunk , tmp )
644
- uncompressed_data = ''
645
- chunk . open do |io |
646
- uncompressed_data = io . read
647
- end
648
- compressed_data = Zstd . compress ( uncompressed_data , level : @level )
644
+ compressed_data = Zstd . compress ( chunk . read , level : @level )
649
645
tmp . write ( compressed_data )
650
646
rescue => e
651
647
log . warn "zstd compression failed: #{ e . message } "
Original file line number Diff line number Diff line change @@ -467,20 +467,20 @@ def test_write_with_custom_s3_object_key_format_containing_hex_random_placeholde
467
467
def test_write_with_zstd
468
468
setup_mocks ( true )
469
469
s3_local_file_path = "/tmp/s3-test.zst"
470
-
470
+
471
471
expected_s3path = "log/events/ts=20110102-13/events_0-#{ Socket . gethostname } .zst"
472
-
472
+
473
473
setup_s3_object_mocks ( s3_local_file_path : s3_local_file_path , s3path : expected_s3path )
474
-
474
+
475
475
config = CONFIG_TIME_SLICE + "\n store_as zstd\n "
476
476
d = create_time_sliced_driver ( config )
477
-
477
+
478
478
time = event_time ( "2011-01-02 13:14:15 UTC" )
479
479
d . run ( default_tag : "test" ) do
480
480
d . feed ( time , { "a" => 1 } )
481
481
d . feed ( time , { "a" => 2 } )
482
482
end
483
-
483
+
484
484
File . open ( s3_local_file_path , 'rb' ) do |file |
485
485
compressed_data = file . read
486
486
uncompressed_data = Zstd . decompress ( compressed_data )
You can’t perform that action at this time.
0 commit comments