incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1207551 [1/2] - in /incubator/accumulo/trunk: ./ src/core/src/main/java/org/apache/accumulo/core/client/ src/core/src/main/java/org/apache/accumulo/core/client/admin/ src/core/src/main/java/org/apache/accumulo/core/client/mock/ src/core/sr...
Date Mon, 28 Nov 2011 19:59:39 GMT
Author: billie
Date: Mon Nov 28 19:59:37 2011
New Revision: 1207551

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

Added:
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIteratorTest.java
      - copied unchanged from r1207545, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIteratorTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/system/ColumnFilterTest.java
      - copied unchanged from r1207545, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/system/ColumnFilterTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
      - copied unchanged from r1207545, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/FilterTest.java
      - copied unchanged from r1207545, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/FilterTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
      - copied unchanged from r1207545, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
      - copied unchanged from r1207545, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
      - copied unchanged from r1207545, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
Removed:
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/ColumnFamilySkippingIteratorTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/ColumnFilterTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/CombinerTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/FilterTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/LargeRowFilterTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/RegExFilterTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/VersioningIteratorTest.java
Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScanner.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Filter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/LargeRowFilter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/NoVisFilter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/RowDeletingIteratorTest.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/functional/ServerSideErrorTest.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 28 19:59:37 2011
@@ -1,2 +1,2 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169
-/incubator/accumulo/branches/1.4:1201902-1205055
+/incubator/accumulo/branches/1.4:1201902-1207545

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java Mon Nov 28 19:59:37 2011
@@ -16,8 +16,7 @@
  */
 package org.apache.accumulo.core.client;
 
