You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2012/01/10 23:04:51 UTC

svn commit: r1229758 - /incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java

Author: kturner
Date: Tue Jan 10 22:04:51 2012
New Revision: 1229758

URL: http://svn.apache.org/viewvc?rev=1229758&view=rev
Log:
ACCUMULO-301 made intersecting iterator fail on client side when specifying less than two terms 

Modified:
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java?rev=1229758&r1=1229757&r2=1229758&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java Tue Jan 10 22:04:51 2012
@@ -541,6 +541,8 @@ public class IntersectingIterator implem
    * @param columns
    */
   public static void setColumnFamilies(IteratorSetting cfg, Text[] columns) {
+    if (columns.length < 2)
+      throw new IllegalArgumentException("Must supply at least two terms to intersect");
     cfg.addOption(IntersectingIterator.columnFamiliesOptionName, IntersectingIterator.encodeColumns(columns));
   }
   
@@ -552,6 +554,8 @@ public class IntersectingIterator implem
    * @param notFlags
    */
   public static void setColumnFamilies(IteratorSetting cfg, Text[] columns, boolean[] notFlags) {
+    if (columns.length < 2)
+      throw new IllegalArgumentException("Must supply at least two terms to intersect");
     if (columns.length != notFlags.length)
       throw new IllegalArgumentException("columns and notFlags arrays must be the same length");
     setColumnFamilies(cfg, columns);