.../org/apache/hadoop/hbase/io/encoding/NoneEncoder.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/NoneEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/NoneEncoder.java index 4b8d203..d5d0d4f 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/NoneEncoder.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/NoneEncoder.java @@ -23,6 +23,7 @@ import java.io.IOException; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; +import org.apache.hadoop.hbase.ExtendedCell; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.classification.InterfaceAudience; @@ -44,10 +45,17 @@ public class NoneEncoder { int klength = KeyValueUtil.keyLength(cell); int vlength = cell.getValueLength(); - out.writeInt(klength); - out.writeInt(vlength); - CellUtil.writeFlatKey(cell, out); - CellUtil.writeValue(out, cell, vlength); + if (cell instanceof ExtendedCell) { + // We write tags seperately because though there is no tag in KV + // if the hfilecontext says include tags we need the tags length to be + // written + ((ExtendedCell) cell).write(out, false); + } else { + out.writeInt(klength); + out.writeInt(vlength); + CellUtil.writeFlatKey(cell, out); + CellUtil.writeValue(out, cell, vlength); + } int size = klength + vlength + KeyValue.KEYVALUE_INFRASTRUCTURE_SIZE; // Write the additional tag into the stream if (encodingCtx.getHFileContext().isIncludesTags()) {