From 6ad28427b1350c3c0445145e373b3a6da158a4d5 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 8 May 2013 20:01:57 +0000 Subject: [PATCH] HBASE-7897 Add support for tags to Cell Interface git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1480430 13f79535-47bb-0310-9956-ffa450edef68 --- .../ipc/TestPayloadCarryingRpcController.java | 18 ++++++++++++++++++ .../java/org/apache/hadoop/hbase/Cell.java | 17 ++++++++++++++++- .../java/org/apache/hadoop/hbase/KeyValue.java | 17 ++++++++++++++++- .../prefixtree/decode/PrefixTreeCell.java | 14 ++++++++++++++ 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java index 5c14fa31e1b..9d05cbbdfa9 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestPayloadCarryingRpcController.java @@ -157,6 +157,24 @@ public class TestPayloadCarryingRpcController { public int getValueLength() { return Bytes.SIZEOF_INT; } + + @Override + public int getTagsOffset() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getTagsLength() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public byte[] getTagsArray() { + // TODO Auto-generated method stub + return null; + } }; } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java index 036b4edd621..662eef3ea34 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/Cell.java @@ -90,7 +90,7 @@ public interface Cell { byte[] getFamilyArray(); /** - * @return Array index of first row byte + * @return Array index of first family byte */ int getFamilyOffset(); @@ -167,5 +167,20 @@ public interface Cell { * @return Number of value bytes. Must be < valueArray.length - offset. */ int getValueLength(); + + /** + * @return the tags byte array + */ + byte[] getTagsArray(); + + /** + * @return the first offset where the tags start in the Cell + */ + int getTagsOffset(); + + /** + * @return the total length of the tags in the Cell. + */ + int getTagsLength(); } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java index 28e6129d3ed..f657202aa83 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java @@ -873,7 +873,7 @@ public class KeyValue implements Cell, HeapSize, Cloneable { /** * Clones a KeyValue. This creates a copy, re-allocating the buffer. * @return Fully copied clone of this KeyValue - * @throws CloneNotSupportedException + * @throws CloneNotSupportedException */ @Override public KeyValue clone() throws CloneNotSupportedException { @@ -2806,4 +2806,19 @@ public class KeyValue implements Cell, HeapSize, Cloneable { sum += Bytes.SIZEOF_LONG;// memstoreTS return ClassSize.align(sum); } + + @Override + public int getTagsOffset() { + throw new UnsupportedOperationException("Not implememnted"); + } + + @Override + public int getTagsLength() { + throw new UnsupportedOperationException("Not implememnted"); + } + + @Override + public byte[] getTagsArray() { + throw new UnsupportedOperationException("Not implememnted"); + } } diff --git a/hbase-prefix-tree/src/main/java/org/apache/hadoop/hbase/codec/prefixtree/decode/PrefixTreeCell.java b/hbase-prefix-tree/src/main/java/org/apache/hadoop/hbase/codec/prefixtree/decode/PrefixTreeCell.java index b4ce25fedd4..2ac472c479e 100644 --- a/hbase-prefix-tree/src/main/java/org/apache/hadoop/hbase/codec/prefixtree/decode/PrefixTreeCell.java +++ b/hbase-prefix-tree/src/main/java/org/apache/hadoop/hbase/codec/prefixtree/decode/PrefixTreeCell.java @@ -194,4 +194,18 @@ public class PrefixTreeCell implements Cell, Comparable { return kv.toString(); } + @Override + public int getTagsOffset() { + throw new UnsupportedOperationException("Not implemented"); + } + + @Override + public int getTagsLength() { + throw new UnsupportedOperationException("Not implemented"); + } + + @Override + public byte[] getTagsArray() { + throw new UnsupportedOperationException("Not implemented"); + } }