-import java.util.Collections;
-import java.util.EnumMap;
+import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -25,30 +24,34 @@ import java.util.Set;
 
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
+import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.util.ArgumentChecker;
+import org.apache.accumulo.core.util.Pair;
+import org.apache.hadoop.io.Text;
 
 /**
- * Configure a scan-time iterator.
+ * Configure an iterator for minc, majc, and/or scan. By default, IteratorSetting will be configured for scan.
+ * 
+ * Every iterator has a priority, a name, a class, a set of scopes, and configuration parameters.
  * 
- * Every iterator has a priority, a name, a class and any number of named configuration parameters. The typical use case:
+ * A typical use case configured for scan:
  * 
  * <pre>
  * IteratorSetting cfg = new IteratorSetting(priority, &quot;myIter&quot;, MyIterator.class);
- * MyIterator.setOption(cfg, 42);
+ * MyIterator.addOption(cfg, 42);
  * scanner.addScanIterator(cfg);
  * </pre>
- * 
  */
 public class IteratorSetting {
   private int priority;
   private String name;
   private String iteratorClass;
-  private Map<IteratorScope,Map<String,String>> properties = new EnumMap<IteratorScope,Map<String,String>>(IteratorScope.class);
+  private EnumSet<IteratorScope> scopes;
+  private Map<String,String> properties;
   
   /**
-   * Set layer at which this iterator applies. See {@link #setPriority(int) for how the priority is used.}
+   * Get layer at which this iterator applies. See {@link #setPriority(int) for how the priority is used.}
    * 
    * @return the priority of this Iterator
    */
@@ -57,10 +60,14 @@ public class IteratorSetting {
   }
   
   /**
+   * Set layer at which this iterator applies.
+   * 
    * @param priority
-   *          determines the order in which iterators are applied (system iterators are always applied first, then per-table and scan-time, lowest first)
+   *          determines the order in which iterators are applied (system iterators are always applied first, then user-configured iterators, lowest priority
+   *          first)
    */
   public void setPriority(int priority) {
+    ArgumentChecker.strictlyPositive(priority);
     this.priority = priority;
   }
   
@@ -79,6 +86,7 @@ public class IteratorSetting {
    * @param name
    */
   public void setName(String name) {
+    ArgumentChecker.notNull(name);
     this.name = name;
   }
   
@@ -98,87 +106,162 @@ public class IteratorSetting {
    * @param iteratorClass
    */
   public void setIteratorClass(String iteratorClass) {
+    ArgumentChecker.notNull(iteratorClass);
     this.iteratorClass = iteratorClass;
   }
   
   /**
-   * Get any properties set on the iterator. Note that this will be a merged view of the settings for all scopes.
+   * Get the scopes under which this iterator will be configured.
+   * 
+   * @return the scopes
+   */
+  public EnumSet<IteratorScope> getScopes() {
+    return scopes;
+  }
+  
+  /**
+   * Set the scopes under which this iterator will be configured.
    * 
-   * @return a read-only copy of the named options (for all scopes)
+   * @param scopes
+   *          the scopes to set
+   */
+  public void setScopes(EnumSet<IteratorScope> scopes) {
+    ArgumentChecker.notNull(scopes);
+    if (scopes.isEmpty())
+      throw new IllegalArgumentException("empty scopes");
+    this.scopes = scopes;
+  }
+  
+  /**
+   * Get the configuration parameters for this iterator.
+   * 
+   * @return the properties
    */
   public Map<String,String> getProperties() {
-    Map<String,String> result = new HashMap<String,String>();
-    for (Map<String,String> props : properties.values()) {
-      result.putAll(props);
-    }
-    return result;
+    return properties;
+  }
+  
+  /**
+   * Set the configuration parameters for this iterator.
+   * 
+   * @param properties
+   *          the properties to set
+   */
+  public void setProperties(Map<String,String> properties) {
+    this.properties.clear();
+    addOptions(properties);
+  }
+
+  /**
+   * @return <tt>true</tt> if this iterator has configuration parameters.
+   */
+  public boolean hasProperties() {
+    return !properties.isEmpty();
   }
   
   /**
-   * Construct a basic iterator setting with all the required values.
+   * Constructs an iterator setting configured for the scan scope with no parameters. (Parameters can be added later.)
    * 
    * @param priority
    *          the priority for the iterator @see {@link #setPriority(int)}
    * @param name
-   *          the name for the iterator
+   *          the distinguishing name for the iterator
    * @param iteratorClass
-   *          the full class name for the iterator
+   *          the fully qualified class name for the iterator
    */
   public IteratorSetting(int priority, String name, String iteratorClass) {
-    ArgumentChecker.notNull(name, iteratorClass);
-    this.priority = priority;
-    this.name = name;
-    this.iteratorClass = iteratorClass;
+    this(priority, name, iteratorClass, EnumSet.of(IteratorScope.scan), new HashMap<String,String>());
   }
   
   /**
-   * Construct a basic iterator setting.
+   * Constructs an iterator setting configured for the specified scopes with the specified parameters.
    * 
    * @param priority
    *          the priority for the iterator @see {@link #setPriority(int)}
    * @param name
-   *          the name for the iterator
+   *          the distinguishing name for the iterator
    * @param iteratorClass
-   *          the full class name for the iterator
-   * @param scope
-   *          the scope of the iterator
+   *          the fully qualified class name for the iterator
+   * @param scopes
+   *          the scopes of the iterator
    * @param properties
    *          any properties for the iterator
    */
-  public IteratorSetting(int priority, String name, String iteratorClass, IteratorScope scope, Map<String,String> properties) {
-    ArgumentChecker.notNull(name, iteratorClass, scope);
-    this.priority = priority;
-    this.name = name;
-    this.iteratorClass = iteratorClass;
-    addOptions(scope, properties);
+  public IteratorSetting(int priority, String name, String iteratorClass, EnumSet<IteratorScope> scopes, Map<String,String> properties) {
+    setPriority(priority);
+    setName(name);
+    setIteratorClass(iteratorClass);
+    setScopes(scopes);
+    this.properties = new HashMap<String,String>();
+    setProperties(properties);
   }
   
   /**
+   * Constructs an iterator setting using the given class's SimpleName for the iterator name. The iterator setting will be configured for the scan scope with no
+   * parameters.
+   * 
+   * @param priority
+   *          the priority for the iterator @see {@link #setPriority(int)}
+   * @param iteratorClass
+   *          the class for the iterator
+   */
+  public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) {
+    this(priority, iteratorClass.getSimpleName(), iteratorClass.getName());
+  }
+  
+  /**
+   * Constructs an iterator setting using the given class's SimpleName for the iterator name and configured for the specified scopes with the specified
+   * parameters.
+   * 
+   * @param priority
+   *          the priority for the iterator @see {@link #setPriority(int)}
+   * @param iteratorClass
+   *          the class for the iterator
+   * @param scopes
+   *          the scopes of the iterator
+   * @param properties
+   *          any properties for the iterator
+   */
+  public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, EnumSet<IteratorScope> scopes,
+      Map<String,String> properties) {
+    this(priority, iteratorClass.getSimpleName(), iteratorClass.getName(), scopes, properties);
+  }
+  
+  /**
+   * Constructs an iterator setting configured for the scan scope with no parameters.
+   * 
    * @param priority
    *          the priority for the iterator @see {@link #setPriority(int)}
    * @param name
-   *          the name for the iterator
+   *          the distinguishing name for the iterator
    * @param iteratorClass
-   *          the class to use for the class name
+   *          the class for the iterator
    */
   public IteratorSetting(int priority, String name, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) {
     this(priority, name, iteratorClass.getName());
   }
   
   /**
-   * Constructs an ScanIterator using the given class's SimpleName for the iterator name
+   * Constructs an iterator setting configured for the specified scopes with the specified parameters.
    * 
    * @param priority
-   *          the priority for the iterator
+   *          the priority for the iterator @see {@link #setPriority(int)}
+   * @param name
+   *          the distinguishing name for the iterator
    * @param iteratorClass
-   *          the class to use for the iterator
+   *          the class for the iterator
+   * @param scopes
+   *          the scopes of the iterator
+   * @param properties
+   *          any properties for the iterator
    */
-  public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) {
-    this(priority, iteratorClass.getSimpleName(), iteratorClass.getName());
+  public IteratorSetting(int priority, String name, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, EnumSet<IteratorScope> scopes,
+      Map<String,String> properties) {
+    this(priority, name, iteratorClass.getName(), scopes, properties);
   }
   
   /**
-   * Add another option to the iterator
+   * Add another option to the iterator.
    * 
    * @param option
    *          the name of the option
@@ -187,61 +270,91 @@ public class IteratorSetting {
    */
   public void addOption(String option, String value) {
     ArgumentChecker.notNull(option, value);
-    for (IteratorScope scope : IteratorScope.values()) {
-      addOptions(scope, Collections.singletonMap(option, value));
-    }
+    properties.put(option, value);
   }
   
   /**
-   * Add many options to the iterator
+   * Remove an option from the iterator.
    * 
-   * @param keyValues
-   *          the values to add to the options
+   * @param option
+   *          the name of the option
+   * @return the value previously associated with the option, or null if no such option existed
    */
-  public void addOptions(Set<Entry<String,String>> keyValues) {
-    for (Entry<String,String> keyValue : keyValues) {
-      addOption(keyValue.getKey(), keyValue.getValue());
-    }
+  public String removeOption(String option) {
+    ArgumentChecker.notNull(option);
+    return properties.remove(option);
   }
   
   /**
-   * Get the properties on the iterator by scope
+   * Add many options to the iterator.
    * 
-   * @return a mapping from scope to key/value settings
+   * @param propertyEntries
+   *          a set of entries to add to the options
    */
-  public Map<IteratorScope,Map<String,String>> getOptionsByScope() {
-    Map<IteratorScope,Map<String,String>> result = new EnumMap<IteratorScope,Map<String,String>>(IteratorScope.class);
-    for (Entry<IteratorScope,Map<String,String>> property : properties.entrySet()) {
-      result.put(property.getKey(), Collections.unmodifiableMap(property.getValue()));
+  public void addOptions(Set<Entry<String,String>> propertyEntries) {
+    ArgumentChecker.notNull(propertyEntries);
+    for (Entry<String,String> keyValue : propertyEntries) {
+      addOption(keyValue.getKey(), keyValue.getValue());
     }
-    return Collections.unmodifiableMap(result);
   }
   
   /**
-   * Add many options to to the iterator for a scope
+   * Add many options to the iterator.
    * 
-   * @param scope
-   *          the scope to put the properties
    * @param properties
-   *          key/value pairs
+   *          a map of entries to add to the options
    */
-  public void addOptions(IteratorScope scope, Map<String,String> properties) {
-    if (properties == null)
-      return;
-    if (!this.properties.containsKey(scope))
-      this.properties.put(scope, new HashMap<String,String>());
-    for (Entry<String,String> entry : properties.entrySet()) {
-      this.properties.get(scope).put(entry.getKey(), entry.getValue());
-    }
+  public void addOptions(Map<String,String> properties) {
+    ArgumentChecker.notNull(properties);
+    addOptions(properties.entrySet());
   }
   
   /**
-   * Delete the properties per-scope
-   * 
-   * @param scope
-   *          the scope to delete
+   * Remove all options from the iterator.
    */
-  public void deleteOptions(IteratorScope scope) {
-    this.properties.remove(scope);
+  public void clearOptions() {
+    properties.clear();
+  }
+  
+  /**
+   * @see java.lang.Object#toString()
+   */
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("name:");
+    sb.append(name);
+    sb.append(", priority:");
+    sb.append(Integer.toString(priority));
+    sb.append(", class:");
+    sb.append(iteratorClass);
+    sb.append(", scopes:");
+    sb.append(scopes);
+    sb.append(", properties:");
+    sb.append(properties);
+    return sb.toString();
+  }
+
+  /**
+   * A convenience class for passing column family and column qualifiers to iterator configuration methods.
+   */
+  public static class Column extends Pair<Text,Text> {
+    
+    public Column(Text columnFamily, Text columnQualifier) {
+      super(columnFamily, columnQualifier);
+    }
+    
+    public Column(Text columnFamily) {
+      super(columnFamily, null);
+    }
+    
+    public Column(String columnFamily, String columnQualifier) {
+      super(new Text(columnFamily), new Text(columnQualifier));
+    }
+    
+    public Column(String columnFamily) {
+      super(new Text(columnFamily), null);
+    }
+    
   }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java Mon Nov 28 19:59:37 2011
@@ -18,6 +18,7 @@ package org.apache.accumulo.core.client.
 
 import java.io.IOException;
 import java.util.Collection;
+import java.util.EnumSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -30,6 +31,7 @@ import org.apache.accumulo.core.client.I
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.util.BulkImportHelper.AssignmentStats;
@@ -478,21 +480,26 @@ public interface TableOperations {
    *          the name of the table
    * @param name
    *          the name of the iterator
+   * @param scopes
+   *          the scopes of the iterator
    * @throws AccumuloSecurityException
    *           thrown if the user does not have the ability to set properties on the table
    * @throws AccumuloException
    * @throws TableNotFoundException
    *           throw if the table no longer exists
    */
-  public void removeIterator(String tableName, String name) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+  public void removeIterator(String tableName, String name, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
+      TableNotFoundException;
   
   /**
-   * Get the settings for an iterator
+   * Get the settings for an iterator.
    * 
    * @param tableName
    *          the name of the table
    * @param name
    *          the name of the iterator
+   * @param scope
+   *          the scope of the iterator
    * @return the settings for this iterator
    * @throws AccumuloSecurityException
    *           thrown if the user does not have the ability to set properties on the table
@@ -500,7 +507,8 @@ public interface TableOperations {
    * @throws TableNotFoundException
    *           throw if the table no longer exists
    */
-  public IteratorSetting getIterator(String tableName, String name) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+  public IteratorSetting getIteratorSetting(String tableName, String name, IteratorScope scope) throws AccumuloSecurityException, AccumuloException,
+      TableNotFoundException;
   
   /**
    * Get a list of iterators for this table.
@@ -512,5 +520,5 @@ public interface TableOperations {
    * @throws AccumuloException
    * @throws TableNotFoundException
    */
-  public Set<String> getIterators(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+  public Set<String> listIterators(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsHelper.java Mon Nov 28 19:59:37 2011
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.core.client.admin;
 
-import java.util.EnumMap;
+import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -34,25 +34,26 @@ public abstract class TableOperationsHel
   
   @Override
   public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
-    removeIterator(tableName, setting.getName());
-    for (Entry<IteratorScope,Map<String,String>> entry : setting.getOptionsByScope().entrySet()) {
-      String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, entry.getKey().name().toLowerCase(), setting.getName());
+    removeIterator(tableName, setting.getName(), setting.getScopes());
+    for (IteratorScope scope : setting.getScopes()) {
+      String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase(), setting.getName());
       this.setProperty(tableName, root, setting.getPriority() + "," + setting.getIteratorClass());
-      for (Entry<String,String> prop : entry.getValue().entrySet()) {
+      for (Entry<String,String> prop : setting.getProperties().entrySet()) {
         this.setProperty(tableName, root + ".opt." + prop.getKey(), prop.getValue());
       }
     }
   }
   
   @Override
-  public void removeIterator(String tableName, String name) throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+  public void removeIterator(String tableName, String name, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
+      TableNotFoundException {
     Map<String,String> copy = new HashMap<String,String>();
     for (Entry<String,String> property : this.getProperties(tableName)) {
       copy.put(property.getKey(), property.getValue());
     }
-    for (Entry<String,String> property : copy.entrySet()) {
-      for (IteratorScope scope : IteratorScope.values()) {
-        String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase(), name);
+    for (IteratorScope scope : scopes) {
+      String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase(), name);
+      for (Entry<String,String> property : copy.entrySet()) {
         if (property.getKey().equals(root) || property.getKey().startsWith(root + ".opt."))
           this.removeProperty(tableName, property.getKey());
       }
@@ -60,43 +61,34 @@ public abstract class TableOperationsHel
   }
   
   @Override
-  public IteratorSetting getIterator(String tableName, String name) throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+  public IteratorSetting getIteratorSetting(String tableName, String name, IteratorScope scope) throws AccumuloSecurityException, AccumuloException,
+      TableNotFoundException {
     int priority = -1;
     String classname = null;
-    EnumMap<IteratorScope,Map<String,String>> settings = new EnumMap<IteratorScope,Map<String,String>>(IteratorScope.class);
+    Map<String,String> settings = new HashMap<String,String>();
     
+    String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase(), name);
+    String opt = root + ".opt.";
     for (Entry<String,String> property : this.getProperties(tableName)) {
-      for (IteratorScope scope : IteratorScope.values()) {
-        String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase(), name);
-        String opt = root + ".opt.";
-        if (property.getKey().equals(root)) {
-          String parts[] = property.getValue().split(",");
-          if (parts.length != 2) {
-            throw new AccumuloException("Bad value for iterator setting: " + property.getValue());
-          }
-          priority = Integer.parseInt(parts[0]);
-          classname = parts[1];
-          if (!settings.containsKey(scope))
-            settings.put(scope, new HashMap<String,String>());
-        } else if (property.getKey().startsWith(opt)) {
-          if (!settings.containsKey(scope))
-            settings.put(scope, new HashMap<String,String>());
-          settings.get(scope).put(property.getKey().substring(opt.length()), property.getValue());
+      if (property.getKey().equals(root)) {
+        String parts[] = property.getValue().split(",");
+        if (parts.length != 2) {
+          throw new AccumuloException("Bad value for iterator setting: " + property.getValue());
         }
+        priority = Integer.parseInt(parts[0]);
+        classname = parts[1];
+      } else if (property.getKey().startsWith(opt)) {
+        settings.put(property.getKey().substring(opt.length()), property.getValue());
       }
     }
-    if (priority < 0 || classname == null) {
+    if (priority <= 0 || classname == null) {
       return null;
     }
-    IteratorSetting result = new IteratorSetting(priority, name, classname);
-    for (Entry<IteratorScope,Map<String,String>> entry : settings.entrySet()) {
-      result.addOptions(entry.getKey(), entry.getValue());
-    }
-    return result;
+    return new IteratorSetting(priority, name, classname, EnumSet.of(scope), settings);
   }
   
   @Override
-  public Set<String> getIterators(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+  public Set<String> listIterators(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
     Set<String> result = new HashSet<String>();
     Set<String> lifecycles = new HashSet<String>();
     for (IteratorScope scope : IteratorScope.values())

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java Mon Nov 28 19:59:37 2011
@@ -49,8 +49,8 @@ public class MockBatchScanner extends Mo
   static class RangesFilter extends Filter {
     List<Range> ranges;
     
-    public RangesFilter(SortedKeyValueIterator<Key,Value> iterator, List<Range> ranges) {
-      super(iterator);
+    RangesFilter(SortedKeyValueIterator<Key,Value> iterator, List<Range> ranges) {
+      setSource(iterator);
       this.ranges = ranges;
     }
     

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScanner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScanner.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScanner.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScanner.java Mon Nov 28 19:59:37 2011
@@ -78,8 +78,8 @@ public class MockScanner extends MockSca
   static class RangeFilter extends Filter {
     Range range;
     
-    public RangeFilter(SortedKeyValueIterator<Key,Value> i, Range range) {
-      super(i);
+    RangeFilter(SortedKeyValueIterator<Key,Value> i, Range range) {
+      setSource(i);
       this.range = range;
     }
     

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Combiner.java Mon Nov 28 19:59:37 2011
@@ -26,14 +26,13 @@ import java.util.Map;
 import java.util.NoSuchElementException;
 
 import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.client.IteratorSetting.Column;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.conf.ColumnSet;
-import org.apache.accumulo.core.util.Pair;
-import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 
 /**
@@ -46,7 +45,7 @@ import org.apache.log4j.Logger;
  */
 public abstract class Combiner extends WrappingIterator implements OptionDescriber {
   static final Logger log = Logger.getLogger(Combiner.class);
-  public static final String COLUMNS_OPTION = "columns";
+  protected static final String COLUMNS_OPTION = "columns";
   
   /**
    * A Java Iterator that iterates over the Values for a given Key from a source SortedKeyValueIterator.
@@ -115,8 +114,6 @@ public abstract class Combiner extends W
   Key topKey;
   Value topValue;
   
-  public Combiner() {}
-  
   @Override
   public Key getTopKey() {
     if (topKey == null)
@@ -231,7 +228,7 @@ public abstract class Combiner extends W
         Collections
             .singletonMap(
                 COLUMNS_OPTION,
-        "<col fam>[:<col qual>]{,<col fam>[:<col qual>]} escape non aplhanum chars using %<hex>."),
+        "<col fam>[:<col qual>]{,<col fam>[:<col qual>]} escape non-alphanum chars using %<hex>."),
         null);
   }
   
@@ -253,38 +250,15 @@ public abstract class Combiner extends W
   }
   
   /**
-   * A convenience class for passing column family and column qualifiers
-   */
-  public static class Column extends Pair<Text,Text> {
-    
-    public Column(Text columnFamily, Text columnQualifier) {
-      super(columnFamily, columnQualifier);
-    }
-    
-    public Column(Text columnFamily) {
-      super(columnFamily, null);
-    }
-    
-    public Column(String columnFamily, String columnQualifier) {
-      super(new Text(columnFamily), new Text(columnQualifier));
-    }
-    
-    public Column(String columnFamily) {
-      super(new Text(columnFamily), null);
-    }
-    
-  }
-
-  /**
    * A convenience method to set which columns a combiner should be applied to.
    * 
    * @param is
    *          iterator settings object to configure
    * @param columns
-   *          a list columns to encode as the value for the combiner column configuration
+   *          a list of columns to encode as the value for the combiner column configuration
    */
   
-  public static void setColumns(IteratorSetting is, List<Column> columns) {
+  public static void setColumns(IteratorSetting is, List<IteratorSetting.Column> columns) {
     String sep = "";
     StringBuilder sb = new StringBuilder();
     

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Filter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Filter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Filter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/Filter.java Mon Nov 28 19:59:37 2011
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
 
+import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Range;
@@ -50,14 +51,7 @@ public abstract class Filter extends Wra
   }
   
   private static final String NEGATE = "negate";
-  boolean negate;
-  
-  public Filter() {}
-  
-  public Filter(SortedKeyValueIterator<Key,Value> iterator) {
-    setSource(iterator);
-    negate = false;
-  }
+  boolean negate = false;
   
   @Override
   public void next() throws IOException {
@@ -111,4 +105,16 @@ public abstract class Filter extends Wra
     }
     return true;
   }
+  
+  /**
+   * A convenience method for setting the negation option on a filter.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param negate
+   *          if false, filter accepts k/v for which the accept method returns true; if true, filter accepts k/v for which the accept method returns false.
+   */
+  public static void setNegate(IteratorSetting is, boolean negate) {
+    is.addOption(NEGATE, Boolean.toString(negate));
+  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java Mon Nov 28 19:59:37 2011
@@ -23,8 +23,10 @@ import java.io.DataOutputStream;
 import java.io.IOException;
 import java.util.Map;
 
+import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.start.classloader.AccumuloClassLoader;
 import org.apache.hadoop.io.WritableUtils;
 
 /**
@@ -38,7 +40,8 @@ import org.apache.hadoop.io.WritableUtil
  * VARNUM, LONG, and STRING which indicate the VarNumEncoder, LongEncoder, and StringEncoder respectively.
  */
 public abstract class LongCombiner extends TypedValueCombiner<Long> {
-  public static final String TYPE = "type";
+  protected static final String TYPE = "type";
+  protected static final String CLASS_PREFIX = "class:";
   
   public static enum Type {
     VARNUM, LONG, STRING
@@ -47,20 +50,44 @@ public abstract class LongCombiner exten
   @Override
   public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
     super.init(source, options, env);
-    if (options.get(TYPE) == null)
+    setEncoder(options);
+  }
+  
+  private void setEncoder(Map<String,String> options) {
+    String type = options.get(TYPE);
+    if (type == null)
       throw new IllegalArgumentException("no type specified");
-    switch (Type.valueOf(options.get(TYPE))) {
-      case VARNUM:
-        encoder = new VarNumEncoder();
-        return;
-      case LONG:
-        encoder = new LongEncoder();
-        return;
-      case STRING:
-        encoder = new StringEncoder();
-        return;
-      default:
-        throw new IllegalArgumentException();
+    if (type.startsWith(CLASS_PREFIX)) {
+      try {
+        @SuppressWarnings("unchecked")
+        Class<? extends Encoder<Long>> clazz = (Class<? extends Encoder<Long>>) AccumuloClassLoader.loadClass(type.substring(CLASS_PREFIX.length()),
+            Encoder.class);
+        encoder = clazz.newInstance();
+        if (encoder.decode(encoder.encode(42l)) != 42l) {
+          throw new IllegalArgumentException("something wrong with " + type + " -- doesn't encode and decode a Long properly");
+        }
+      } catch (ClassNotFoundException e) {
+        throw new IllegalArgumentException(e);
+      } catch (InstantiationException e) {
+        throw new IllegalArgumentException(e);
+      } catch (IllegalAccessException e) {
+        throw new IllegalArgumentException(e);
+      }
+    }
+    else {
+      switch (Type.valueOf(type)) {
+        case VARNUM:
+          encoder = new VarNumEncoder();
+          return;
+        case LONG:
+          encoder = new LongEncoder();
+          return;
+        case STRING:
+          encoder = new StringEncoder();
+          return;
+        default:
+          throw new IllegalArgumentException();
+      }
     }
   }
   
@@ -76,13 +103,7 @@ public abstract class LongCombiner exten
   @Override
   public boolean validateOptions(Map<String,String> options) {
     super.validateOptions(options);
-    if (options.get(TYPE) == null)
-      return false;
-    try {
-      Type.valueOf(options.get(TYPE));
-    } catch (Exception e) {
-      return false;
-    }
+    setEncoder(options);
     return true;
   }
   
@@ -175,4 +196,40 @@ public abstract class LongCombiner exten
     }
     return a + b;
   }
+  
+  /**
+   * A convenience method for setting the long encoding type.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param type
+   *          LongCombiner.Type specifying the encoding type.
+   */
+  public static void setEncodingType(IteratorSetting is, LongCombiner.Type type) {
+    is.addOption(TYPE, type.toString());
+  }
+  
+  /**
+   * A convenience method for setting the long encoding type.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param encoderClass
+   *          Class<? extends Encoder<Long>> specifying the encoding type.
+   */
+  public static void setEncodingType(IteratorSetting is, Class<? extends Encoder<Long>> encoderClass) {
+    is.addOption(TYPE, CLASS_PREFIX + encoderClass.getName());
+  }
+  
+  /**
+   * A convenience method for setting the long encoding type.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param encoderClassName
+   *          name of a class specifying the encoding type.
+   */
+  public static void setEncodingType(IteratorSetting is, String encoderClassName) {
+    is.addOption(TYPE, CLASS_PREFIX + encoderClassName);
+  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java Mon Nov 28 19:59:37 2011
@@ -37,13 +37,13 @@ public class ColumnQualifierFilter exten
   public ColumnQualifierFilter() {}
   
   public ColumnQualifierFilter(SortedKeyValueIterator<Key,Value> iterator, HashSet<Column> columns) {
-    super(iterator);
+    setSource(iterator);
     init(columns);
   }
   
   public ColumnQualifierFilter(SortedKeyValueIterator<Key,Value> iterator, HashSet<ByteSequence> columnFamilies,
       HashMap<ByteSequence,HashSet<ByteSequence>> columnsQualifiers, boolean scanColumns) {
-    super(iterator);
+    setSource(iterator);
     this.columnFamilies = columnFamilies;
     this.columnsQualifiers = columnsQualifiers;
     this.scanColumns = scanColumns;

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java Mon Nov 28 19:59:37 2011
@@ -41,7 +41,7 @@ public class VisibilityFilter extends Fi
   public VisibilityFilter() {}
   
   public VisibilityFilter(SortedKeyValueIterator<Key,Value> iterator, Authorizations authorizations, byte[] defaultVisibility) {
-    super(iterator);
+    setSource(iterator);
     this.ve = new VisibilityEvaluator(authorizations);
     this.defaultVisibility = new Text(defaultVisibility);
     this.cache = new LRUMap(1000);

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java Mon Nov 28 19:59:37 2011
@@ -19,6 +19,7 @@ package org.apache.accumulo.core.iterato
 import java.io.IOException;
 import java.util.Map;
 
+import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.Filter;
@@ -32,6 +33,7 @@ import org.apache.accumulo.core.iterator
  */
 public class AgeOffFilter extends Filter {
   private static final String TTL = "ttl";
+  private static final String CURRENT_TIME = "currentTime";
   private long threshold;
   private long currentTime;
   
@@ -49,8 +51,8 @@ public class AgeOffFilter extends Filter
    * @param threshold
    *          Current time in milliseconds.
    */
-  public AgeOffFilter(SortedKeyValueIterator<Key,Value> iterator, long threshold, long currentTime) {
-    super(iterator);
+  private AgeOffFilter(SortedKeyValueIterator<Key,Value> iterator, long threshold, long currentTime) {
+    setSource(iterator);
     this.threshold = threshold;
     this.currentTime = currentTime;
   }
@@ -80,7 +82,7 @@ public class AgeOffFilter extends Filter
     
     threshold = Long.parseLong(ttl);
     
-    String time = options.get("currentTime");
+    String time = options.get(CURRENT_TIME);
     if (time != null)
       currentTime = Long.parseLong(time);
     else
@@ -98,7 +100,7 @@ public class AgeOffFilter extends Filter
   public IteratorOptions describeOptions() {
     IteratorOptions io = super.describeOptions();
     io.addNamedOption(TTL, "time to live (milliseconds)");
-    io.addNamedOption("currentTime", "if set, use the given value as the absolute time in milliseconds as the current time of day");
+    io.addNamedOption(CURRENT_TIME, "if set, use the given value as the absolute time in milliseconds as the current time of day");
     io.setName("ageoff");
     io.setDescription("AgeOffFilter removes entries with timestamps more than <ttl> milliseconds old");
     return io;
@@ -114,4 +116,28 @@ public class AgeOffFilter extends Filter
     }
     return true;
   }
+  
+  /**
+   * A convenience method for setting the age off threshold.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param ttl
+   *          age off threshold in milliseconds.
+   */
+  public static void setTTL(IteratorSetting is, Long ttl) {
+    is.addOption(TTL, Long.toString(ttl));
+  }
+  
+  /**
+   * A convenience method for setting the current time (from which to measure the age off threshold).
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param currentTime
+   *          time in milliseconds.
+   */
+  public static void setCurrentTime(IteratorSetting is, Long currentTime) {
+    is.addOption(CURRENT_TIME, Long.toString(currentTime));
+  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java Mon Nov 28 19:59:37 2011
@@ -20,13 +20,16 @@ import java.io.IOException;
 import java.util.Map;
 import java.util.Map.Entry;
 
+import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.Filter;
 import org.apache.accumulo.core.iterators.IteratorEnvironment;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
+import org.apache.accumulo.core.iterators.conf.ColumnSet;
 import org.apache.accumulo.core.iterators.conf.ColumnToClassMapping;
-import org.apache.accumulo.core.iterators.conf.PerColumnIteratorConfig;
+import org.apache.accumulo.core.util.Pair;
+import org.apache.hadoop.io.Text;
 
 /**
  * A filter that ages off key/value pairs based on the Key's column and timestamp. It removes an entry if its timestamp is less than currentTime - threshold.
@@ -36,8 +39,8 @@ public class ColumnAgeOffFilter extends 
   
   public ColumnAgeOffFilter() {}
   
-  public ColumnAgeOffFilter(SortedKeyValueIterator<Key,Value> iterator, TTLSet ttls, long currentTime) {
-    super(iterator);
+  private ColumnAgeOffFilter(SortedKeyValueIterator<Key,Value> iterator, TTLSet ttls, long currentTime) {
+    setSource(iterator);
     this.ttls = ttls;
     this.currentTime = currentTime;
   }
@@ -51,12 +54,12 @@ public class ColumnAgeOffFilter extends 
         String ttl = entry.getValue();
         Long l = Long.parseLong(ttl);
         
-        PerColumnIteratorConfig ac = PerColumnIteratorConfig.decodeColumns(column, ttl);
+        Pair<Text,Text> colPair = ColumnSet.decodeColumns(column);
         
-        if (ac.getColumnQualifier() == null) {
-          addObject(ac.getColumnFamily(), l);
+        if (colPair.getSecond() == null) {
+          addObject(colPair.getFirst(), l);
         } else {
-          addObject(ac.getColumnFamily(), ac.getColumnQualifier(), l);
+          addObject(colPair.getFirst(), colPair.getSecond(), l);
         }
       }
     }
@@ -96,7 +99,7 @@ public class ColumnAgeOffFilter extends 
     IteratorOptions io = super.describeOptions();
     io.setName("colageoff");
     io.setDescription("ColumnAgeOffFilter ages off columns at different rates given a time to live in milliseconds for each column");
-    io.addUnnamedOption("<columnName> <Long>");
+    io.addUnnamedOption("<col fam>[:<col qual>] <Long> (escape non-alphanum chars using %<hex>)");
     return io;
   }
   
@@ -106,4 +109,30 @@ public class ColumnAgeOffFilter extends 
     this.ttls = new TTLSet(options);
     return true;
   }
+  
+  /**
+   * A convenience method for adding or changing an age off threshold for a column.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param column
+   *          column to encode as a parameter name.
+   * @param ttl
+   *          age off threshold in milliseconds.
+   */
+  public static void addTTL(IteratorSetting is, IteratorSetting.Column column, Long ttl) {
+    is.addOption(ColumnSet.encodeColumns(column.getFirst(), column.getSecond()), Long.toString(ttl));
+  }
+
+  /**
+   * A convenience method for removing an age off threshold for a column.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param column
+   *          column to encode as a parameter name.
+   */
+  public static void removeTTL(IteratorSetting is, IteratorSetting.Column column) {
+    is.removeOption(ColumnSet.encodeColumns(column.getFirst(), column.getSecond()));
+  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java Mon Nov 28 19:59:37 2011
@@ -115,7 +115,7 @@ public class IntersectingIterator implem
     return new IntersectingIterator(this, env);
   }
   
-  public IntersectingIterator(IntersectingIterator other, IteratorEnvironment env) {
+  private IntersectingIterator(IntersectingIterator other, IteratorEnvironment env) {
     if (other.sources != null) {
       sourcesCount = other.sourcesCount;
       sources = new TermSource[sourcesCount];

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/LargeRowFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/LargeRowFilter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/LargeRowFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/LargeRowFilter.java Mon Nov 28 19:59:37 2011
@@ -23,6 +23,7 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Map;
 
+import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.ArrayByteSequence;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Key;
@@ -48,7 +49,7 @@ public class LargeRowFilter implements S
   private static final ByteSequence EMPTY = new ArrayByteSequence(new byte[] {});
   
   /* key into hash map, value refers to the row supression limit (maxColumns) */
-  public static final String MAX_COLUMNS = "max_columns";
+  private static final String MAX_COLUMNS = "max_columns";
   
   private SortedKeyValueIterator<Key,Value> source;
   
@@ -275,4 +276,15 @@ public class LargeRowFilter implements S
     return true;
   }
   
+  /**
+   * A convenience method for setting the maximum number of columns to keep.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param maxColumns
+   *          number of columns to keep.
+   */
+  public static void setMaxColumns(IteratorSetting is, int maxColumns) {
+    is.addOption(MAX_COLUMNS, Integer.toString(maxColumns));
+  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/NoVisFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/NoVisFilter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/NoVisFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/NoVisFilter.java Mon Nov 28 19:59:37 2011
@@ -19,7 +19,6 @@ package org.apache.accumulo.core.iterato
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.Filter;
-import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.security.ColumnVisibility;
 
 /**
@@ -27,12 +26,6 @@ import org.apache.accumulo.core.security
  */
 public class NoVisFilter extends Filter {
   
-  public NoVisFilter() {}
-  
-  public NoVisFilter(SortedKeyValueIterator<Key,Value> iterator) {
-    super(iterator);
-  }
-  
   @Override
   public boolean accept(Key k, Value v) {
     ColumnVisibility vis = new ColumnVisibility(k.getColumnVisibility());

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java Mon Nov 28 19:59:37 2011
@@ -37,7 +37,8 @@ public class RegExFilter extends Filter 
   
   @Override
   public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) {
-    RegExFilter result = new RegExFilter(getSource().deepCopy(env));
+    RegExFilter result = new RegExFilter();
+    result.setSource(getSource().deepCopy(env));
     result.rowMatcher = rowMatcher.pattern().matcher("");
     result.colfMatcher = colfMatcher.pattern().matcher("");
     result.colqMatcher = colqMatcher.pattern().matcher("");
@@ -46,12 +47,6 @@ public class RegExFilter extends Filter 
     return result;
   }
   
-  public RegExFilter() {}
-  
-  public RegExFilter(SortedKeyValueIterator<Key,Value> iterator) {
-    super(iterator);
-  }
-  
   public static final String ROW_REGEX = "rowRegex";
   public static final String COLF_REGEX = "colfRegex";
   public static final String COLQ_REGEX = "colqRegex";

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java Mon Nov 28 19:59:37 2011
@@ -22,23 +22,32 @@ import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.IteratorEnvironment;
 import org.apache.accumulo.core.iterators.LongCombiner;
-import org.apache.accumulo.core.iterators.LongCombiner.Type;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.TypedValueCombiner;
+import org.apache.accumulo.start.classloader.AccumuloClassLoader;
 import org.apache.hadoop.io.WritableUtils;
 
 /**
  * A Combiner that interprets Values as arrays of Longs and returns an array of element-wise sums.
  */
 public class SummingArrayCombiner extends TypedValueCombiner<List<Long>> {
+  private static final String TYPE = "type";
+  private static final String CLASS_PREFIX = "class:";
+
+  public static enum Type {
+    VARNUM, LONG, STRING
+  }
+
   @Override
   public List<Long> typedReduce(Key key, Iterator<List<Long>> iter) {
     List<Long> sum = new ArrayList<Long>();
@@ -65,20 +74,44 @@ public class SummingArrayCombiner extend
   @Override
   public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
     super.init(source, options, env);
-    if (options.get(LongCombiner.TYPE) == null)
+    setEncoder(options);
+  }
+  
+  private void setEncoder(Map<String,String> options) {
+    String type = options.get(TYPE);
+    if (type == null)
       throw new IllegalArgumentException("no type specified");
-    switch (Type.valueOf(options.get(LongCombiner.TYPE))) {
-      case VARNUM:
-        encoder = new VarNumArrayEncoder();
-        return;
-      case LONG:
-        encoder = new LongArrayEncoder();
-        return;
-      case STRING:
-        encoder = new StringArrayEncoder();
-        return;
-      default:
-        throw new IllegalArgumentException();
+    if (type.startsWith(CLASS_PREFIX)) {
+      try {
+        @SuppressWarnings("unchecked")
+        Class<? extends Encoder<List<Long>>> clazz = (Class<? extends Encoder<List<Long>>>) AccumuloClassLoader.loadClass(
+            type.substring(CLASS_PREFIX.length()), Encoder.class);
+        encoder = clazz.newInstance();
+        List<Long> testList = encoder.decode(encoder.encode(Arrays.asList(0l, 1l)));
+        if (testList.size() != 3 || testList.get(0) != 0l || testList.get(1) != 1l) {
+          throw new IllegalArgumentException("something wrong with " + type + " -- doesn't encode and decode a List<Long> properly");
+        }
+      } catch (ClassNotFoundException e) {
+        throw new IllegalArgumentException(e);
+      } catch (InstantiationException e) {
+        throw new IllegalArgumentException(e);
+      } catch (IllegalAccessException e) {
+        throw new IllegalArgumentException(e);
+      }
+    } else {
+      switch (Type.valueOf(options.get(TYPE))) {
+        case VARNUM:
+          encoder = new VarNumArrayEncoder();
+          return;
+        case LONG:
+          encoder = new LongArrayEncoder();
+          return;
+        case STRING:
+          encoder = new StringArrayEncoder();
+          return;
+        default:
+          throw new IllegalArgumentException();
+      }
     }
   }
   
@@ -87,20 +120,14 @@ public class SummingArrayCombiner extend
     IteratorOptions io = super.describeOptions();
     io.setName("typedcombiner");
     io.setDescription("TypedValueCombiner can interpret Values as a variety of number encodings (VLong, Long, or String) before combining");
-    io.addNamedOption(LongCombiner.TYPE, "<VARNUM|LONG|STRING>");
+    io.addNamedOption(TYPE, "<VARNUM|LONG|STRING>");
     return io;
   }
   
   @Override
   public boolean validateOptions(Map<String,String> options) {
     super.validateOptions(options);
-    if (options.get(LongCombiner.TYPE) == null)
-      return false;
-    try {
-      Type.valueOf(options.get(LongCombiner.TYPE));
-    } catch (Exception e) {
-      return false;
-    }
+    setEncoder(options);
     return true;
   }
   
@@ -190,4 +217,40 @@ public class SummingArrayCombiner extend
       return la;
     }
   }
+  
+  /**
+   * A convenience method for setting the encoding type.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param type
+   *          SummingArrayCombiner.Type specifying the encoding type.
+   */
+  public static void setEncodingType(IteratorSetting is, Type type) {
+    is.addOption(TYPE, type.toString());
+  }
+  
+  /**
+   * A convenience method for setting the encoding type.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param encoderClass
+   *          Class<? extends Encoder<Long>> specifying the encoding type.
+   */
+  public static void setEncodingType(IteratorSetting is, Class<? extends Encoder<List<Long>>> encoderClass) {
+    is.addOption(TYPE, CLASS_PREFIX + encoderClass.getName());
+  }
+  
+  /**
+   * A convenience method for setting the encoding type.
+   * 
+   * @param is
+   *          IteratorSetting object to configure.
+   * @param encoderClassName
+   *          name of a class specifying the encoding type.
+   */
+  public static void setEncodingType(IteratorSetting is, String encoderClassName) {
+    is.addOption(TYPE, CLASS_PREFIX + encoderClassName);
+  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java Mon Nov 28 19:59:37 2011
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.Map;
 
+import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.Filter;
@@ -40,25 +41,30 @@ public class TimestampFilter extends Fil
   private long end;
   private boolean startInclusive;
   private boolean endInclusive;
+  private boolean hasStart;
+  private boolean hasEnd;
   
   public TimestampFilter() {}
   
-  public TimestampFilter(SortedKeyValueIterator<Key,Value> iterator, long start, boolean startInclusive, long end, boolean endInclusive) {
-    super(iterator);
+  private TimestampFilter(SortedKeyValueIterator<Key,Value> iterator, boolean hasStart, long start, boolean startInclusive, boolean hasEnd, long end,
+      boolean endInclusive) {
+    setSource(iterator);
     this.start = start;
     this.startInclusive = startInclusive;
+    this.hasStart = true;
     this.end = end;
     this.endInclusive = endInclusive;
+    this.hasEnd = true;
   }
   
   @Override
   public boolean accept(Key k, Value v) {
     long ts = k.getTimestamp();
-    if (ts < start || ts > end)
+    if ((hasStart && (ts < start)) || (hasEnd && (ts > end)))
       return false;
-    if (!startInclusive && ts == start)
+    if (hasStart && !startInclusive && ts == start)
       return false;
-    if (!endInclusive && ts == end)
+    if (hasEnd && !endInclusive && ts == end)
       return false;
     return true;
   }
@@ -68,13 +74,25 @@ public class TimestampFilter extends Fil
     super.init(source, options, env);
     
     if (options == null)
-      throw new IllegalArgumentException("ttl must be set for AgeOffFilter");
+      throw new IllegalArgumentException("start and/or end must be set for " + TimestampFilter.class.getName());
     
+    hasStart = false;
+    hasEnd = false;
     startInclusive = true;
     endInclusive = true;
+    
+    if (options.containsKey(START))
+      hasStart = true;
+    if (options.containsKey(END))
+      hasEnd = true;
+    if (!hasStart && !hasEnd)
+      throw new IllegalArgumentException("must have either start or end for " + TimestampFilter.class.getName());
+
     try {
-      start = dateParser.parse(options.get(START)).getTime();
-      end = dateParser.parse(options.get(END)).getTime();
+      if (hasStart)
+        start = dateParser.parse(options.get(START)).getTime();
+      if (hasEnd)
+        end = dateParser.parse(options.get(END)).getTime();
     } catch (Exception e) {
       throw new IllegalArgumentException(e);
     }
@@ -86,7 +104,7 @@ public class TimestampFilter extends Fil
   
   @Override
   public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) {
-    return new TimestampFilter(getSource(), start, startInclusive, end, endInclusive);
+    return new TimestampFilter(getSource(), hasStart, start, startInclusive, hasEnd, end, endInclusive);
   }
   
   @Override
@@ -105,8 +123,10 @@ public class TimestampFilter extends Fil
   public boolean validateOptions(Map<String,String> options) {
     super.validateOptions(options);
     try {
-      dateParser.parse(options.get(START));
-      dateParser.parse(options.get(END));
+      if (options.containsKey(START))
+        dateParser.parse(options.get(START));
+      if (options.containsKey(END))
+        dateParser.parse(options.get(END));
       if (options.get(START_INCL) != null)
         Boolean.parseBoolean(options.get(START_INCL));
       if (options.get(END_INCL) != null)
@@ -116,4 +136,67 @@ public class TimestampFilter extends Fil
     }
     return true;
   }
+  
+  /**
+   * A convenience method for setting the range of timestamps accepted by the timestamp filter.
+   * 
+   * @param is
+   *          the iterator setting object to configure
+   * @param start
+   *          the start timestamp, inclusive (yyyyMMddHHmmssz)
+   * @param end
+   *          the end timestamp, inclusive (yyyyMMddHHmmssz)
+   */
+  public static void setRange(IteratorSetting is, String start, String end) {
+    setRange(is, start, true, end, true);
+  }
+  
+  /**
+   * A convenience method for setting the range of timestamps accepted by the timestamp filter.
+   * 
+   * @param is
+   *          the iterator setting object to configure
+   * @param start
+   *          the start timestamp (yyyyMMddHHmmssz)
+   * @param startInclusive
+   *          boolean indicating whether the start is inclusive
+   * @param end
+   *          the end timestamp (yyyyMMddHHmmssz)
+   * @param endInclusive
+   *          boolean indicating whether the end is inclusive
+   */
+  public static void setRange(IteratorSetting is, String start, boolean startInclusive, String end, boolean endInclusive) {
+    setStart(is, start, startInclusive);
+    setEnd(is, end, endInclusive);
+  }
+  
+  /**
+   * A convenience method for setting the start timestamp accepted by the timestamp filter.
+   * 
+   * @param is
+   *          the iterator setting object to configure
+   * @param start
+   *          the start timestamp (yyyyMMddHHmmssz)
+   * @param startInclusive
+   *          boolean indicating whether the start is inclusive
+   */
+  public static void setStart(IteratorSetting is, String start, boolean startInclusive) {
+    is.addOption(START, start);
+    is.addOption(START_INCL, Boolean.toString(startInclusive));
+  }
+  
+  /**
+   * A convenience method for setting the end timestamp accepted by the timestamp filter.
+   * 
+   * @param is
+   *          the iterator setting object to configure
+   * @param end
+   *          the end timestamp (yyyyMMddHHmmssz)
+   * @param endInclusive
+   *          boolean indicating whether the end is inclusive
+   */
+  public static void setEnd(IteratorSetting is, String end, boolean endInclusive) {
+    is.addOption(END, end);
+    is.addOption(END_INCL, Boolean.toString(endInclusive));
+  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java Mon Nov 28 19:59:37 2011
@@ -55,4 +55,9 @@ public class ArgumentChecker {
       if (args[i] == null)
         throw new IllegalArgumentException(NULL_ARG_MSG + ":arg" + i + " is null");
   }
+  
+  public static final void strictlyPositive(final int i) {
+    if (i <= 0)
+      throw new IllegalArgumentException("integer should be > 0, was " + i);
+  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteIterCommand.java Mon Nov 28 19:59:37 2011
@@ -16,9 +16,10 @@
  */
 package org.apache.accumulo.core.util.shell.commands;
 
+import java.util.EnumSet;
+
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.util.shell.Shell;
@@ -45,29 +46,19 @@ public class DeleteIterCommand extends C
     }
     
     String name = cl.getOptionValue(nameOpt.getOpt());
-    if (!shellState.getConnector().tableOperations().getIterators(tableName).contains(name)) {
+    if (!shellState.getConnector().tableOperations().listIterators(tableName).contains(name)) {
       Shell.log.warn("no iterators found that match your criteria");
       return 0;
     }
-    IteratorSetting iterator = shellState.getConnector().tableOperations().getIterator(tableName, name);
-    if (iterator == null)
-      return 0;
-    boolean deleteAll = true;
-    if (cl.hasOption(mincScopeOpt.getOpt())) {
-      iterator.deleteOptions(IteratorScope.minc);
-      deleteAll = false;
-    }
-    if (cl.hasOption(majcScopeOpt.getOpt())) {
-      iterator.deleteOptions(IteratorScope.majc);
-      deleteAll = false;
-    }
-    if (cl.hasOption(scanScopeOpt.getOpt())) {
-      iterator.deleteOptions(IteratorScope.scan);
-      deleteAll = false;
-    }
-    shellState.getConnector().tableOperations().removeIterator(tableName, name);
-    if (!iterator.getProperties().isEmpty() && !deleteAll)
-      shellState.getConnector().tableOperations().attachIterator(tableName, iterator);
+    
+    EnumSet<IteratorScope> scopes = EnumSet.noneOf(IteratorScope.class);
+    if (cl.hasOption(mincScopeOpt.getOpt()))
+      scopes.add(IteratorScope.minc);
+    if (cl.hasOption(majcScopeOpt.getOpt()))
+      scopes.add(IteratorScope.majc);
+    if (cl.hasOption(scanScopeOpt.getOpt()))
+      scopes.add(IteratorScope.scan);
+    shellState.getConnector().tableOperations().removeIterator(tableName, name, scopes);
     return 0;
   }
   

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java Mon Nov 28 19:59:37 2011
@@ -17,6 +17,7 @@
 package org.apache.accumulo.core.util.shell.commands;
 
 import java.io.IOException;
+import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -102,21 +103,23 @@ public class SetIterCommand extends Comm
   
   protected void setTableProperties(CommandLine cl, Shell shellState, String tableName, int priority, Map<String,String> options, String classname, String name)
       throws AccumuloException, AccumuloSecurityException, ShellCommandException, TableNotFoundException {
-    IteratorSetting setting = new IteratorSetting(priority, name, classname);
     // remove empty values
     for (Iterator<Entry<String,String>> i = options.entrySet().iterator(); i.hasNext();) {
       Entry<String,String> entry = i.next();
       if (entry.getValue() == null || entry.getValue().isEmpty())
         i.remove();
     }
+    EnumSet<IteratorScope> scopes = EnumSet.noneOf(IteratorScope.class);
     if (cl.hasOption(mincScopeOpt.getOpt()))
-      setting.addOptions(IteratorScope.minc, options);
+      scopes.add(IteratorScope.minc);
     if (cl.hasOption(majcScopeOpt.getOpt()))
-      setting.addOptions(IteratorScope.majc, options);
+      scopes.add(IteratorScope.majc);
     if (cl.hasOption(scanScopeOpt.getOpt()))
-      setting.addOptions(IteratorScope.scan, options);
-    if (setting.getProperties().isEmpty())
+      scopes.add(IteratorScope.scan);
+    if (scopes.isEmpty())
       throw new IllegalArgumentException("You must select at least one scope to configure");
+    
+    IteratorSetting setting = new IteratorSetting(priority, name, classname, scopes, options);
     shellState.getConnector().tableOperations().attachIterator(tableName, setting);
   }
   

Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java (original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/admin/TableOperationsHelperTest.java Mon Nov 28 19:59:37 2011
@@ -19,6 +19,7 @@ package org.apache.accumulo.core.client.
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -198,36 +199,47 @@ public class TableOperationsHelperTest {
   public void testAttachIterator() throws Exception {
     Tester t = new Tester();
     Map<String,String> empty = Collections.emptyMap();
-    t.attachIterator("table", new IteratorSetting(10, "someName", "foo.bar", IteratorScope.scan, empty));
+    t.attachIterator("table", new IteratorSetting(10, "someName", "foo.bar", EnumSet.of(IteratorScope.scan), empty));
     t.check("table", new String[] {"table.iterator.scan.someName=10,foo.bar",});
-    t.removeIterator("table", "someName");
+    t.removeIterator("table", "someName", EnumSet.of(IteratorScope.scan));
     t.check("table", new String[] {});
+
     IteratorSetting setting = new IteratorSetting(10, "someName", "foo.bar");
-    setting.addOptions(IteratorScope.majc, Collections.singletonMap("key", "value"));
-    setting.addOptions(IteratorScope.scan, empty);
+    setting.setScopes(EnumSet.of(IteratorScope.majc));
+    setting.addOptions(Collections.singletonMap("key", "value"));
+    t.attachIterator("table", setting);
+    setting = new IteratorSetting(10, "someName", "foo.bar");
     t.attachIterator("table", setting);
     t.check("table", new String[] {"table.iterator.majc.someName=10,foo.bar", "table.iterator.majc.someName.opt.key=value",
         "table.iterator.scan.someName=10,foo.bar",});
+
+    setting = new IteratorSetting(20, "otherName", "some.classname");
+    setting.setScopes(EnumSet.of(IteratorScope.majc));
+    setting.addOptions(Collections.singletonMap("key", "value"));
+    t.attachIterator("table", setting);
     setting = new IteratorSetting(20, "otherName", "some.classname");
-    setting.addOptions(IteratorScope.majc, Collections.singletonMap("key", "value"));
-    setting.addOptions(IteratorScope.scan, empty);
     t.attachIterator("table", setting);
-    Set<String> two = t.getIterators("table");
+    Set<String> two = t.listIterators("table");
     Assert.assertEquals(2, two.size());
     Assert.assertTrue(two.contains("otherName"));
     Assert.assertTrue(two.contains("someName"));
-    t.removeIterator("table", "someName");
+    t.removeIterator("table", "someName", EnumSet.allOf(IteratorScope.class));
     t.check("table", new String[] {"table.iterator.majc.otherName=20,some.classname", "table.iterator.majc.otherName.opt.key=value",
         "table.iterator.scan.otherName=20,some.classname",});
-    setting = t.getIterator("table", "otherName");
+
+    setting = t.getIteratorSetting("table", "otherName", IteratorScope.scan);
+    Assert.assertEquals(20, setting.getPriority());
+    Assert.assertEquals("some.classname", setting.getIteratorClass());
+    Assert.assertFalse(setting.hasProperties());
+    setting = t.getIteratorSetting("table", "otherName", IteratorScope.majc);
     Assert.assertEquals(20, setting.getPriority());
     Assert.assertEquals("some.classname", setting.getIteratorClass());
-    Assert.assertEquals(0, setting.getOptionsByScope().get(IteratorScope.scan).size());
-    Assert.assertEquals(Collections.singletonMap("key", "value"), setting.getOptionsByScope().get(IteratorScope.majc));
-    setting.addOptions(IteratorScope.minc, Collections.singletonMap("a", "b"));
-    t.attachIterator("foo", setting);
-    t.check("foo", new String[] {"table.iterator.majc.otherName=20,some.classname", "table.iterator.majc.otherName.opt.key=value",
-        "table.iterator.minc.otherName=20,some.classname", "table.iterator.minc.otherName.opt.a=b", "table.iterator.scan.otherName=20,some.classname",});
+    Assert.assertTrue(setting.hasProperties());
+    Assert.assertEquals(Collections.singletonMap("key", "value"), setting.getProperties());
+    setting.setScopes(EnumSet.of(IteratorScope.minc));
+    t.attachIterator("table", setting);
+    t.check("table", new String[] {"table.iterator.majc.otherName=20,some.classname", "table.iterator.majc.otherName.opt.key=value",
+        "table.iterator.minc.otherName=20,some.classname", "table.iterator.minc.otherName.opt.key=value", "table.iterator.scan.otherName=20,some.classname",});
   }
   
 }

Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java (original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java Mon Nov 28 19:59:37 2011
@@ -38,7 +38,6 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.Combiner;
-import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.user.SummingCombiner;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
@@ -93,10 +92,9 @@ public class MockConnectorTest {
     Connector c = mockInstance.getConnector("root", new byte[] {});
     String table = "perDayCounts";
     c.tableOperations().create(table);
-    Class<? extends SortedKeyValueIterator<Key,Value>> clazz = SummingCombiner.class;
-    IteratorSetting is = new IteratorSetting(10, "String Summation", clazz);
-    Combiner.setColumns(is, Collections.singletonList(new Combiner.Column("day")));
-    is.addOption(SummingCombiner.TYPE, SummingCombiner.Type.STRING.name());
+    IteratorSetting is = new IteratorSetting(10, "String Summation", SummingCombiner.class);
+    Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("day")));
+    SummingCombiner.setEncodingType(is, SummingCombiner.Type.STRING);
     c.tableOperations().attachIterator(table, is);
     String keys[][] = { {"foo", "day", "20080101"}, {"foo", "day", "20080101"}, {"foo", "day", "20080103"}, {"bar", "day", "20080101"},
         {"bar", "day", "20080101"},};

Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java (original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java Mon Nov 28 19:59:37 2011
@@ -22,9 +22,9 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Random;
 import java.util.TreeMap;
-import java.util.Map.Entry;
 
 import junit.framework.TestCase;
 
@@ -34,9 +34,6 @@ import org.apache.accumulo.core.data.Ran
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.file.rfile.RFileTest;
 import org.apache.accumulo.core.file.rfile.RFileTest.TestRFile;
-import org.apache.accumulo.core.iterators.FamilyIntersectingIterator;
-import org.apache.accumulo.core.iterators.IteratorEnvironment;
-import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.system.MultiIterator;
 import org.apache.accumulo.core.iterators.user.IntersectingIterator;
 import org.apache.hadoop.io.Text;
@@ -158,8 +155,8 @@ public class FamilyIntersectingIteratorT
     Logger.getRootLogger().setLevel(Level.ERROR);
   }
   
-  private static final int NUM_ROWS = 10;
-  private static final int NUM_DOCIDS = 1000;
+  private static final int NUM_ROWS = 5;
+  private static final int NUM_DOCIDS = 200;
   
   public void test1() throws IOException {
     columnFamilies = new Text[2];

Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/RowDeletingIteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/RowDeletingIteratorTest.java?rev=1207551&r1=1207550&r2=1207551&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/RowDeletingIteratorTest.java (original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/RowDeletingIteratorTest.java Mon Nov 28 19:59:37 2011
@@ -21,30 +21,26 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.TreeMap;
 
+import junit.framework.TestCase;
+
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.data.ArrayByteSequence;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.iterators.IteratorEnvironment;
-import org.apache.accumulo.core.iterators.RowDeletingIterator;
-import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
-import org.apache.accumulo.core.iterators.SortedMapIterator;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.system.ColumnFamilySkippingIterator;
 import org.apache.hadoop.io.Text;
 
-import junit.framework.TestCase;
-
 public class RowDeletingIteratorTest extends TestCase {
   
-  static class TestIE implements IteratorEnvironment {
+  public static class TestIE implements IteratorEnvironment {
     
     private IteratorScope scope;
     private boolean fmc;
     
-    TestIE(IteratorScope scope, boolean fmc) {
+    public TestIE(IteratorScope scope, boolean fmc) {
       this.scope = scope;
       this.fmc = fmc;
     }



Mime
View raw message