accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afu...@apache.org
Subject svn commit: r1396065 - /accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
Date Tue, 09 Oct 2012 15:17:32 GMT
Author: afuchs
Date: Tue Oct  9 15:17:32 2012
New Revision: 1396065

URL: http://svn.apache.org/viewvc?rev=1396065&view=rev
Log:
ACCUMULO-794

Modified:
    accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java

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=1396065&r1=1396064&r2=1396065&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
Tue Oct  9 15:17:32 2012
@@ -86,7 +86,7 @@ public class FirstEntryInRowIterator ext
   // this is only ever called immediately after getting "next" entry
   @Override
   protected void consume() throws IOException {
-    if (lastRowFound == null)
+    if (finished == true || lastRowFound == null)
       return;
     int count = 0;
     while (getSource().hasTop() && lastRowFound.equals(getSource().getTopKey().getRow()))
{
@@ -103,11 +103,24 @@ public class FirstEntryInRowIterator ext
         Key nextKey = getSource().getTopKey().followingKey(PartialKey.ROW);
         if (!latestRange.afterEndKey(nextKey))
           getSource().seek(new Range(nextKey, true, latestRange.getEndKey(), latestRange.isEndKeyInclusive()),
latestColumnFamilies, latestInclusive);
+        else
+        {
+          finished = true;
+          break;
+        }
       }
     }
     lastRowFound = getSource().hasTop() ? getSource().getTopKey().getRow(lastRowFound) :
null;
   }
   
+  private boolean finished = true;
+
+  @Override
+  public boolean hasTop()
+  {
+    return !finished && getSource().hasTop();
+  }
+
   @Override
   public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
     // save parameters for future internal seeks
@@ -119,7 +132,8 @@ public class FirstEntryInRowIterator ext
     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);
-    
+    finished = false;
+
     if (getSource().hasTop()) {
       lastRowFound = getSource().getTopKey().getRow();
       if (range.beforeStartKey(getSource().getTopKey()))



Mime
View raw message