diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java index 9170cbef4e7..11489729d65 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterImpl.java @@ -550,7 +550,7 @@ public class HFileWriterImpl implements HFile.Writer { blockWriter.startWriting(BlockType.DATA); firstCellInBlock = null; if (lastCell != null) { - lastCellOfPreviousBlock = lastCell; + lastCellOfPreviousBlock = KeyValueUtil.toNewKeyCell(lastCell); } } @@ -728,7 +728,7 @@ public class HFileWriterImpl implements HFile.Writer { if (firstCellInBlock == null) { // If cell is big, block will be closed and this firstCellInBlock reference will only last // a short while. - firstCellInBlock = cell; + firstCellInBlock = KeyValueUtil.toNewKeyCell(cell); } // TODO: What if cell is 10MB and we write infrequently? We hold on to cell here indefinitely? @@ -748,12 +748,6 @@ public class HFileWriterImpl implements HFile.Writer { if (this.lastCell != null) { this.lastCell = KeyValueUtil.toNewKeyCell(this.lastCell); } - if (this.firstCellInBlock != null) { - this.firstCellInBlock = KeyValueUtil.toNewKeyCell(this.firstCellInBlock); - } - if (this.lastCellOfPreviousBlock != null) { - this.lastCellOfPreviousBlock = KeyValueUtil.toNewKeyCell(this.lastCellOfPreviousBlock); - } } public Cell getLastCell() {