From b639298f6e6c348756b856cecdcdc88ec44d8a73 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Tue, 31 May 2022 11:38:13 -0700 Subject: [PATCH] CompressionUtils: Increase gzip buffer size. (#12579) --- .../main/java/org/apache/druid/utils/CompressionUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/druid/utils/CompressionUtils.java b/core/src/main/java/org/apache/druid/utils/CompressionUtils.java index 124628fa460..058361bd7a8 100644 --- a/core/src/main/java/org/apache/druid/utils/CompressionUtils.java +++ b/core/src/main/java/org/apache/druid/utils/CompressionUtils.java @@ -72,6 +72,7 @@ public class CompressionUtils private static final String ZIP_SUFFIX = ".zip"; private static final String SNAPPY_SUFFIX = ".sz"; private static final String ZSTD_SUFFIX = ".zst"; + private static final int GZIP_BUFFER_SIZE = 8192; // Default is 512 /** * Zip the contents of directory into the file indicated by outputZipFile. Sub directories are skipped @@ -370,7 +371,8 @@ public class CompressionUtils // so we estimate about 1KiB to work around available == 0 bug in GZIPInputStream return otherAvailable == 0 ? 1 << 10 : otherAvailable; } - } + }, + GZIP_BUFFER_SIZE ); }