Apache9 commented on pull request #3904:
URL: https://github.com/apache/hbase/pull/3904#issuecomment-986040911


   Checked the code in KeyValueUtils, there is a method getSerializedSize
   
   ```
     public static int getSerializedSize(Cell cell, boolean withTags) {
       if (withTags) {
         return cell.getSerializedSize();
       }
       if (cell instanceof ExtendedCell) {
         return ((ExtendedCell) cell).getSerializedSize(withTags);
       }
       return length(cell.getRowLength(), cell.getFamilyLength(), 
cell.getQualifierLength(),
         cell.getValueLength(), cell.getTagsLength(), withTags);
     }
   ```
   
   It seems that if withTags is true, we will always call 
cell.getSerializedSize directly. I guess this is why we use getSerializedSize 
there.
   
   So let's add some comments to say that, the byte array is not used for 
serializaing, as it will copy all the fields such as column family, qualifier, 
etc, so it is not suitable to call getSerializedSize here, we should calculate 
it with all the fields.
   
   Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to