svn commit: r1396065 - /accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java
Author: afuchs Date: Tue Oct 9 15:17:32 2012 New Revision: 1396065 URL: http://svn.apache.org/viewvc?rev=1396065view=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=1396065r1=1396064r2=1396065view=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, CollectionByteSequence 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()))
svn commit: r1396076 - in /accumulo/trunk: ./ core/ core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java fate/src/main/java/org/apache/accumulo/fate/ZooStore.java server/
Author: afuchs Date: Tue Oct 9 15:38:07 2012 New Revision: 1396076 URL: http://svn.apache.org/viewvc?rev=1396076view=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=1396076r1=1396075r2=1396076view=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, CollectionByteSequence 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