[ 
https://issues.apache.org/jira/browse/HBASE-7414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13545206#comment-13545206
 ] 

Ted Yu commented on HBASE-7414:
-------------------------------

In serialize():
{code}
+    if (majorVersion > 2 || (majorVersion == 2 && minorVersion >= 
PBUF_TRAILER_MINOR_VERSION)) {
+      serializeAsPB(baosDos);
+    } else {
+      serializeAsWritable(baosDos);
+    }
{code}
In computeTrailerSizeByVersion():
{code}
      FixedFileTrailer fft = new FixedFileTrailer(version, 
                                   HFileBlock.MINOR_VERSION_NO_CHECKSUM);
{code}
Since we don't change majorVersion in this patch and MINOR_VERSION_NO_CHECKSUM 
is used to fill up versionToSize array, we would use serializeAsWritable() 
method for majorVersion being 2.

In serializeAsPB():
{code}
+    int padding = getTrailerSize() - NOT_PB_SIZE - baos.size();
+    if (padding < 0) {
+      throw new RuntimeException("Pbuf encoding size exceeded fixed trailer 
size limit");
+    }
{code}
The above check limits the amount of metadata that can be added using protobuf 
format. How big is padding at the moment ? Would it be big enough to serve us 
until majorVersion is bumped to 3 ?

Thanks
                
> Convert some HFile metadata to PB
> ---------------------------------
>
>                 Key: HBASE-7414
>                 URL: https://issues.apache.org/jira/browse/HBASE-7414
>             Project: HBase
>          Issue Type: Task
>          Components: HFile
>            Reporter: stack
>            Assignee: Andrew Purtell
>            Priority: Critical
>             Fix For: 0.96.0
>
>         Attachments: 7414.patch, 7414.patch
>
>
> See HBASE-7201
> Convertion should be in a manner that does not prevent our being able to read 
> old style hfiles with Writable metadata.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to