You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by bi...@apache.org on 2012/06/13 19:55:06 UTC

svn commit: r1349972 - in /accumulo/branches/1.4: ./ src/ src/core/ src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java src/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java src/server/

Author: billie
Date: Wed Jun 13 17:55:05 2012
New Revision: 1349972

URL: http://svn.apache.org/viewvc?rev=1349972&view=rev
Log:
ACCUMULO-633 created test and fixed seek behavior of FirstEntryInRowIterator - merged to 1.4 branch

Added:
    accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java
      - copied unchanged from r1349971, accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java
Modified:
    accumulo/branches/1.4/   (props changed)
    accumulo/branches/1.4/src/   (props changed)
    accumulo/branches/1.4/src/core/   (props changed)
    accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
    accumulo/branches/1.4/src/server/   (props changed)

Propchange: accumulo/branches/1.4/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.3:r1349971

Propchange: accumulo/branches/1.4/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.3/src:r1349971

Propchange: accumulo/branches/1.4/src/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.3/src/core:r1349971

Modified: accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java?rev=1349972&r1=1349971&r2=1349972&view=diff
==============================================================================
--- accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java (original)
+++ accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java Wed Jun 13 17:55:05 2012
@@ -86,6 +86,8 @@ public class FirstEntryInRowIterator ext
   // this is only ever called immediately after getting "next" entry
   @Override
   protected void consume() throws IOException {
+    if (lastRowFound == null)
+      return;
     int count = 0;
     while (getSource().hasTop() && lastRowFound.equals(getSource().getTopKey().getRow())) {
       
@@ -112,10 +114,17 @@ public class FirstEntryInRowIterator ext
     latestRange = range;
     latestColumnFamilies = columnFamilies;
     latestInclusive = inclusive;
+    lastRowFound = null;
     
-    // seek to first possible pattern in range
-    super.seek(range, columnFamilies, inclusive);
-    lastRowFound = getSource().hasTop() ? getSource().getTopKey().getRow() : null;
+    Key startKey = range.getStartKey();
+    Range seekRange = new Range(startKey == null ? null : new Key(startKey.getRow()), true, range.getEndKey(), range.isEndKeyInclusive());
+    super.seek(seekRange, columnFamilies, inclusive);
+    
+    if (getSource().hasTop()) {
+      lastRowFound = getSource().getTopKey().getRow();
+      if (range.beforeStartKey(getSource().getTopKey()))
+        consume();
+    }
   }
   
   @Override

Propchange: accumulo/branches/1.4/src/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.3/src/server:r1349971