incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1205880 - in /incubator/accumulo/branches/1.3/src/core/src: main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java
Date Thu, 24 Nov 2011 15:27:55 GMT
Author: ecn
Date: Thu Nov 24 15:27:55 2011
New Revision: 1205880

URL: http://svn.apache.org/viewvc?rev=1205880&view=rev
Log:
ACCUMULO-178 Jason Trost's fix for off-by-one error

Modified:
    incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java
    incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java?rev=1205880&r1=1205879&r2=1205880&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java
(original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java
Thu Nov 24 15:27:55 2011
@@ -149,7 +149,7 @@ public class FamilyIntersectingIterator 
     if (log.isTraceEnabled())
       log.trace(zeroIndex + " " + currentDocID.getLength());
     Text colq = new Text();
-    colq.set(currentDocID.getBytes(), zeroIndex + 1, currentDocID.getLength() - zeroIndex
- 2);
+    colq.set(currentDocID.getBytes(), zeroIndex + 1, currentDocID.getLength() - zeroIndex
- 1);
     Key k = new Key(currentPartition, colf, colq);
     if (log.isTraceEnabled())
       log.trace("built doc key for seek: " + k.toString());

Modified: incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java?rev=1205880&r1=1205879&r2=1205880&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java
(original)
+++ incubator/accumulo/branches/1.3/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java
Thu Nov 24 15:27:55 2011
@@ -114,6 +114,7 @@ public class FamilyIntersectingIteratorT
             sb.append(cf);
           }
         }
+        sb.append(" docID=").append(doc);
         Key k = new Key(row, docColf, new Text(String.format("%010d", docid).getBytes()));
         map.put(k, new Value(sb.toString().getBytes()));
       }
@@ -183,9 +184,13 @@ public class FamilyIntersectingIteratorT
     while (iter.hasTop()) {
       hitCount++;
       Key k = iter.getTopKey();
+      Value v = iter.getTopValue();
       // System.out.println(k.toString());
       // System.out.println(iter.getDocID(k));
+      
       assertTrue(docs.contains(iter.getDocID(k)));
+      assertTrue(new String(v.get()).endsWith(" docID="+iter.getDocID(k)));
+      
       iter.next();
     }
     assertEquals(hitCount, docs.size());
@@ -215,7 +220,9 @@ public class FamilyIntersectingIteratorT
     while (iter.hasTop()) {
       hitCount++;
       Key k = iter.getTopKey();
+      Value v = iter.getTopValue();
       assertTrue(docs.contains(iter.getDocID(k)));
+      assertTrue(new String(v.get()).endsWith(" docID="+iter.getDocID(k)));
       iter.next();
     }
     assertEquals(hitCount, docs.size());
@@ -253,7 +260,9 @@ public class FamilyIntersectingIteratorT
     while (iter.hasTop()) {
       hitCount++;
       Key k = iter.getTopKey();
+      Value v = iter.getTopValue();
       assertTrue(docs.contains(iter.getDocID(k)));
+      assertTrue(new String(v.get()).endsWith(" docID="+iter.getDocID(k)));
       iter.next();
     }
     assertEquals(hitCount, docs.size());



Mime
View raw message