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


The following commit(s) were added to refs/heads/HBASE-21879 by this push:
     new 582890c  HBASE-21917 Make the HFileBlock#validateChecksum can accept 
ByteBuff as an input. (addendum)
582890c is described below

commit 582890c9a9244c882e2dd75609009e4642d5f718
Author: huzheng <open...@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) {

Reply via email to