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:15:26 UTC

[hbase] branch branch-2.2 updated: HBASE-25425 Some notes on RawCell

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

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


The following commit(s) were added to refs/heads/branch-2.2 by this push:
     new 9aac9db  HBASE-25425 Some notes on RawCell
9aac9db is described below

commit 9aac9dbdc950fbad15e4370bfc9b9b4ab3952c45
Author: stack <st...@apache.org>
AuthorDate: Sun Dec 20 20:25:09 2020 -0800

    HBASE-25425 Some notes on RawCell
---
 .../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 8bfdf89..47e595f 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
@@ -40,7 +40,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;
@@ -932,25 +931,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;