accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1350783 - in /accumulo/trunk: ./ core/ core/src/main/java/org/apache/accumulo/core/iterators/FirstEntryInRowIterator.java core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java server/ src/
Date Fri, 15 Jun 2012 20:25:28 GMT
Author: billie
Date: Fri Jun 15 20:25:27 2012
New Revision: 1350783

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

Added:
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java
      - copied unchanged from r1349972, accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java
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/server/   (props changed)
    accumulo/trunk/src/   (props changed)

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

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

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=1350783&r1=1350782&r2=1350783&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
Fri Jun 15 20:25:27 2012
@@ -75,6 +75,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()))
{
       
@@ -101,10 +103,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/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/server:r1349972
  Merged /accumulo/branches/1.3/src/server:r1349971
  Merged /accumulo/branches/1.4/src/server:r1349972

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



Mime
View raw message