You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2013/09/26 00:22:16 UTC
svn commit: r1526321 -
/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
Author: tedyu
Date: Wed Sep 25 22:22:16 2013
New Revision: 1526321
URL: http://svn.apache.org/r1526321
Log:
HBASE-9654 Optimize HStore#getRowKeyAtOrBefore() when exact match is found
Modified:
hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java?rev=1526321&r1=1526320&r2=1526321&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java Wed Sep 25 22:22:16 2013
@@ -1462,8 +1462,10 @@ public class HStore implements Store {
StoreFile sf = sfIterator.next();
sfIterator.remove(); // Remove sf from iterator.
boolean haveNewCandidate = rowAtOrBeforeFromStoreFile(sf, state);
+ KeyValue keyv = state.getCandidate();
+ // we have an optimization here which stops the search if we find exact match.
+ if (keyv != null && keyv.matchingRow(row)) return state.getCandidate();
if (haveNewCandidate) {
- // TODO: we may have an optimization here which stops the search if we find exact match.
sfIterator = this.storeEngine.getStoreFileManager().updateCandidateFilesForRowKeyBefore(
sfIterator, state.getTargetKey(), state.getCandidate());
}