diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java index 2e112c13959..11ab068ef3d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java @@ -60,9 +60,9 @@ public class HalfStoreFileReader extends StoreFileReader { // i.e. empty column and a timestamp of LATEST_TIMESTAMP. protected final byte [] splitkey; - protected final Cell splitCell; + private final Cell splitCell; - private Optional firstKey = null; + private Optional firstKey = Optional.empty(); private boolean firstKeySeeked = false; @@ -269,7 +269,8 @@ public class HalfStoreFileReader extends StoreFileReader { public boolean seekBefore(Cell key) throws IOException { if (top) { Optional fk = getFirstKey(); - if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(), key, fk.get()) <= 0) { + if (fk.isPresent() && + PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(), key, fk.get()) <= 0) { return false; } } else {