Skip to content

Commit

Permalink
HBASE-25425 Some notes on RawCell
Browse files Browse the repository at this point in the history
(cherry picked from commit 9aac9db)

Change-Id: I72daba84319cb0d42e321b9ec6f2d784fe6020d8
  • Loading branch information
saintstack committed Jan 4, 2021
1 parent 8c5c622 commit a46dd73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
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;
Expand Down Expand Up @@ -932,25 +931,16 @@ public byte getTypeByte() {

@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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
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;
Expand Down

0 comments on commit a46dd73

Please sign in to comment.