hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1526321 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
Date Wed, 25 Sep 2013 22:22:16 GMT
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());
         }



Mime
View raw message