accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1371526 - /accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
Date Thu, 09 Aug 2012 23:10:23 GMT
Author: kturner
Date: Thu Aug  9 23:10:23 2012
New Revision: 1371526

URL: http://svn.apache.org/viewvc?rev=1371526&view=rev
Log:
ACCUMULO-726 Made RFile next call only check range when block overlaps end of range

Modified:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java?rev=1371526&r1=1371525&r2=1371526&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java Thu Aug
 9 23:10:23 2012
@@ -487,6 +487,7 @@ public class RFile {
     private boolean isDefaultLocalityGroup;
     private boolean closed = false;
     private int version;
+    private boolean checkRange = true;
     
     private LocalityGroupReader(BlockFileReader reader, LocalityGroupMetadata lgm, int version)
throws IOException {
       this.firstKey = lgm.firstKey;
@@ -572,6 +573,11 @@ public class RFile {
           IndexEntry indexEntry = iiter.next();
           entriesLeft = indexEntry.getNumEntries();
           currBlock = getDataBlock(indexEntry);
+          
+          checkRange = range.afterEndKey(indexEntry.getKey());
+          if (!checkRange)
+            hasTop = true;
+
         } else {
           rk = null;
           val = null;
@@ -584,7 +590,8 @@ public class RFile {
       rk.readFields(currBlock);
       val.readFields(currBlock);
       entriesLeft--;
-      hasTop = !range.afterEndKey(rk.getKey());
+      if (checkRange)
+        hasTop = !range.afterEndKey(rk.getKey());
     }
     
     private ABlockReader getDataBlock(IndexEntry indexEntry) throws IOException {
@@ -724,6 +731,10 @@ public class RFile {
           entriesLeft = indexEntry.getNumEntries();
           currBlock = getDataBlock(indexEntry);
 
+          checkRange = range.afterEndKey(indexEntry.getKey());
+          if (!checkRange)
+            hasTop = true;
+
           RelativeKey tmpRk = new RelativeKey();
           MByteSequence valbs = new MByteSequence(new byte[64], 0, 0);
 
@@ -749,7 +760,6 @@ public class RFile {
                 currKey = bie.getKey();
               }
             }
-            
           }
 
           fastSkipped = tmpRk.fastSkip(currBlock, startKey, valbs, prevKey, currKey);



Mime
View raw message