From eedd976c6e65d000adebf121e8ce97873ff2f2d3 Mon Sep 17 00:00:00 2001 From: stack Date: Sun, 20 Dec 2020 20:25:09 -0800 Subject: [PATCH] HBASE-25425 Some notes on RawCell --- .../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 de85ddd9759..d49b7257e50 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 getTag(byte type) { - if (cell instanceof RawCell) { - return ((RawCell) cell).getTag(type); - } return PrivateCellUtil.getTag(cell, type); } @Override public Iterator 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 85f8b278de4..d29e8ca8bdc 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;