You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by pa...@apache.org on 2024/07/25 18:26:51 UTC

(hbase) branch branch-2.5 updated: HBASE-28655 IllegalArgumentException: Illegal bufferSize thrown when hbase.io.compress.zstd.buffersize is not configured (#6114) (#6121)

This is an automated email from the ASF dual-hosted git repository.

pankajkumar pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.5 by this push:
     new deec0aa2cc7 HBASE-28655 IllegalArgumentException: Illegal bufferSize thrown when hbase.io.compress.zstd.buffersize is not configured (#6114) (#6121)
deec0aa2cc7 is described below

commit deec0aa2cc7fb49a7c452cb101b427423cd4f623
Author: Pankaj <pa...@apache.org>
AuthorDate: Thu Jul 25 23:50:34 2024 +0530

    HBASE-28655 IllegalArgumentException: Illegal bufferSize thrown when hbase.io.compress.zstd.buffersize is not configured (#6114) (#6121)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    Reviewed-by: Vineet Kumar Maheshwari <vi...@gmail.com>
    (cherry picked from commit 73f2710e47557218dcf92cc3e7b1788dfbb57fd2)
    (cherry picked from commit c6e819ea9fc5604bde7a619dc8be206440907b80)
---
 .../apache/hadoop/hbase/io/compress/aircompressor/ZstdCodec.java    | 6 +++---
 .../java/org/apache/hadoop/hbase/io/compress/zstd/ZstdCodec.java    | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/hbase-compression/hbase-compression-aircompressor/src/main/java/org/apache/hadoop/hbase/io/compress/aircompressor/ZstdCodec.java b/hbase-compression/hbase-compression-aircompressor/src/main/java/org/apache/hadoop/hbase/io/compress/aircompressor/ZstdCodec.java
index ba7119d8336..8a9a2b7719f 100644
--- a/hbase-compression/hbase-compression-aircompressor/src/main/java/org/apache/hadoop/hbase/io/compress/aircompressor/ZstdCodec.java
+++ b/hbase-compression/hbase-compression-aircompressor/src/main/java/org/apache/hadoop/hbase/io/compress/aircompressor/ZstdCodec.java
@@ -159,10 +159,10 @@ public class ZstdCodec implements Configurable, CompressionCodec {
   // 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;
   }
 
 }
diff --git a/hbase-compression/hbase-compression-zstd/src/main/java/org/apache/hadoop/hbase/io/compress/zstd/ZstdCodec.java b/hbase-compression/hbase-compression-zstd/src/main/java/org/apache/hadoop/hbase/io/compress/zstd/ZstdCodec.java
index 1c851a61c20..7b97c817aca 100644
--- a/hbase-compression/hbase-compression-zstd/src/main/java/org/apache/hadoop/hbase/io/compress/zstd/ZstdCodec.java
+++ b/hbase-compression/hbase-compression-zstd/src/main/java/org/apache/hadoop/hbase/io/compress/zstd/ZstdCodec.java
@@ -127,10 +127,10 @@ public class ZstdCodec implements Configurable, CompressionCodec {
   }
 
   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) {