diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java index 39b3653..6d07d07 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java @@ -661,10 +661,8 @@ public class KeyValueUtil { * Write the given cell in KeyValue serialization format into the given buf and return a new * KeyValue object around that. */ - public static KeyValue copyCellTo(Cell cell, byte[] buf, int offset) { + public static KeyValue copyCellTo(Cell cell, byte[] buf, int offset, int len) { int tagsLen = cell.getTagsLength(); - int len = length(cell.getRowLength(), cell.getFamilyLength(), cell.getQualifierLength(), - cell.getValueLength(), tagsLen, true); if (cell instanceof ExtendedCell) { ((ExtendedCell) cell).write(buf, offset); } else { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemStoreLAB.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemStoreLAB.java index aa49c57..378601d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemStoreLAB.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemStoreLAB.java @@ -26,11 +26,11 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.KeyValueUtil; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.regionserver.MemStoreChunkPool.PooledChunk; -import org.apache.hadoop.conf.Configuration; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; @@ -130,7 +130,7 @@ public class HeapMemStoreLAB implements MemStoreLAB { // try to retire this chunk tryRetireChunk(c); } - return KeyValueUtil.copyCellTo(cell, c.getData(), allocOffset); + return KeyValueUtil.copyCellTo(cell, c.getData(), allocOffset, size); } /**