You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/12/21 16:08:39 UTC

[hbase] branch master updated: HBASE-25425 Some notes on RawCell (#2797)

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

stack pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 56f1dbd  HBASE-25425 Some notes on RawCell (#2797)
56f1dbd is described below

commit 56f1dbd1165c9bb672e0388357415386dcd8bc7e
Author: Michael Stack <sa...@users.noreply.github.com>
AuthorDate: Mon Dec 21 08:08:22 2020 -0800

    HBASE-25425 Some notes on RawCell (#2797)
    
    Signed-off-by: Viraj Jasani <vj...@apache.org>
---
 .../src/main/java/org/apache/hadoop/hbase/client/Mutation.java | 10 ----------
 .../src/main/java/org/apache/hadoop/hbase/RawCell.java         |  6 +++++-
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
index 6ade9eb..ab6fc94 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
@@ -43,7 +43,6 @@ import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.IndividualBytesFieldCell;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.PrivateCellUtil;
-import org.apache.hadoop.hbase.RawCell;
 import org.apache.hadoop.hbase.Tag;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.io.HeapSize;
@@ -1000,25 +999,16 @@ public abstract class Mutation extends OperationWithAttributes implements Row, C
 
     @Override
     public Optional<Tag> getTag(byte type) {
-      if (cell instanceof RawCell) {
-        return ((RawCell) cell).getTag(type);
-      }
       return PrivateCellUtil.getTag(cell, type);
     }
 
     @Override
     public Iterator<Tag> getTags() {
-      if (cell instanceof RawCell) {
-        return ((RawCell) cell).getTags();
-      }
       return PrivateCellUtil.tagsIterator(cell);
     }
 
     @Override
     public byte[] cloneTags() {
-      if (cell instanceof RawCell) {
-        return ((RawCell) cell).cloneTags();
-      }
       return PrivateCellUtil.cloneTags(cell);
     }
 
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/RawCell.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/RawCell.java
index 85f8b27..d29e8ca 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/RawCell.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/RawCell.java
@@ -24,8 +24,12 @@ import java.util.Optional;
 import org.apache.yetus.audience.InterfaceAudience;
 
 /**
- * An extended version of cell that gives more power to CPs
+ * An extended version of Cell that allows CPs manipulate Tags.
  */
+// Added by HBASE-19092 to expose Tags to CPs (history server) w/o exposing ExtendedCell.
+// Why is this in hbase-common and not in hbase-server where it is used?
+// RawCell is an odd name for a class that is only for CPs that want to manipulate Tags on
+// server-side only w/o exposing ExtendedCell -- super rare, super exotic.
 @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
 public interface RawCell extends Cell {
   static final int MAX_TAGS_LENGTH = (2 * Short.MAX_VALUE) + 1;