Skip to content

Commit

Permalink
HBASE-28655 IllegalArgumentException: Illegal bufferSize thrown when …
Browse files Browse the repository at this point in the history
…hbase.io.compress.zstd.buffersize is not configured (#6114)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Reviewed-by: Vineet Kumar Maheshwari <vineet.4008@gmail.com>
  • Loading branch information
pankaj72981 authored Jul 25, 2024
1 parent 1315871 commit 73f2710
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ public class HadoopZstdDecompressor extends HadoopDecompressor<ZstdDecompressor>
// Package private

static int getBufferSize(Configuration conf) {
return conf.getInt(ZSTD_BUFFER_SIZE_KEY,
int size = conf.getInt(ZSTD_BUFFER_SIZE_KEY,
conf.getInt(CommonConfigurationKeys.IO_COMPRESSION_CODEC_ZSTD_BUFFER_SIZE_KEY,
// IO_COMPRESSION_CODEC_ZSTD_BUFFER_SIZE_DEFAULT is 0! We can't allow that.
ZSTD_BUFFER_SIZE_DEFAULT));
CommonConfigurationKeys.IO_COMPRESSION_CODEC_ZSTD_BUFFER_SIZE_DEFAULT));
return size > 0 ? size : ZSTD_BUFFER_SIZE_DEFAULT;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ static int getLevel(Configuration conf) {
}

static int getBufferSize(Configuration conf) {
return conf.getInt(ZSTD_BUFFER_SIZE_KEY,
int size = conf.getInt(ZSTD_BUFFER_SIZE_KEY,
conf.getInt(CommonConfigurationKeys.IO_COMPRESSION_CODEC_ZSTD_BUFFER_SIZE_KEY,
// IO_COMPRESSION_CODEC_ZSTD_BUFFER_SIZE_DEFAULT is 0! We can't allow that.
ZSTD_BUFFER_SIZE_DEFAULT));
CommonConfigurationKeys.IO_COMPRESSION_CODEC_ZSTD_BUFFER_SIZE_DEFAULT));
return size > 0 ? size : ZSTD_BUFFER_SIZE_DEFAULT;
}

static byte[] getDictionary(final Configuration conf) {
Expand Down

0 comments on commit 73f2710

Please sign in to comment.