You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by op...@apache.org on 2019/06/18 12:32:05 UTC

[hbase] 03/22: HBASE-21917 Make the HFileBlock#validateChecksum can accept ByteBuff as an input. (addendum)

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

openinx pushed a commit to branch HBASE-21879
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 6aec70991ec05c06a5630c8258b48bba24481e47
Author: huzheng <op...@gmail.com>
AuthorDate: Thu Mar 7 10:19:32 2019 +0800

    HBASE-21917 Make the HFileBlock#validateChecksum can accept ByteBuff as an input. (addendum)
---
 .../src/main/java/org/apache/hadoop/hbase/io/hfile/ChecksumUtil.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/ChecksumUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/ChecksumUtil.java
index 5317f0e..dc007f7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/ChecksumUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/ChecksumUtil.java
@@ -91,7 +91,7 @@ public class ChecksumUtil {
    */
   private static boolean verifyChunkedSums(DataChecksum dataChecksum, ByteBuff data,
       ByteBuff checksums, String pathName) {
-    // Almost all of the HFile Block are about 64KB, so it would be a SingleByteBuff, use the
+    // Almost all of the HFile Block are about 64KB, and it would be a SingleByteBuff, use the
     // Hadoop's verify checksum directly, because it'll use the native checksum, which has no extra
     // byte[] allocation or copying. (HBASE-21917)
     if (data instanceof SingleByteBuff && checksums instanceof SingleByteBuff) {
@@ -108,8 +108,7 @@ public class ChecksumUtil {
       }
     }
 
-    // Only when the dataBlock is larger than 4MB (default buffer size in BucketCache), the block
-    // will be an MultiByteBuff. we use a small byte[] to update the checksum many times for
+    // If the block is a MultiByteBuff. we use a small byte[] to update the checksum many times for
     // reducing GC pressure. it's a rare case.
     int checksumTypeSize = dataChecksum.getChecksumType().size;
     if (checksumTypeSize == 0) {