Author: afuchs
Date: Tue Oct  9 15:38:07 2012
New Revision: 1396076

URL: http://svn.apache.org/viewvc?rev=1396076&view=rev
Log:
ACCUMULO-794 merged to trunk

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   
(props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/src/   (props changed)

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4:r1396065

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/core:r1396065
  Merged /accumulo/branches/1.4/src/core:r1396065

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java?rev=1396076&r1=1396075&r2=1396076&view=diff
==============================================================================
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
 Tue Oct  9 15:38:07 2012
@@ -75,7 +75,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())) {
@@ -92,11 +92,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
@@ -108,7 +121,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()))

Propchange: 
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged 
/accumulo/branches/1.4/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1396065

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/server:r1396065

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1396065


Reply via email to