You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/12/03 05:11:15 UTC

[GitHub] [hbase] shahrs87 commented on a change in pull request #2706: [HBASE-25246] Backup/Restore hbase cell tags.

shahrs87 commented on a change in pull request #2706:
URL: https://github.com/apache/hbase/pull/2706#discussion_r534672875



##########
File path: hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java
##########
@@ -2015,7 +2015,8 @@ public static void toIOException(ServiceException se) throws IOException {
       kvbuilder.setTimestamp(kv.getTimestamp());
       kvbuilder.setValue(wrap(((ByteBufferExtendedCell) kv).getValueByteBuffer(),
         ((ByteBufferExtendedCell) kv).getValuePosition(), kv.getValueLength()));
-      // TODO : Once tags become first class then we may have to set tags to kvbuilder.
+      kvbuilder.setTags(wrap(((ByteBufferExtendedCell) kv).getTagsByteBuffer(),

Review comment:
       @anoopsjohn  Thank you for your comment.
   
   > But in a scan/get RPC call, when it is issued by a client which do not support CellBlock encoding, we will use this API instead of the KV codec to send back results.
   
   IIUC the KeyValueCodec implementation that gets used (irrespective or whether cell block encoding is enabled or disabled) in scan/get rpc is determined by [getCodec method here](https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java#L230). That is determined by conf key hbase.client.rpc.codec and hbase.client.default.rpc.codec and if both are not set then the default implementation that gets used is [KeyValueCodec from here](https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AbstractRpcClient.java#L223). KeyValueCodec doesn't encode/decode tags.
   
   This is the reason that I specifically overrode `hbase.client.rpc.codec` conf property to use `org.apache.hadoop.hbase.codec.KeyValueCodecWithTags` in my test case in [Export](https://github.com/apache/hbase/blob/master/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java#L856) and [Import](https://github.com/apache/hbase/blob/master/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java#L880) tool so that we can serialize and deserialize tags.
   Anoop: Could you please verify whether my understanding is correct or not ? Thank you !




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org