accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/2] ACCUMULO-1854 First stab at being able to use multiple AccumuloInputFormats and AccumuloOutputFormats in the same Configuration.
Date Tue, 05 Nov 2013 22:17:03 GMT
Updated Branches:
  refs/heads/ACCUMULO-1854-multi-aif [created] 921617d4d


http://git-wip-us.apache.org/repos/asf/accumulo/blob/921617d4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
----------------------------------------------------------------------
diff --git a/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java b/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
index 8e238f1..32b7af5 100644
--- a/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
+++ b/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
@@ -41,6 +41,7 @@ import java.util.Map.Entry;
 import java.util.NoSuchElementException;
 import java.util.Set;
 import java.util.StringTokenizer;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
@@ -110,7 +111,7 @@ import org.apache.log4j.Logger;
 
 public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
   protected static final Logger log = Logger.getLogger(InputFormatBase.class);
-  
+
   private static final String PREFIX = AccumuloInputFormat.class.getSimpleName();
   private static final String INPUT_INFO_HAS_BEEN_SET = PREFIX + ".configured";
   private static final String INSTANCE_HAS_BEEN_SET = PREFIX + ".instanceConfigured";
@@ -118,43 +119,71 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
   private static final String PASSWORD = PREFIX + ".password";
   private static final String TABLE_NAME = PREFIX + ".tablename";
   private static final String AUTHORIZATIONS = PREFIX + ".authorizations";
-  
+
   private static final String INSTANCE_NAME = PREFIX + ".instanceName";
   private static final String ZOOKEEPERS = PREFIX + ".zooKeepers";
   private static final String MOCK = ".useMockInstance";
-  
+
   private static final String RANGES = PREFIX + ".ranges";
   private static final String AUTO_ADJUST_RANGES = PREFIX + ".ranges.autoAdjust";
-  
+
   private static final String ROW_REGEX = PREFIX + ".regex.row";
   private static final String COLUMN_FAMILY_REGEX = PREFIX + ".regex.cf";
   private static final String COLUMN_QUALIFIER_REGEX = PREFIX + ".regex.cq";
   private static final String VALUE_REGEX = PREFIX + ".regex.value";
-  
+
   private static final String COLUMNS = PREFIX + ".columns";
   private static final String LOGLEVEL = PREFIX + ".loglevel";
-  
+
   private static final String ISOLATED = PREFIX + ".isolated";
-  
+
   private static final String LOCAL_ITERATORS = PREFIX + ".localiters";
-  
+
   // Used to specify the maximum # of versions of an Accumulo cell value to return
   private static final String MAX_VERSIONS = PREFIX + ".maxVersions";
-  
+
   // Used for specifying the iterators to be applied
   private static final String ITERATORS = PREFIX + ".iterators";
   private static final String ITERATORS_OPTIONS = PREFIX + ".iterators.options";
   private static final String ITERATORS_DELIM = ",";
-  
+
+  private static final String SEQ_DELIM = ".";
+  protected static final int DEFAULT_SEQUENCE = 0;
+
   private static final String READ_OFFLINE = PREFIX + ".read.offline";
 
+  private static final AtomicInteger NUM_CONFIGURATIONS_LOADED = new AtomicInteger(0);
+  private static final AtomicInteger NUM_CONFIGURATIONS_PROCESSED = new AtomicInteger(0);
+
+  /**
+   * Get a unique identifier for these configurations
+   * 
+   * @return A unique number to provide to future AccumuloInputFormat calls
+   */
+  public static int nextSequence() {
+    return NUM_CONFIGURATIONS_LOADED.incrementAndGet();
+  }
+
+  protected static String merge(String name, Integer sequence) {
+    return name + SEQ_DELIM + sequence;
+  }
+  
+  /**
+   * For testing purposes, allows internal counters to be reset. Clients should not have
+   * to call this directly.
+   */
+  public static void resetCounters() {
+    NUM_CONFIGURATIONS_LOADED.set(0);
+    NUM_CONFIGURATIONS_PROCESSED.set(0);
+  }
+
   /**
    * @deprecated Use {@link #setIsolated(Configuration,boolean)} instead
    */
   public static void setIsolated(JobContext job, boolean enable) {
     setIsolated(job.getConfiguration(), enable);
   }
-  
+
   /**
    * Enable or disable use of the {@link IsolatedScanner} in this configuration object. By default it is not enabled.
    * 
@@ -164,16 +193,28 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          if true, enable usage of the IsolatedScanner. Otherwise, disable.
    */
   public static void setIsolated(Configuration conf, boolean enable) {
-    conf.setBoolean(ISOLATED, enable);
+    setIsolated(conf, DEFAULT_SEQUENCE, enable);
   }
-  
+
+  /**
+   * Enable or disable use of the {@link IsolatedScanner} in this configuration object. By default it is not enabled.
+   * 
+   * @param conf
+   *          The Hadoop configuration object
+   * @param enable
+   *          if true, enable usage of the IsolatedScanner. Otherwise, disable.
+   */
+  public static void setIsolated(Configuration conf, int sequence, boolean enable) {
+    conf.setBoolean(merge(ISOLATED, sequence), enable);
+  }
+
   /**
    * @deprecated Use {@link #setLocalIterators(Configuration,boolean)} instead
    */
   public static void setLocalIterators(JobContext job, boolean enable) {
     setLocalIterators(job.getConfiguration(), enable);
   }
-  
+
   /**
    * Enable or disable use of the {@link ClientSideIteratorScanner} in this Configuration object. By default it is not enabled.
    * 
@@ -183,16 +224,28 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          if true, enable usage of the ClientSideInteratorScanner. Otherwise, disable.
    */
   public static void setLocalIterators(Configuration conf, boolean enable) {
-    conf.setBoolean(LOCAL_ITERATORS, enable);
+    setLocalIterators(conf, DEFAULT_SEQUENCE, enable);
   }
-  
+
+  /**
+   * Enable or disable use of the {@link ClientSideIteratorScanner} in this Configuration object. By default it is not enabled.
+   * 
+   * @param conf
+   *          The Hadoop configuration object
+   * @param enable
+   *          if true, enable usage of the ClientSideInteratorScanner. Otherwise, disable.
+   */
+  public static void setLocalIterators(Configuration conf, int sequence, boolean enable) {
+    conf.setBoolean(merge(LOCAL_ITERATORS, sequence), enable);
+  }
+
   /**
    * @deprecated Use {@link #setInputInfo(Configuration,String,byte[],String,Authorizations)} instead
    */
   public static void setInputInfo(JobContext job, String user, byte[] passwd, String table, Authorizations auths) {
     setInputInfo(job.getConfiguration(), user, passwd, table, auths);
   }
-  
+
   /**
    * Initialize the user, table, and authorization information for the configuration object that will be used with an Accumulo InputFormat.
    * 
@@ -208,25 +261,44 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          the authorizations used to restrict data read
    */
   public static void setInputInfo(Configuration conf, String user, byte[] passwd, String table, Authorizations auths) {
-    if (conf.getBoolean(INPUT_INFO_HAS_BEEN_SET, false))
-      throw new IllegalStateException("Input info can only be set once per job");
-    conf.setBoolean(INPUT_INFO_HAS_BEEN_SET, true);
-    
+    setInputInfo(conf, DEFAULT_SEQUENCE, user, passwd, table, auths);
+  }
+
+  /**
+   * Initialize the user, table, and authorization information for the configuration object that will be used with an Accumulo InputFormat.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @param user
+   *          a valid accumulo user
+   * @param passwd
+   *          the user's password
+   * @param table
+   *          the table to read
+   * @param auths
+   *          the authorizations used to restrict data read
+   */
+  public static void setInputInfo(Configuration conf, int sequence, String user, byte[] passwd, String table, Authorizations auths) {
+    final String inputInfoSet = merge(INPUT_INFO_HAS_BEEN_SET, sequence);
+    if (conf.getBoolean(inputInfoSet, false))
+      throw new IllegalStateException("Input info for sequence " + sequence + " can only be set once per job");
+    conf.setBoolean(inputInfoSet, true);
+
     ArgumentChecker.notNull(user, passwd, table);
-    conf.set(USERNAME, user);
-    conf.set(PASSWORD, new String(Base64.encodeBase64(passwd)));
-    conf.set(TABLE_NAME, table);
+    conf.set(merge(USERNAME, sequence), user);
+    conf.set(merge(PASSWORD, sequence), new String(Base64.encodeBase64(passwd)));
+    conf.set(merge(TABLE_NAME, sequence), table);
     if (auths != null && !auths.isEmpty())
-      conf.set(AUTHORIZATIONS, auths.serialize());
+      conf.set(merge(AUTHORIZATIONS, sequence), auths.serialize());
   }
-  
+
   /**
    * @deprecated Use {@link #setZooKeeperInstance(Configuration,String,String)} instead
    */
   public static void setZooKeeperInstance(JobContext job, String instanceName, String zooKeepers) {
     setZooKeeperInstance(job.getConfiguration(), instanceName, zooKeepers);
   }
-  
+
   /**
    * Configure a {@link ZooKeeperInstance} for this configuration object.
    * 
@@ -238,22 +310,37 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          a comma-separated list of zookeeper servers
    */
   public static void setZooKeeperInstance(Configuration conf, String instanceName, String zooKeepers) {
-    if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
-      throw new IllegalStateException("Instance info can only be set once per job");
-    conf.setBoolean(INSTANCE_HAS_BEEN_SET, true);
-    
+    setZooKeeperInstance(conf, DEFAULT_SEQUENCE, instanceName, zooKeepers);
+  }
+
+  /**
+   * Configure a {@link ZooKeeperInstance} for this configuration object.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @param instanceName
+   *          the accumulo instance name
+   * @param zooKeepers
+   *          a comma-separated list of zookeeper servers
+   */
+  public static void setZooKeeperInstance(Configuration conf, int sequence, String instanceName, String zooKeepers) {
+    final String instanceInfoSet = merge(INSTANCE_HAS_BEEN_SET, sequence);
+    if (conf.getBoolean(instanceInfoSet, false))
+      throw new IllegalStateException("Instance info for sequence " + sequence + " can only be set once per job");
+    conf.setBoolean(instanceInfoSet, true);
+
     ArgumentChecker.notNull(instanceName, zooKeepers);
-    conf.set(INSTANCE_NAME, instanceName);
-    conf.set(ZOOKEEPERS, zooKeepers);
+    conf.set(merge(INSTANCE_NAME, sequence), instanceName);
+    conf.set(merge(ZOOKEEPERS, sequence), zooKeepers);
   }
-  
+
   /**
    * @deprecated Use {@link #setMockInstance(Configuration,String)} instead
    */
   public static void setMockInstance(JobContext job, String instanceName) {
     setMockInstance(job.getConfiguration(), instanceName);
   }
-  
+
   /**
    * Configure a {@link MockInstance} for this configuration object.
    * 
@@ -263,18 +350,30 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          the accumulo instance name
    */
   public static void setMockInstance(Configuration conf, String instanceName) {
-    conf.setBoolean(INSTANCE_HAS_BEEN_SET, true);
-    conf.setBoolean(MOCK, true);
-    conf.set(INSTANCE_NAME, instanceName);
+    setMockInstance(conf, DEFAULT_SEQUENCE, instanceName);
   }
-  
+
+  /**
+   * Configure a {@link MockInstance} for this configuration object.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @param instanceName
+   *          the accumulo instance name
+   */
+  public static void setMockInstance(Configuration conf, int sequence, String instanceName) {
+    conf.setBoolean(merge(INSTANCE_HAS_BEEN_SET, sequence), true);
+    conf.setBoolean(merge(MOCK, sequence), true);
+    conf.set(merge(INSTANCE_NAME, sequence), instanceName);
+  }
+
   /**
    * @deprecated Use {@link #setRanges(Configuration,Collection)} instead
    */
   public static void setRanges(JobContext job, Collection<Range> ranges) {
     setRanges(job.getConfiguration(), ranges);
   }
-  
+
   /**
    * Set the ranges to map over for this configuration object.
    * 
@@ -284,6 +383,18 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          the ranges that will be mapped over
    */
   public static void setRanges(Configuration conf, Collection<Range> ranges) {
+    setRanges(conf, DEFAULT_SEQUENCE, ranges);
+  }
+
+  /**
+   * Set the ranges to map over for this configuration object.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @param ranges
+   *          the ranges that will be mapped over
+   */
+  public static void setRanges(Configuration conf, int sequence, Collection<Range> ranges) {
     ArgumentChecker.notNull(ranges);
     ArrayList<String> rangeStrings = new ArrayList<String>(ranges.size());
     try {
@@ -295,16 +406,16 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
     } catch (IOException ex) {
       throw new IllegalArgumentException("Unable to encode ranges to Base64", ex);
     }
-    conf.setStrings(RANGES, rangeStrings.toArray(new String[0]));
+    conf.setStrings(merge(RANGES, sequence), rangeStrings.toArray(new String[0]));
   }
-  
+
   /**
    * @deprecated Use {@link #disableAutoAdjustRanges(Configuration)} instead
    */
   public static void disableAutoAdjustRanges(JobContext job) {
     disableAutoAdjustRanges(job.getConfiguration());
   }
-  
+
   /**
    * Disables the adjustment of ranges for this configuration object. By default, overlapping ranges will be merged and ranges will be fit to existing tablet
    * boundaries. Disabling this adjustment will cause there to be exactly one mapper per range set using {@link #setRanges(Configuration, Collection)}.
@@ -313,16 +424,27 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          the Hadoop configuration object
    */
   public static void disableAutoAdjustRanges(Configuration conf) {
-    conf.setBoolean(AUTO_ADJUST_RANGES, false);
+    disableAutoAdjustRanges(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Disables the adjustment of ranges for this configuration object. By default, overlapping ranges will be merged and ranges will be fit to existing tablet
+   * boundaries. Disabling this adjustment will cause there to be exactly one mapper per range set using {@link #setRanges(Configuration, Collection)}.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   */
+  public static void disableAutoAdjustRanges(Configuration conf, int sequence) {
+    conf.setBoolean(merge(AUTO_ADJUST_RANGES, sequence), false);
+  }
+
   /**
    * @deprecated since 1.4 use {@link org.apache.accumulo.core.iterators.user.RegExFilter} and {@link #addIterator(Configuration, IteratorSetting)}
    */
   public static enum RegexType {
     ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, VALUE
   }
-  
+
   /**
    * @deprecated since 1.4 use {@link #addIterator(Configuration, IteratorSetting)}
    * @see org.apache.accumulo.core.iterators.user.RegExFilter#setRegexs(IteratorSetting, String, String, String, String, boolean)
@@ -331,6 +453,17 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @param regex
    */
   public static void setRegex(JobContext job, RegexType type, String regex) {
+    setRegex(job, DEFAULT_SEQUENCE, type, regex);
+  }
+
+  /**
+   * @deprecated since 1.4 use {@link #addIterator(Configuration, IteratorSetting)}
+   * @see org.apache.accumulo.core.iterators.user.RegExFilter#setRegexs(IteratorSetting, String, String, String, String, boolean)
+   * @param job
+   * @param type
+   * @param regex
+   */
+  public static void setRegex(JobContext job, int sequence, RegexType type, String regex) {
     ArgumentChecker.notNull(type, regex);
     String key = null;
     switch (type) {
@@ -350,20 +483,20 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         throw new NoSuchElementException();
     }
     try {
-      job.getConfiguration().set(key, URLEncoder.encode(regex, "UTF-8"));
+      job.getConfiguration().set(merge(key, sequence), URLEncoder.encode(regex, "UTF-8"));
     } catch (UnsupportedEncodingException e) {
       log.error("Failedd to encode regular expression", e);
       throw new RuntimeException(e);
     }
   }
-  
+
   /**
    * @deprecated Use {@link #setMaxVersions(Configuration,int)} instead
    */
   public static void setMaxVersions(JobContext job, int maxVersions) throws IOException {
     setMaxVersions(job.getConfiguration(), maxVersions);
   }
-  
+
   /**
    * Sets the max # of values that may be returned for an individual Accumulo cell. By default, applied before all other Accumulo iterators (highest priority)
    * leveraged in the scan by the record reader. To adjust priority use setIterator() & setIteratorOptions() w/ the VersioningIterator type explicitly.
@@ -376,11 +509,26 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *           if maxVersions is < 1
    */
   public static void setMaxVersions(Configuration conf, int maxVersions) throws IOException {
+    setMaxVersions(conf, DEFAULT_SEQUENCE, maxVersions);
+  }
+
+  /**
+   * Sets the max # of values that may be returned for an individual Accumulo cell. By default, applied before all other Accumulo iterators (highest priority)
+   * leveraged in the scan by the record reader. To adjust priority use setIterator() & setIteratorOptions() w/ the VersioningIterator type explicitly.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @param maxVersions
+   *          the max number of versions per accumulo cell
+   * @throws IOException
+   *           if maxVersions is < 1
+   */
+  public static void setMaxVersions(Configuration conf, int sequence, int maxVersions) throws IOException {
     if (maxVersions < 1)
       throw new IOException("Invalid maxVersions: " + maxVersions + ".  Must be >= 1");
-    conf.setInt(MAX_VERSIONS, maxVersions);
+    conf.setInt(merge(MAX_VERSIONS, sequence), maxVersions);
   }
-  
+
   /**
    * <p>
    * Enable reading offline tables. This will make the map reduce job directly read the tables files. If the table is not offline, then the job will fail. If
@@ -407,18 +555,49 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @param scanOff
    *          pass true to read offline tables
    */
-  
+
   public static void setScanOffline(Configuration conf, boolean scanOff) {
-    conf.setBoolean(READ_OFFLINE, scanOff);
+    setScanOffline(conf, DEFAULT_SEQUENCE, scanOff);
   }
-  
+
+  /**
+   * <p>
+   * Enable reading offline tables. This will make the map reduce job directly read the tables files. If the table is not offline, then the job will fail. If
+   * the table comes online during the map reduce job, its likely that the job will fail.
+   * 
+   * <p>
+   * To use this option, the map reduce user will need access to read the accumulo directory in HDFS.
+   * 
+   * <p>
+   * Reading the offline table will create the scan time iterator stack in the map process. So any iterators that are configured for the table will need to be
+   * on the mappers classpath. The accumulo-site.xml may need to be on the mappers classpath if HDFS or the accumlo directory in HDFS are non-standard.
+   * 
+   * <p>
+   * One way to use this feature is to clone a table, take the clone offline, and use the clone as the input table for a map reduce job. If you plan to map
+   * reduce over the data many times, it may be better to the compact the table, clone it, take it offline, and use the clone for all map reduce jobs. The
+   * reason to do this is that compaction will reduce each tablet in the table to one file, and its faster to read from one file.
+   * 
+   * <p>
+   * There are two possible advantages to reading a tables file directly out of HDFS. First, you may see better read performance. Second, it will support
+   * speculative execution better. When reading an online table speculative execution can put more load on an already slow tablet server.
+   * 
+   * @param conf
+   *          the job
+   * @param scanOff
+   *          pass true to read offline tables
+   */
+
+  public static void setScanOffline(Configuration conf, int sequence, boolean scanOff) {
+    conf.setBoolean(merge(READ_OFFLINE, sequence), scanOff);
+  }
+
   /**
    * @deprecated Use {@link #fetchColumns(Configuration,Collection)} instead
    */
   public static void fetchColumns(JobContext job, Collection<Pair<Text,Text>> columnFamilyColumnQualifierPairs) {
     fetchColumns(job.getConfiguration(), columnFamilyColumnQualifierPairs);
   }
-  
+
   /**
    * Restricts the columns that will be mapped over for this configuration object.
    * 
@@ -429,27 +608,40 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          selected. An empty set is the default and is equivalent to scanning the all columns.
    */
   public static void fetchColumns(Configuration conf, Collection<Pair<Text,Text>> columnFamilyColumnQualifierPairs) {
+    fetchColumns(conf, DEFAULT_SEQUENCE, columnFamilyColumnQualifierPairs);
+  }
+
+  /**
+   * Restricts the columns that will be mapped over for this configuration object.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @param columnFamilyColumnQualifierPairs
+   *          A pair of {@link Text} objects corresponding to column family and column qualifier. If the column qualifier is null, the entire column family is
+   *          selected. An empty set is the default and is equivalent to scanning the all columns.
+   */
+  public static void fetchColumns(Configuration conf, int sequence, Collection<Pair<Text,Text>> columnFamilyColumnQualifierPairs) {
     ArgumentChecker.notNull(columnFamilyColumnQualifierPairs);
     ArrayList<String> columnStrings = new ArrayList<String>(columnFamilyColumnQualifierPairs.size());
     for (Pair<Text,Text> column : columnFamilyColumnQualifierPairs) {
       if (column.getFirst() == null)
-        throw new IllegalArgumentException("Column family can not be null");
-      
+        throw new IllegalArgumentException("Column family can not be null for sequence " + sequence);
+
       String col = new String(Base64.encodeBase64(TextUtil.getBytes(column.getFirst())));
       if (column.getSecond() != null)
         col += ":" + new String(Base64.encodeBase64(TextUtil.getBytes(column.getSecond())));
       columnStrings.add(col);
     }
-    conf.setStrings(COLUMNS, columnStrings.toArray(new String[0]));
+    conf.setStrings(merge(COLUMNS, sequence), columnStrings.toArray(new String[0]));
   }
-  
+
   /**
    * @deprecated Use {@link #setLogLevel(Configuration,Level)} instead
    */
   public static void setLogLevel(JobContext job, Level level) {
     setLogLevel(job.getConfiguration(), level);
   }
-  
+
   /**
    * Sets the log level for this configuration object.
    * 
@@ -459,18 +651,31 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          the logging level
    */
   public static void setLogLevel(Configuration conf, Level level) {
+    setLogLevel(conf, DEFAULT_SEQUENCE, level);
+  }
+
+  /**
+   * Sets the log level for this configuration object.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @param level
+   *          the logging level
+   */
+  public static void setLogLevel(Configuration conf, int sequence, Level level) {
     ArgumentChecker.notNull(level);
+    // TODO We can't differentiate logging levels with the sequence number approach
     log.setLevel(level);
-    conf.setInt(LOGLEVEL, level.toInt());
+    conf.setInt(merge(LOGLEVEL, sequence), level.toInt());
   }
-  
+
   /**
    * @deprecated Use {@link #addIterator(Configuration,IteratorSetting)} instead
    */
   public static void addIterator(JobContext job, IteratorSetting cfg) {
     addIterator(job.getConfiguration(), cfg);
   }
-  
+
   /**
    * Encode an iterator on the input for this configuration object.
    * 
@@ -480,9 +685,21 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *          The configuration of the iterator
    */
   public static void addIterator(Configuration conf, IteratorSetting cfg) {
+    addIterator(conf, DEFAULT_SEQUENCE, cfg);
+  }
+
+  /**
+   * Encode an iterator on the input for this configuration object.
+   * 
+   * @param conf
+   *          The Hadoop configuration in which to save the iterator configuration
+   * @param cfg
+   *          The configuration of the iterator
+   */
+  public static void addIterator(Configuration conf, int sequence, IteratorSetting cfg) {
     // First check to see if anything has been set already
-    String iterators = conf.get(ITERATORS);
-    
+    String iterators = conf.get(merge(ITERATORS, sequence));
+
     // No iterators specified yet, create a new string
     if (iterators == null || iterators.isEmpty()) {
       iterators = new AccumuloIterator(cfg.getPriority(), cfg.getIteratorClass(), cfg.getName()).toString();
@@ -491,13 +708,13 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       iterators = iterators.concat(ITERATORS_DELIM + new AccumuloIterator(cfg.getPriority(), cfg.getIteratorClass(), cfg.getName()).toString());
     }
     // Store the iterators w/ the job
-    conf.set(ITERATORS, iterators);
+    conf.set(merge(ITERATORS, sequence), iterators);
     for (Entry<String,String> entry : cfg.getOptions().entrySet()) {
       if (entry.getValue() == null)
         continue;
-      
-      String iteratorOptions = conf.get(ITERATORS_OPTIONS);
-      
+
+      String iteratorOptions = conf.get(merge(ITERATORS_OPTIONS, sequence));
+
       // No options specified yet, create a new string
       if (iteratorOptions == null || iteratorOptions.isEmpty()) {
         iteratorOptions = new AccumuloIteratorOption(cfg.getName(), entry.getKey(), entry.getValue()).toString();
@@ -505,12 +722,12 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         // append the next option & reset
         iteratorOptions = iteratorOptions.concat(ITERATORS_DELIM + new AccumuloIteratorOption(cfg.getName(), entry.getKey(), entry.getValue()));
       }
-      
+
       // Store the options w/ the job
-      conf.set(ITERATORS_OPTIONS, iteratorOptions);
+      conf.set(merge(ITERATORS_OPTIONS, sequence), iteratorOptions);
     }
   }
-  
+
   /**
    * Specify an Accumulo iterator type to manage the behavior of the underlying table scan this InputFormat's RecordReader will conduct, w/ priority dictating
    * the order in which specified iterators are applied. Repeat calls to specify multiple iterators are allowed.
@@ -527,9 +744,28 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @deprecated since 1.4, see {@link #addIterator(Configuration, IteratorSetting)}
    */
   public static void setIterator(JobContext job, int priority, String iteratorClass, String iteratorName) {
+    setIterator(job, DEFAULT_SEQUENCE, priority, iteratorClass, iteratorName);
+  }
+
+  /**
+   * Specify an Accumulo iterator type to manage the behavior of the underlying table scan this InputFormat's RecordReader will conduct, w/ priority dictating
+   * the order in which specified iterators are applied. Repeat calls to specify multiple iterators are allowed.
+   * 
+   * @param job
+   *          the job
+   * @param priority
+   *          the priority
+   * @param iteratorClass
+   *          the iterator class
+   * @param iteratorName
+   *          the iterator name
+   * 
+   * @deprecated since 1.4, see {@link #addIterator(Configuration, IteratorSetting)}
+   */
+  public static void setIterator(JobContext job, int sequence, int priority, String iteratorClass, String iteratorName) {
     // First check to see if anything has been set already
-    String iterators = job.getConfiguration().get(ITERATORS);
-    
+    String iterators = job.getConfiguration().get(merge(ITERATORS, sequence));
+
     // No iterators specified yet, create a new string
     if (iterators == null || iterators.isEmpty()) {
       iterators = new AccumuloIterator(priority, iteratorClass, iteratorName).toString();
@@ -538,10 +774,10 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       iterators = iterators.concat(ITERATORS_DELIM + new AccumuloIterator(priority, iteratorClass, iteratorName).toString());
     }
     // Store the iterators w/ the job
-    job.getConfiguration().set(ITERATORS, iterators);
-    
+    job.getConfiguration().set(merge(ITERATORS, sequence), iterators);
+
   }
-  
+
   /**
    * Specify an option for a named Accumulo iterator, further specifying that iterator's behavior.
    * 
@@ -557,11 +793,29 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @deprecated since 1.4, see {@link #addIterator(Configuration, IteratorSetting)}
    */
   public static void setIteratorOption(JobContext job, String iteratorName, String key, String value) {
+    setIteratorOption(job, DEFAULT_SEQUENCE, iteratorName, key, value);
+  }
+
+  /**
+   * Specify an option for a named Accumulo iterator, further specifying that iterator's behavior.
+   * 
+   * @param job
+   *          the job
+   * @param iteratorName
+   *          the iterator name. Should correspond to an iterator set w/ a prior setIterator call.
+   * @param key
+   *          the key
+   * @param value
+   *          the value
+   * 
+   * @deprecated since 1.4, see {@link #addIterator(Configuration, IteratorSetting)}
+   */
+  public static void setIteratorOption(JobContext job, int sequence, String iteratorName, String key, String value) {
     if (iteratorName == null || key == null || value == null)
       return;
-    
-    String iteratorOptions = job.getConfiguration().get(ITERATORS_OPTIONS);
-    
+
+    String iteratorOptions = job.getConfiguration().get(merge(ITERATORS_OPTIONS, sequence));
+
     // No options specified yet, create a new string
     if (iteratorOptions == null || iteratorOptions.isEmpty()) {
       iteratorOptions = new AccumuloIteratorOption(iteratorName, key, value).toString();
@@ -569,18 +823,18 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       // append the next option & reset
       iteratorOptions = iteratorOptions.concat(ITERATORS_DELIM + new AccumuloIteratorOption(iteratorName, key, value));
     }
-    
+
     // Store the options w/ the job
-    job.getConfiguration().set(ITERATORS_OPTIONS, iteratorOptions);
+    job.getConfiguration().set(merge(ITERATORS_OPTIONS, sequence), iteratorOptions);
   }
-  
+
   /**
    * @deprecated Use {@link #isIsolated(Configuration)} instead
    */
   protected static boolean isIsolated(JobContext job) {
     return isIsolated(job.getConfiguration());
   }
-  
+
   /**
    * Determines whether a configuration has isolation enabled.
    * 
@@ -590,16 +844,28 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setIsolated(Configuration, boolean)
    */
   protected static boolean isIsolated(Configuration conf) {
-    return conf.getBoolean(ISOLATED, false);
+    return isIsolated(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Determines whether a configuration has isolation enabled.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return true if isolation is enabled, false otherwise
+   * @see #setIsolated(Configuration, boolean)
+   */
+  protected static boolean isIsolated(Configuration conf, int sequence) {
+    return conf.getBoolean(merge(ISOLATED, sequence), false);
+  }
+
   /**
    * @deprecated Use {@link #usesLocalIterators(Configuration)} instead
    */
   protected static boolean usesLocalIterators(JobContext job) {
     return usesLocalIterators(job.getConfiguration());
   }
-  
+
   /**
    * Determines whether a configuration uses local iterators.
    * 
@@ -609,16 +875,28 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setLocalIterators(Configuration, boolean)
    */
   protected static boolean usesLocalIterators(Configuration conf) {
-    return conf.getBoolean(LOCAL_ITERATORS, false);
+    return usesLocalIterators(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Determines whether a configuration uses local iterators.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return true if uses local iterators, false otherwise
+   * @see #setLocalIterators(Configuration, boolean)
+   */
+  protected static boolean usesLocalIterators(Configuration conf, int sequence) {
+    return conf.getBoolean(merge(LOCAL_ITERATORS, sequence), false);
+  }
+
   /**
    * @deprecated Use {@link #getUsername(Configuration)} instead
    */
   protected static String getUsername(JobContext job) {
     return getUsername(job.getConfiguration());
   }
-  
+
   /**
    * Gets the user name from the configuration.
    * 
@@ -628,9 +906,21 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setInputInfo(Configuration, String, byte[], String, Authorizations)
    */
   protected static String getUsername(Configuration conf) {
-    return conf.get(USERNAME);
+    return getUsername(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Gets the user name from the configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return the user name
+   * @see #setInputInfo(Configuration, String, byte[], String, Authorizations)
+   */
+  protected static String getUsername(Configuration conf, int sequence) {
+    return conf.get(merge(USERNAME, sequence));
+  }
+
   /**
    * WARNING: The password is stored in the Configuration and shared with all MapReduce tasks; It is BASE64 encoded to provide a charset safe conversion to a
    * string, and is not intended to be secure.
@@ -640,7 +930,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
   protected static byte[] getPassword(JobContext job) {
     return getPassword(job.getConfiguration());
   }
-  
+
   /**
    * Gets the password from the configuration. WARNING: The password is stored in the Configuration and shared with all MapReduce tasks; It is BASE64 encoded to
    * provide a charset safe conversion to a string, and is not intended to be secure.
@@ -651,16 +941,29 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setInputInfo(Configuration, String, byte[], String, Authorizations)
    */
   protected static byte[] getPassword(Configuration conf) {
-    return Base64.decodeBase64(conf.get(PASSWORD, "").getBytes());
+    return getPassword(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Gets the password from the configuration. WARNING: The password is stored in the Configuration and shared with all MapReduce tasks; It is BASE64 encoded to
+   * provide a charset safe conversion to a string, and is not intended to be secure.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return the BASE64-encoded password
+   * @see #setInputInfo(Configuration, String, byte[], String, Authorizations)
+   */
+  protected static byte[] getPassword(Configuration conf, int sequence) {
+    return Base64.decodeBase64(conf.get(merge(PASSWORD, sequence), "").getBytes());
+  }
+
   /**
    * @deprecated Use {@link #getTablename(Configuration)} instead
    */
   protected static String getTablename(JobContext job) {
     return getTablename(job.getConfiguration());
   }
-  
+
   /**
    * Gets the table name from the configuration.
    * 
@@ -670,16 +973,28 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setInputInfo(Configuration, String, byte[], String, Authorizations)
    */
   protected static String getTablename(Configuration conf) {
-    return conf.get(TABLE_NAME);
+    return getTablename(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Gets the table name from the configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return the table name
+   * @see #setInputInfo(Configuration, String, byte[], String, Authorizations)
+   */
+  protected static String getTablename(Configuration conf, int sequence) {
+    return conf.get(merge(TABLE_NAME, sequence));
+  }
+
   /**
    * @deprecated Use {@link #getAuthorizations(Configuration)} instead
    */
   protected static Authorizations getAuthorizations(JobContext job) {
     return getAuthorizations(job.getConfiguration());
   }
-  
+
   /**
    * Gets the authorizations to set for the scans from the configuration.
    * 
@@ -689,17 +1004,29 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setInputInfo(Configuration, String, byte[], String, Authorizations)
    */
   protected static Authorizations getAuthorizations(Configuration conf) {
-    String authString = conf.get(AUTHORIZATIONS);
+    return getAuthorizations(conf, DEFAULT_SEQUENCE);
+  }
+
+  /**
+   * Gets the authorizations to set for the scans from the configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return the accumulo scan authorizations
+   * @see #setInputInfo(Configuration, String, byte[], String, Authorizations)
+   */
+  protected static Authorizations getAuthorizations(Configuration conf, int sequence) {
+    final String authString = conf.get(merge(AUTHORIZATIONS, sequence));
     return authString == null ? Constants.NO_AUTHS : new Authorizations(authString.split(","));
   }
-  
+
   /**
    * @deprecated Use {@link #getInstance(Configuration)} instead
    */
   protected static Instance getInstance(JobContext job) {
     return getInstance(job.getConfiguration());
   }
-  
+
   /**
    * Initializes an Accumulo {@link Instance} based on the configuration.
    * 
@@ -710,18 +1037,44 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setMockInstance(Configuration, String)
    */
   protected static Instance getInstance(Configuration conf) {
-    if (conf.getBoolean(MOCK, false))
-      return new MockInstance(conf.get(INSTANCE_NAME));
-    return new ZooKeeperInstance(conf.get(INSTANCE_NAME), conf.get(ZOOKEEPERS));
+    return getInstance(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Initializes an Accumulo {@link Instance} based on the configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return an accumulo instance
+   * @see #setZooKeeperInstance(Configuration, String, String)
+   * @see #setMockInstance(Configuration, String)
+   */
+  protected static Instance getInstance(Configuration conf, int sequence) {
+    if (conf.getBoolean(merge(MOCK, sequence), false))
+      return new MockInstance(conf.get(merge(INSTANCE_NAME, sequence)));
+    return new ZooKeeperInstance(conf.get(merge(INSTANCE_NAME, sequence)), conf.get(merge(ZOOKEEPERS, sequence)));
+  }
+
   /**
    * @deprecated Use {@link #getTabletLocator(Configuration)} instead
    */
-  protected static TabletLocator getTabletLocator(JobContext job) throws TableNotFoundException {
-    return getTabletLocator(job.getConfiguration());
+  protected static TabletLocator getTabletLocator(JobContext job) throws TableNotFoundException {
+    return getTabletLocator(job.getConfiguration());
+  }
+
+  /**
+   * Initializes an Accumulo {@link TabletLocator} based on the configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return an accumulo tablet locator
+   * @throws TableNotFoundException
+   *           if the table name set on the configuration doesn't exist
+   */
+  protected static TabletLocator getTabletLocator(Configuration conf) throws TableNotFoundException {
+    return getTabletLocator(conf, DEFAULT_SEQUENCE);
   }
-  
+
   /**
    * Initializes an Accumulo {@link TabletLocator} based on the configuration.
    * 
@@ -731,24 +1084,24 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @throws TableNotFoundException
    *           if the table name set on the configuration doesn't exist
    */
-  protected static TabletLocator getTabletLocator(Configuration conf) throws TableNotFoundException {
-    if (conf.getBoolean(MOCK, false))
+  protected static TabletLocator getTabletLocator(Configuration conf, int sequence) throws TableNotFoundException {
+    if (conf.getBoolean(merge(MOCK, sequence), false))
       return new MockTabletLocator();
-    Instance instance = getInstance(conf);
-    String username = getUsername(conf);
-    byte[] password = getPassword(conf);
-    String tableName = getTablename(conf);
+    Instance instance = getInstance(conf, sequence);
+    String username = getUsername(conf, sequence);
+    byte[] password = getPassword(conf, sequence);
+    String tableName = getTablename(conf, sequence);
     return TabletLocator.getInstance(instance, new AuthInfo(username, ByteBuffer.wrap(password), instance.getInstanceID()),
         new Text(Tables.getTableId(instance, tableName)));
   }
-  
+
   /**
    * @deprecated Use {@link #getRanges(Configuration)} instead
    */
   protected static List<Range> getRanges(JobContext job) throws IOException {
     return getRanges(job.getConfiguration());
   }
-  
+
   /**
    * Gets the ranges to scan over from a configuration object.
    * 
@@ -760,8 +1113,22 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setRanges(Configuration, Collection)
    */
   protected static List<Range> getRanges(Configuration conf) throws IOException {
+    return getRanges(conf, DEFAULT_SEQUENCE);
+  }
+
+  /**
+   * Gets the ranges to scan over from a configuration object.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return the ranges
+   * @throws IOException
+   *           if the ranges have been encoded improperly
+   * @see #setRanges(Configuration, Collection)
+   */
+  protected static List<Range> getRanges(Configuration conf, int sequence) throws IOException {
     ArrayList<Range> ranges = new ArrayList<Range>();
-    for (String rangeString : conf.getStringCollection(RANGES)) {
+    for (String rangeString : conf.getStringCollection(merge(RANGES, sequence))) {
       ByteArrayInputStream bais = new ByteArrayInputStream(Base64.decodeBase64(rangeString.getBytes()));
       Range range = new Range();
       range.readFields(new DataInputStream(bais));
@@ -769,12 +1136,20 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
     }
     return ranges;
   }
-  
+
   /**
    * @deprecated since 1.4 use {@link org.apache.accumulo.core.iterators.user.RegExFilter} and {@link #addIterator(Configuration, IteratorSetting)}
    * @see #setRegex(JobContext, RegexType, String)
    */
   protected static String getRegex(JobContext job, RegexType type) {
+    return getRegex(job, DEFAULT_SEQUENCE, type);
+  }
+
+  /**
+   * @deprecated since 1.4 use {@link org.apache.accumulo.core.iterators.user.RegExFilter} and {@link #addIterator(Configuration, IteratorSetting)}
+   * @see #setRegex(JobContext, RegexType, String)
+   */
+  protected static String getRegex(JobContext job, int sequence, RegexType type) {
     String key = null;
     switch (type) {
       case ROW:
@@ -793,7 +1168,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         throw new NoSuchElementException();
     }
     try {
-      String s = job.getConfiguration().get(key);
+      String s = job.getConfiguration().get(merge(key, sequence));
       if (s == null)
         return null;
       return URLDecoder.decode(s, "UTF-8");
@@ -802,14 +1177,14 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       throw new RuntimeException(e);
     }
   }
-  
+
   /**
    * @deprecated Use {@link #getFetchedColumns(Configuration)} instead
    */
   protected static Set<Pair<Text,Text>> getFetchedColumns(JobContext job) {
     return getFetchedColumns(job.getConfiguration());
   }
-  
+
   /**
    * Gets the columns to be mapped over from this configuration object.
    * 
@@ -819,8 +1194,20 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #fetchColumns(Configuration, Collection)
    */
   protected static Set<Pair<Text,Text>> getFetchedColumns(Configuration conf) {
+    return getFetchedColumns(conf, DEFAULT_SEQUENCE);
+  }
+
+  /**
+   * Gets the columns to be mapped over from this configuration object.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return a set of columns
+   * @see #fetchColumns(Configuration, Collection)
+   */
+  protected static Set<Pair<Text,Text>> getFetchedColumns(Configuration conf, int sequence) {
     Set<Pair<Text,Text>> columns = new HashSet<Pair<Text,Text>>();
-    for (String col : conf.getStringCollection(COLUMNS)) {
+    for (String col : conf.getStringCollection(merge(COLUMNS, sequence))) {
       int idx = col.indexOf(":");
       Text cf = new Text(idx < 0 ? Base64.decodeBase64(col.getBytes()) : Base64.decodeBase64(col.substring(0, idx).getBytes()));
       Text cq = idx < 0 ? null : new Text(Base64.decodeBase64(col.substring(idx + 1).getBytes()));
@@ -828,14 +1215,14 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
     }
     return columns;
   }
-  
+
   /**
    * @deprecated Use {@link #getAutoAdjustRanges(Configuration)} instead
    */
   protected static boolean getAutoAdjustRanges(JobContext job) {
     return getAutoAdjustRanges(job.getConfiguration());
   }
-  
+
   /**
    * Determines whether a configuration has auto-adjust ranges enabled.
    * 
@@ -845,16 +1232,28 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #disableAutoAdjustRanges(Configuration)
    */
   protected static boolean getAutoAdjustRanges(Configuration conf) {
-    return conf.getBoolean(AUTO_ADJUST_RANGES, true);
+    return getAutoAdjustRanges(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Determines whether a configuration has auto-adjust ranges enabled.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return true if auto-adjust is enabled, false otherwise
+   * @see #disableAutoAdjustRanges(Configuration)
+   */
+  protected static boolean getAutoAdjustRanges(Configuration conf, int sequence) {
+    return conf.getBoolean(merge(AUTO_ADJUST_RANGES, sequence), true);
+  }
+
   /**
    * @deprecated Use {@link #getLogLevel(Configuration)} instead
    */
   protected static Level getLogLevel(JobContext job) {
     return getLogLevel(job.getConfiguration());
   }
-  
+
   /**
    * Gets the log level from this configuration.
    * 
@@ -864,9 +1263,21 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setLogLevel(Configuration, Level)
    */
   protected static Level getLogLevel(Configuration conf) {
-    return Level.toLevel(conf.getInt(LOGLEVEL, Level.INFO.toInt()));
+    return getLogLevel(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Gets the log level from this configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return the log level
+   * @see #setLogLevel(Configuration, Level)
+   */
+  protected static Level getLogLevel(Configuration conf, int sequence) {
+    return Level.toLevel(conf.getInt(merge(LOGLEVEL, sequence), Level.INFO.toInt()));
+  }
+
   // InputFormat doesn't have the equivalent of OutputFormat's
   // checkOutputSpecs(JobContext job)
   /**
@@ -875,7 +1286,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
   protected static void validateOptions(JobContext job) throws IOException {
     validateOptions(job.getConfiguration());
   }
-  
+
   // InputFormat doesn't have the equivalent of OutputFormat's
   // checkOutputSpecs(JobContext job)
   /**
@@ -887,40 +1298,54 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    *           if the configuration is improperly configured
    */
   protected static void validateOptions(Configuration conf) throws IOException {
-    if (!conf.getBoolean(INPUT_INFO_HAS_BEEN_SET, false))
-      throw new IOException("Input info has not been set.");
-    if (!conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
-      throw new IOException("Instance info has not been set.");
+    validateOptions(conf, DEFAULT_SEQUENCE);
+  }
+
+  // InputFormat doesn't have the equivalent of OutputFormat's
+  // checkOutputSpecs(JobContext job)
+  /**
+   * Check whether a configuration is fully configured to be used with an Accumulo {@link org.apache.hadoop.mapreduce.InputFormat}.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @throws IOException
+   *           if the configuration is improperly configured
+   */
+  protected static void validateOptions(Configuration conf, int sequence) throws IOException {
+    if (!conf.getBoolean(merge(INPUT_INFO_HAS_BEEN_SET, sequence), false))
+      throw new IOException("Input info for sequence " + sequence + " has not been set.");
+    if (!conf.getBoolean(merge(INSTANCE_HAS_BEEN_SET, sequence), false))
+      throw new IOException("Instance info for sequence " + sequence + " has not been set.");
     // validate that we can connect as configured
     try {
-      Connector c = getInstance(conf).getConnector(getUsername(conf), getPassword(conf));
-      if (!c.securityOperations().authenticateUser(getUsername(conf), getPassword(conf)))
+      Connector c = getInstance(conf, sequence).getConnector(getUsername(conf, sequence), getPassword(conf, sequence));
+      if (!c.securityOperations().authenticateUser(getUsername(conf, sequence), getPassword(conf, sequence)))
         throw new IOException("Unable to authenticate user");
-      if (!c.securityOperations().hasTablePermission(getUsername(conf), getTablename(conf), TablePermission.READ))
+      if (!c.securityOperations().hasTablePermission(getUsername(conf, sequence), getTablename(conf, sequence), TablePermission.READ))
         throw new IOException("Unable to access table");
-      
-      if (!usesLocalIterators(conf)) {
+
+      if (!usesLocalIterators(conf, sequence)) {
         // validate that any scan-time iterators can be loaded by the the tablet servers
-        for (AccumuloIterator iter : getIterators(conf)) {
+        for (AccumuloIterator iter : getIterators(conf, sequence)) {
           if (!c.instanceOperations().testClassLoad(iter.getIteratorClass(), SortedKeyValueIterator.class.getName()))
             throw new AccumuloException("Servers are unable to load " + iter.getIteratorClass() + " as a " + SortedKeyValueIterator.class.getName());
         }
       }
-      
+
     } catch (AccumuloException e) {
       throw new IOException(e);
     } catch (AccumuloSecurityException e) {
       throw new IOException(e);
     }
   }
-  
+
   /**
    * @deprecated Use {@link #getMaxVersions(Configuration)} instead
    */
   protected static int getMaxVersions(JobContext job) {
     return getMaxVersions(job.getConfiguration());
   }
-  
+
   /**
    * Gets the maxVersions to use for the {@link VersioningIterator} from this configuration.
    * 
@@ -930,11 +1355,27 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #setMaxVersions(Configuration, int)
    */
   protected static int getMaxVersions(Configuration conf) {
-    return conf.getInt(MAX_VERSIONS, -1);
+    return getMaxVersions(conf, DEFAULT_SEQUENCE);
   }
-  
+
+  /**
+   * Gets the maxVersions to use for the {@link VersioningIterator} from this configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return the max versions, -1 if not configured
+   * @see #setMaxVersions(Configuration, int)
+   */
+  protected static int getMaxVersions(Configuration conf, int sequence) {
+    return conf.getInt(merge(MAX_VERSIONS, sequence), -1);
+  }
+
   protected static boolean isOfflineScan(Configuration conf) {
-    return conf.getBoolean(READ_OFFLINE, false);
+    return isOfflineScan(conf, DEFAULT_SEQUENCE);
+  }
+
+  protected static boolean isOfflineScan(Configuration conf, int sequence) {
+    return conf.getBoolean(merge(READ_OFFLINE, sequence), false);
   }
 
   // Return a list of the iterator settings (for iterators to apply to a scanner)
@@ -945,7 +1386,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
   protected static List<AccumuloIterator> getIterators(JobContext job) {
     return getIterators(job.getConfiguration());
   }
-  
+
   /**
    * Gets a list of the iterator settings (for iterators to apply to a scanner) from this configuration.
    * 
@@ -955,15 +1396,27 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #addIterator(Configuration, IteratorSetting)
    */
   protected static List<AccumuloIterator> getIterators(Configuration conf) {
-    
-    String iterators = conf.get(ITERATORS);
-    
+    return getIterators(conf, DEFAULT_SEQUENCE);
+  }
+
+  /**
+   * Gets a list of the iterator settings (for iterators to apply to a scanner) from this configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return a list of iterators
+   * @see #addIterator(Configuration, IteratorSetting)
+   */
+  protected static List<AccumuloIterator> getIterators(Configuration conf, int sequence) {
+
+    String iterators = conf.get(merge(ITERATORS, sequence));
+
     // If no iterators are present, return an empty list
     if (iterators == null || iterators.isEmpty())
       return new ArrayList<AccumuloIterator>();
-    
+
     // Compose the set of iterators encoded in the job configuration
-    StringTokenizer tokens = new StringTokenizer(conf.get(ITERATORS), ITERATORS_DELIM);
+    StringTokenizer tokens = new StringTokenizer(conf.get(merge(ITERATORS, sequence)), ITERATORS_DELIM);
     List<AccumuloIterator> list = new ArrayList<AccumuloIterator>();
     while (tokens.hasMoreTokens()) {
       String itstring = tokens.nextToken();
@@ -971,14 +1424,14 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
     }
     return list;
   }
-  
+
   /**
    * @deprecated Use {@link #getIteratorOptions(Configuration)} instead
    */
   protected static List<AccumuloIteratorOption> getIteratorOptions(JobContext job) {
     return getIteratorOptions(job.getConfiguration());
   }
-  
+
   /**
    * Gets a list of the iterator options specified on this configuration.
    * 
@@ -988,14 +1441,26 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
    * @see #addIterator(Configuration, IteratorSetting)
    */
   protected static List<AccumuloIteratorOption> getIteratorOptions(Configuration conf) {
-    String iteratorOptions = conf.get(ITERATORS_OPTIONS);
-    
+    return getIteratorOptions(conf, DEFAULT_SEQUENCE);
+  }
+
+  /**
+   * Gets a list of the iterator options specified on this configuration.
+   * 
+   * @param conf
+   *          the Hadoop configuration object
+   * @return a list of iterator options
+   * @see #addIterator(Configuration, IteratorSetting)
+   */
+  protected static List<AccumuloIteratorOption> getIteratorOptions(Configuration conf, int sequence) {
+    String iteratorOptions = conf.get(merge(ITERATORS_OPTIONS, sequence));
+
     // If no options are present, return an empty list
     if (iteratorOptions == null || iteratorOptions.isEmpty())
       return new ArrayList<AccumuloIteratorOption>();
-    
+
     // Compose the set of options encoded in the job configuration
-    StringTokenizer tokens = new StringTokenizer(conf.get(ITERATORS_OPTIONS), ITERATORS_DELIM);
+    StringTokenizer tokens = new StringTokenizer(conf.get(merge(ITERATORS_OPTIONS, sequence)), ITERATORS_DELIM);
     List<AccumuloIteratorOption> list = new ArrayList<AccumuloIteratorOption>();
     while (tokens.hasMoreTokens()) {
       String optionString = tokens.nextToken();
@@ -1003,13 +1468,14 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
     }
     return list;
   }
-  
+
   protected abstract static class RecordReaderBase<K,V> extends RecordReader<K,V> {
     protected long numKeysRead;
     protected Iterator<Entry<Key,Value>> scannerIterator;
     private boolean scannerRegexEnabled = false;
     protected RangeInputSplit split;
-    
+    protected int sequence;
+
     /**
      * @deprecated since 1.4, configure {@link org.apache.accumulo.core.iterators.user.RegExFilter} instead.
      */
@@ -1024,7 +1490,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         log.info("Setting " + methodName + " to " + regex);
       }
     }
-    
+
     /**
      * @deprecated since 1.4, configure {@link org.apache.accumulo.core.iterators.user.RegExFilter} instead.
      */
@@ -1039,15 +1505,15 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         throw new AccumuloException("Can't set up regex for scanner");
       }
     }
-    
+
     // Apply the configured iterators from the job to the scanner
     /**
      * @deprecated Use {@link #setupIterators(Configuration,Scanner)} instead
      */
     protected void setupIterators(TaskAttemptContext attempt, Scanner scanner) throws AccumuloException {
-      setupIterators(attempt.getConfiguration(), scanner);
+      setupIterators(attempt.getConfiguration(), DEFAULT_SEQUENCE, scanner);
     }
-    
+
     /**
      * Apply the configured iterators from the configuration to the scanner.
      * 
@@ -1057,10 +1523,10 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
      *          the scanner to configure
      * @throws AccumuloException
      */
-    protected void setupIterators(Configuration conf, Scanner scanner) throws AccumuloException {
-      List<AccumuloIterator> iterators = getIterators(conf);
-      List<AccumuloIteratorOption> options = getIteratorOptions(conf);
-      
+    protected void setupIterators(Configuration conf, int sequence, Scanner scanner) throws AccumuloException {
+      List<AccumuloIterator> iterators = getIterators(conf, sequence);
+      List<AccumuloIteratorOption> options = getIteratorOptions(conf, sequence);
+
       Map<String,IteratorSetting> scanIterators = new HashMap<String,IteratorSetting>();
       for (AccumuloIterator iterator : iterators) {
         scanIterators.put(iterator.getIteratorName(), new IteratorSetting(iterator.getPriority(), iterator.getIteratorName(), iterator.getIteratorClass()));
@@ -1072,14 +1538,14 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         scanner.addScanIterator(scanIterators.get(iterator.getIteratorName()));
       }
     }
-    
+
     /**
      * @deprecated Use {@link #setupMaxVersions(Configuration,Scanner)} instead
      */
     protected void setupMaxVersions(TaskAttemptContext attempt, Scanner scanner) {
-      setupMaxVersions(attempt.getConfiguration(), scanner);
+      setupMaxVersions(attempt.getConfiguration(), DEFAULT_SEQUENCE, scanner);
     }
-    
+
     /**
      * If maxVersions has been set, configure a {@link VersioningIterator} at priority 0 for this scanner.
      * 
@@ -1088,8 +1554,8 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
      * @param scanner
      *          the scanner to configure
      */
-    protected void setupMaxVersions(Configuration conf, Scanner scanner) {
-      int maxVersions = getMaxVersions(conf);
+    protected void setupMaxVersions(Configuration conf, int sequence, Scanner scanner) {
+      int maxVersions = getMaxVersions(conf, sequence);
       // Check to make sure its a legit value
       if (maxVersions >= 1) {
         IteratorSetting vers = new IteratorSetting(0, "vers", VersioningIterator.class);
@@ -1097,54 +1563,57 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         scanner.addScanIterator(vers);
       }
     }
-    
+
     /**
      * Initialize a scanner over the given input split using this task attempt configuration.
      */
     public void initialize(InputSplit inSplit, TaskAttemptContext attempt) throws IOException {
       Scanner scanner;
       split = (RangeInputSplit) inSplit;
+      sequence = split.getSequence();
       log.debug("Initializing input split: " + split.range);
       Configuration conf = attempt.getConfiguration();
-      Instance instance = getInstance(conf);
-      String user = getUsername(conf);
-      byte[] password = getPassword(conf);
-      Authorizations authorizations = getAuthorizations(conf);
-      
+      Instance instance = getInstance(conf, sequence);
+      String user = getUsername(conf, sequence);
+      byte[] password = getPassword(conf, sequence);
+      Authorizations authorizations = getAuthorizations(conf, sequence);
+
       try {
         log.debug("Creating connector with user: " + user);
         Connector conn = instance.getConnector(user, password);
-        log.debug("Creating scanner for table: " + getTablename(conf));
+        log.debug("Creating scanner for table: " + getTablename(conf, sequence));
         log.debug("Authorizations are: " + authorizations);
-        if (isOfflineScan(conf)) {
+        if (isOfflineScan(conf, sequence)) {
           scanner = new OfflineScanner(instance, new AuthInfo(user, ByteBuffer.wrap(password), instance.getInstanceID()), Tables.getTableId(instance,
-              getTablename(conf)), authorizations);
+              getTablename(conf, sequence)), authorizations);
         } else {
-          scanner = conn.createScanner(getTablename(conf), authorizations);
+          scanner = conn.createScanner(getTablename(conf, sequence), authorizations);
         }
-        if (isIsolated(conf)) {
+        if (isIsolated(conf, sequence)) {
           log.info("Creating isolated scanner");
           scanner = new IsolatedScanner(scanner);
         }
-        if (usesLocalIterators(conf)) {
+        if (usesLocalIterators(conf, sequence)) {
           log.info("Using local iterators");
           scanner = new ClientSideIteratorScanner(scanner);
         }
-        setupMaxVersions(conf, scanner);
-        if (conf.get(ROW_REGEX) != null || conf.get(COLUMN_FAMILY_REGEX) != null || conf.get(COLUMN_QUALIFIER_REGEX) != null ||
-            conf.get(VALUE_REGEX) != null) {
+        setupMaxVersions(conf, sequence, scanner);
+
+        final String rowRegex = conf.get(merge(ROW_REGEX, sequence)), colfRegex = conf.get(merge(COLUMN_FAMILY_REGEX, sequence)), colqRegex = conf.get(merge(
+            COLUMN_QUALIFIER_REGEX, sequence)), valueRegex = conf.get(merge(VALUE_REGEX, sequence));
+
+        if (rowRegex != null || colfRegex != null || colqRegex != null || valueRegex != null) {
           IteratorSetting is = new IteratorSetting(50, RegExFilter.class);
-          RegExFilter.setRegexs(is, conf.get(ROW_REGEX), conf.get(COLUMN_FAMILY_REGEX), conf.get(COLUMN_QUALIFIER_REGEX),
-            conf.get(VALUE_REGEX), false);
+          RegExFilter.setRegexs(is, rowRegex, colfRegex, colqRegex, valueRegex, false);
           scanner.addScanIterator(is);
         }
-        setupIterators(conf, scanner);
+        setupIterators(conf, sequence, scanner);
       } catch (Exception e) {
         throw new IOException(e);
       }
-      
+
       // setup a scanner within the bounds of this split
-      for (Pair<Text,Text> c : getFetchedColumns(conf)) {
+      for (Pair<Text,Text> c : getFetchedColumns(conf, sequence)) {
         if (c.getSecond() != null) {
           log.debug("Fetching column " + c.getFirst() + ":" + c.getSecond());
           scanner.fetchColumn(c.getFirst(), c.getSecond());
@@ -1153,48 +1622,49 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
           scanner.fetchColumnFamily(c.getFirst());
         }
       }
-      
+
       scanner.setRange(split.range);
-      
+
       numKeysRead = 0;
-      
+
       // do this last after setting all scanner options
       scannerIterator = scanner.iterator();
     }
-    
+
     public void close() {}
-    
+
     public float getProgress() throws IOException {
       if (numKeysRead > 0 && currentKey == null)
         return 1.0f;
       return split.getProgress(currentKey);
     }
-    
+
     protected K currentK = null;
     protected V currentV = null;
     protected Key currentKey = null;
     protected Value currentValue = null;
-    
+
     @Override
     public K getCurrentKey() throws IOException, InterruptedException {
       return currentK;
     }
-    
+
     @Override
     public V getCurrentValue() throws IOException, InterruptedException {
       return currentV;
     }
   }
-  
-  Map<String,Map<KeyExtent,List<Range>>> binOfflineTable(JobContext job, String tableName, List<Range> ranges) throws TableNotFoundException,
+
+  Map<String,Map<KeyExtent,List<Range>>> binOfflineTable(JobContext job, int sequence, String tableName, List<Range> ranges) throws TableNotFoundException,
       AccumuloException, AccumuloSecurityException {
-    
+
     Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<String,Map<KeyExtent,List<Range>>>();
+    Configuration conf = job.getConfiguration();
 
-    Instance instance = getInstance(job.getConfiguration());
-    Connector conn = instance.getConnector(getUsername(job.getConfiguration()), getPassword(job.getConfiguration()));
+    Instance instance = getInstance(conf, sequence);
+    Connector conn = instance.getConnector(getUsername(conf, sequence), getPassword(conf, sequence));
     String tableId = Tables.getTableId(instance, tableName);
-    
+
     if (Tables.getTableState(instance, tableId) != TableState.OFFLINE) {
       Tables.clearCache(instance);
       if (Tables.getTableState(instance, tableId) != TableState.OFFLINE) {
@@ -1204,12 +1674,12 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
 
     for (Range range : ranges) {
       Text startRow;
-      
+
       if (range.getStartKey() != null)
         startRow = range.getStartKey().getRow();
       else
         startRow = new Text();
-      
+
       Range metadataRange = new Range(new KeyExtent(new Text(tableId), startRow, null).getMetadataEntry(), true, null, false);
       Scanner scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
       ColumnFQ.fetch(scanner, Constants.METADATA_PREV_ROW_COLUMN);
@@ -1217,9 +1687,9 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);
       scanner.fetchColumnFamily(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY);
       scanner.setRange(metadataRange);
-      
+
       RowIterator rowIter = new RowIterator(scanner);
-      
+
       // TODO check that extents match prev extent
 
       KeyExtent lastExtent = null;
@@ -1229,15 +1699,15 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         String last = "";
         KeyExtent extent = null;
         String location = null;
-        
+
         while (row.hasNext()) {
           Entry<Key,Value> entry = row.next();
           Key key = entry.getKey();
-          
+
           if (key.getColumnFamily().equals(Constants.METADATA_LAST_LOCATION_COLUMN_FAMILY)) {
             last = entry.getValue().toString();
           }
-          
+
           if (key.getColumnFamily().equals(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY)
               || key.getColumnFamily().equals(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY)) {
             location = entry.getValue().toString();
@@ -1246,9 +1716,9 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
           if (Constants.METADATA_PREV_ROW_COLUMN.hasColumns(key)) {
             extent = new KeyExtent(key.getRow(), entry.getValue());
           }
-          
+
         }
-        
+
         if (location != null)
           return null;
 
@@ -1265,58 +1735,74 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
           tabletRanges = new HashMap<KeyExtent,List<Range>>();
           binnedRanges.put(last, tabletRanges);
         }
-        
+
         List<Range> rangeList = tabletRanges.get(extent);
         if (rangeList == null) {
           rangeList = new ArrayList<Range>();
           tabletRanges.put(extent, rangeList);
         }
-        
+
         rangeList.add(range);
 
         if (extent.getEndRow() == null || range.afterEndKey(new Key(extent.getEndRow()).followingKey(PartialKey.ROW))) {
           break;
         }
-        
+
         lastExtent = extent;
       }
 
     }
-    
+
     return binnedRanges;
   }
 
   /**
    * Read the metadata table to get tablets and match up ranges to them.
    */
+  @Override
   public List<InputSplit> getSplits(JobContext job) throws IOException {
-    log.setLevel(getLogLevel(job.getConfiguration()));
-    validateOptions(job.getConfiguration());
-    
-    String tableName = getTablename(job.getConfiguration());
-    boolean autoAdjust = getAutoAdjustRanges(job.getConfiguration());
-    List<Range> ranges = autoAdjust ? Range.mergeOverlapping(getRanges(job.getConfiguration())) : getRanges(job.getConfiguration());
-    
+    final Configuration conf = job.getConfiguration();
+    final int sequence;
+    if (0 == NUM_CONFIGURATIONS_LOADED.get()) {
+      sequence = DEFAULT_SEQUENCE;
+      
+      log.debug("No sequence numbers were given, falling back to the default sequence number");
+    } else {
+      sequence = NUM_CONFIGURATIONS_PROCESSED.incrementAndGet();
+      
+      if (sequence > NUM_CONFIGURATIONS_LOADED.get()) {
+        log.warn("Attempting to load AccumuloInputFormat information from Configuration using a sequence number that wasn't assigned");
+      }
+    }
+
+
+    log.setLevel(getLogLevel(conf, sequence));
+    validateOptions(conf, sequence);
+
+    String tableName = getTablename(conf, sequence);
+    boolean autoAdjust = getAutoAdjustRanges(conf, sequence);
+    List<Range> ranges = autoAdjust ? Range.mergeOverlapping(getRanges(conf, sequence)) : getRanges(conf, sequence);
+
     if (ranges.isEmpty()) {
       ranges = new ArrayList<Range>(1);
       ranges.add(new Range());
     }
-    
+
     // get the metadata information for these ranges
     Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<String,Map<KeyExtent,List<Range>>>();
     TabletLocator tl;
     try {
-      if (isOfflineScan(job.getConfiguration())) {
-        binnedRanges = binOfflineTable(job, tableName, ranges);
+      if (isOfflineScan(conf, sequence)) {
+        binnedRanges = binOfflineTable(job, sequence, tableName, ranges);
         while (binnedRanges == null) {
           // Some tablets were still online, try again
           UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
-          binnedRanges = binOfflineTable(job, tableName, ranges);
+          binnedRanges = binOfflineTable(job, sequence, tableName, ranges);
         }
       } else {
-        Instance instance = getInstance(job.getConfiguration());
+        Instance instance = getInstance(conf, sequence);
         String tableId = null;
-        tl = getTabletLocator(job.getConfiguration());
+        tl = getTabletLocator(conf, sequence);
         // its possible that the cache could contain complete, but old information about a tables tablets... so clear it
         tl.invalidateCache();
         while (!tl.binRanges(ranges, binnedRanges).isEmpty()) {
@@ -1337,15 +1823,15 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
     } catch (Exception e) {
       throw new IOException(e);
     }
-    
+
     ArrayList<InputSplit> splits = new ArrayList<InputSplit>(ranges.size());
     HashMap<Range,ArrayList<String>> splitsToAdd = null;
-    
+
     if (!autoAdjust)
       splitsToAdd = new HashMap<Range,ArrayList<String>>();
-    
+
     HashMap<String,String> hostNameCache = new HashMap<String,String>();
-    
+
     for (Entry<String,Map<KeyExtent,List<Range>>> tserverBin : binnedRanges.entrySet()) {
       String ip = tserverBin.getKey().split(":", 2)[0];
       String location = hostNameCache.get(ip);
@@ -1354,14 +1840,14 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         location = inetAddress.getHostName();
         hostNameCache.put(ip, location);
       }
-      
+
       for (Entry<KeyExtent,List<Range>> extentRanges : tserverBin.getValue().entrySet()) {
         Range ke = extentRanges.getKey().toDataRange();
         for (Range r : extentRanges.getValue()) {
           if (autoAdjust) {
             // divide ranges into smaller ranges, based on the
             // tablets
-            splits.add(new RangeInputSplit(tableName, ke.clip(r), new String[] {location}));
+            splits.add(new RangeInputSplit(tableName, ke.clip(r), new String[] {location}, sequence));
           } else {
             // don't divide ranges
             ArrayList<String> locations = splitsToAdd.get(r);
@@ -1373,29 +1859,34 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         }
       }
     }
-    
+
     if (!autoAdjust)
       for (Entry<Range,ArrayList<String>> entry : splitsToAdd.entrySet())
-        splits.add(new RangeInputSplit(tableName, entry.getKey(), entry.getValue().toArray(new String[0])));
+        splits.add(new RangeInputSplit(tableName, entry.getKey(), entry.getValue().toArray(new String[0]), sequence));
     return splits;
   }
-  
+
   /**
    * The Class RangeInputSplit. Encapsulates an Accumulo range for use in Map Reduce jobs.
    */
   public static class RangeInputSplit extends InputSplit implements Writable {
     private Range range;
     private String[] locations;
-    
+    private int sequence;
+
     public RangeInputSplit() {
       range = new Range();
       locations = new String[0];
     }
-    
+
     public Range getRange() {
       return range;
     }
-    
+
+    public int getSequence() {
+      return sequence;
+    }
+
     private static byte[] extractBytes(ByteSequence seq, int numBytes) {
       byte[] bytes = new byte[numBytes + 1];
       bytes[0] = 0;
@@ -1407,7 +1898,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       }
       return bytes;
     }
-    
+
     public static float getProgress(ByteSequence start, ByteSequence end, ByteSequence position) {
       int maxDepth = Math.min(Math.max(end.length(), start.length()), position.length());
       BigInteger startBI = new BigInteger(extractBytes(start, maxDepth));
@@ -1415,7 +1906,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       BigInteger positionBI = new BigInteger(extractBytes(position, maxDepth));
       return (float) (positionBI.subtract(startBI).doubleValue() / endBI.subtract(startBI).doubleValue());
     }
-    
+
     public float getProgress(Key currentKey) {
       if (currentKey == null)
         return 0f;
@@ -1434,12 +1925,17 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       // if we can't figure it out, then claim no progress
       return 0f;
     }
-    
+
     RangeInputSplit(String table, Range range, String[] locations) {
+      this(table, range, locations, DEFAULT_SEQUENCE);
+    }
+
+    RangeInputSplit(String table, Range range, String[] locations, int sequence) {
       this.range = range;
       this.locations = locations;
+      this.sequence = sequence;
     }
-    
+
     /**
      * This implementation of length is only an estimate, it does not provide exact values. Do not have your code rely on this return value.
      */
@@ -1448,57 +1944,59 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       Text stopRow = range.isInfiniteStopKey() ? new Text(new byte[] {Byte.MAX_VALUE}) : range.getEndKey().getRow();
       int maxCommon = Math.min(7, Math.min(startRow.getLength(), stopRow.getLength()));
       long diff = 0;
-      
+
       byte[] start = startRow.getBytes();
       byte[] stop = stopRow.getBytes();
       for (int i = 0; i < maxCommon; ++i) {
         diff |= 0xff & (start[i] ^ stop[i]);
         diff <<= Byte.SIZE;
       }
-      
+
       if (startRow.getLength() != stopRow.getLength())
         diff |= 0xff;
-      
+
       return diff + 1;
     }
-    
+
     public String[] getLocations() throws IOException {
       return locations;
     }
-    
+
     public void readFields(DataInput in) throws IOException {
       range.readFields(in);
+      sequence = in.readInt();
       int numLocs = in.readInt();
       locations = new String[numLocs];
       for (int i = 0; i < numLocs; ++i)
         locations[i] = in.readUTF();
     }
-    
+
     public void write(DataOutput out) throws IOException {
       range.write(out);
+      out.writeInt(sequence);
       out.writeInt(locations.length);
       for (int i = 0; i < locations.length; ++i)
         out.writeUTF(locations[i]);
     }
   }
-  
+
   /**
    * The Class IteratorSetting. Encapsulates specifics for an Accumulo iterator's name & priority.
    */
   static class AccumuloIterator {
-    
+
     private static final String FIELD_SEP = ":";
-    
+
     private int priority;
     private String iteratorClass;
     private String iteratorName;
-    
+
     public AccumuloIterator(int priority, String iteratorClass, String iteratorName) {
       this.priority = priority;
       this.iteratorClass = iteratorClass;
       this.iteratorName = iteratorName;
     }
-    
+
     // Parses out a setting given an string supplied from an earlier toString() call
     public AccumuloIterator(String iteratorSetting) {
       // Parse the string to expand the iterator
@@ -1507,42 +2005,42 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
       iteratorClass = tokenizer.nextToken();
       iteratorName = tokenizer.nextToken();
     }
-    
+
     public int getPriority() {
       return priority;
     }
-    
+
     public String getIteratorClass() {
       return iteratorClass;
     }
-    
+
     public String getIteratorName() {
       return iteratorName;
     }
-    
+
     @Override
     public String toString() {
       return new String(priority + FIELD_SEP + iteratorClass + FIELD_SEP + iteratorName);
     }
-    
+
   }
-  
+
   /**
    * The Class AccumuloIteratorOption. Encapsulates specifics for an Accumulo iterator's optional configuration details - associated via the iteratorName.
    */
   static class AccumuloIteratorOption {
     private static final String FIELD_SEP = ":";
-    
+
     private String iteratorName;
     private String key;
     private String value;
-    
+
     public AccumuloIteratorOption(String iteratorName, String key, String value) {
       this.iteratorName = iteratorName;
       this.key = key;
       this.value = value;
     }
-    
+
     // Parses out an option given a string supplied from an earlier toString() call
     public AccumuloIteratorOption(String iteratorOption) {
       StringTokenizer tokenizer = new StringTokenizer(iteratorOption, FIELD_SEP);
@@ -1554,19 +2052,19 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         throw new RuntimeException(e);
       }
     }
-    
+
     public String getIteratorName() {
       return iteratorName;
     }
-    
+
     public String getKey() {
       return key;
     }
-    
+
     public String getValue() {
       return value;
     }
-    
+
     @Override
     public String toString() {
       try {
@@ -1575,7 +2073,7 @@ public abstract class InputFormatBase<K,V> extends InputFormat<K,V> {
         throw new RuntimeException(e);
       }
     }
-    
+
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/921617d4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
----------------------------------------------------------------------
diff --git a/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java b/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
index ba647e9..0df1f52 100644
--- a/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
+++ b/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
@@ -48,10 +48,17 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext;
 import org.apache.hadoop.mapreduce.TaskAttemptID;
 import org.junit.After;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
 
 public class AccumuloInputFormatTest {
   
+  @Before
+  public void setup() {
+    AccumuloInputFormat.resetCounters();
+    AccumuloOutputFormat.resetCounters();
+  }
+  
   @After
   public void tearDown() throws Exception {}
   
@@ -100,7 +107,7 @@ public class AccumuloInputFormatTest {
     
     AccumuloInputFormat.setIterator(job, 1, "org.apache.accumulo.core.iterators.WholeRowIterator", "WholeRow");
     Configuration conf = job.getConfiguration();
-    String iterators = conf.get("AccumuloInputFormat.iterators");
+    String iterators = conf.get("AccumuloInputFormat.iterators." + InputFormatBase.DEFAULT_SEQUENCE);
     assertEquals("1:org.apache.accumulo.core.iterators.WholeRowIterator:WholeRow", iterators);
   }
   
@@ -163,7 +170,7 @@ public class AccumuloInputFormatTest {
     
     final String rawConfigOpt = new AccumuloIteratorOption("iterator", key, value).toString();
     
-    assertEquals(rawConfigOpt, job.getConfiguration().get("AccumuloInputFormat.iterators.options"));
+    assertEquals(rawConfigOpt, job.getConfiguration().get("AccumuloInputFormat.iterators.options." + InputFormatBase.DEFAULT_SEQUENCE));
     
     List<AccumuloIteratorOption> opts = AccumuloInputFormat.getIteratorOptions(job.getConfiguration());
     assertEquals(1, opts.size());
@@ -197,7 +204,7 @@ public class AccumuloInputFormatTest {
     List<AccumuloIterator> list = AccumuloInputFormat.getIterators(job);
     
     // Check the list size
-    assertTrue(list.size() == 3);
+    assertEquals(3, list.size());
     
     // Walk the list and make sure our settings are correct
     AccumuloIterator setting = list.get(0);
@@ -227,7 +234,7 @@ public class AccumuloInputFormatTest {
     AccumuloInputFormat.setIteratorOption(job, "someIterator", "aKey", "aValue");
     
     Configuration conf = job.getConfiguration();
-    String options = conf.get("AccumuloInputFormat.iterators.options");
+    String options = conf.get("AccumuloInputFormat.iterators.options." + InputFormatBase.DEFAULT_SEQUENCE);
     assertEquals(new String("someIterator:aKey:aValue"), options);
   }
   
@@ -386,4 +393,36 @@ public class AccumuloInputFormatTest {
       Assert.assertTrue( p.matcher( rr.getCurrentKey().getRow().toString()).matches());
     }
   }
+  
+  @Test
+  public void testMultipleConfigurations() throws Exception {
+    Configuration conf = new Configuration();
+    int seq1 = AccumuloInputFormat.nextSequence(), seq2 = AccumuloInputFormat.nextSequence();
+    
+    AccumuloInputFormat.setZooKeeperInstance(conf, seq1, "instance1", "zookeeper1");
+    AccumuloInputFormat.setInputInfo(conf, seq1, "user1", "password1".getBytes(), "table1", new Authorizations("1"));
+    
+    AccumuloInputFormat.setZooKeeperInstance(conf, seq2, "instance2", "zookeeper2");
+    AccumuloInputFormat.setInputInfo(conf, seq2, "user2", "password2".getBytes(), "table2", new Authorizations("2"));
+
+    String instance1 = conf.get(AccumuloInputFormat.class.getSimpleName() + ".instanceName." + seq1), 
+        zookeeper1 = conf.get(AccumuloInputFormat.class.getSimpleName() + ".zooKeepers." + seq1);
+    
+    assertEquals("instance1", instance1);
+    assertEquals("zookeeper1", zookeeper1);
+    assertEquals("user1", AccumuloInputFormat.getUsername(conf, seq1));
+    assertEquals("password1", new String(AccumuloInputFormat.getPassword(conf, seq1)));
+    assertEquals("table1", AccumuloInputFormat.getTablename(conf, seq1));
+    assertEquals(new Authorizations("1"), AccumuloInputFormat.getAuthorizations(conf, seq1));
+
+    String instance2 = conf.get(AccumuloInputFormat.class.getSimpleName() + ".instanceName." + seq2), 
+        zookeeper2 = conf.get(AccumuloInputFormat.class.getSimpleName() + ".zooKeepers." + seq2);
+    
+    assertEquals("instance2", instance2);
+    assertEquals("zookeeper2", zookeeper2);
+    assertEquals("user2", AccumuloInputFormat.getUsername(conf, seq2));
+    assertEquals("password2", new String(AccumuloInputFormat.getPassword(conf, seq2)));
+    assertEquals("table2", AccumuloInputFormat.getTablename(conf, seq2));
+    assertEquals(new Authorizations("2"), AccumuloInputFormat.getAuthorizations(conf, seq2));
+  }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/921617d4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
----------------------------------------------------------------------
diff --git a/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java b/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
index 8bc2b45..ef48cc4 100644
--- a/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
+++ b/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
@@ -27,6 +27,7 @@ import java.util.Map.Entry;
 
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.mock.MockInstance;
 import org.apache.accumulo.core.data.Key;
@@ -42,6 +43,7 @@ import org.apache.hadoop.mapreduce.RecordReader;
 import org.apache.hadoop.mapreduce.RecordWriter;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
 import org.apache.hadoop.mapreduce.TaskAttemptID;
+import org.junit.Before;
 import org.junit.Test;
 
 /**
@@ -73,6 +75,12 @@ public class AccumuloOutputFormatTest {
     }
   }
   
+  @Before
+  public void setup() {
+    AccumuloInputFormat.resetCounters();
+    AccumuloOutputFormat.resetCounters();
+  }
+  
   @Test
   public void testMR() throws Exception {
     MockInstance mockInstance = new MockInstance("testmrinstance");
@@ -125,4 +133,35 @@ public class AccumuloOutputFormatTest {
     assertEquals(Integer.parseInt(new String(entry.getValue().get())), 100);
     assertFalse(iter.hasNext());
   }
+  
+  @Test
+  public void testMultiInstanceConfiguration() throws Exception {
+    MockInstance mockInstance1 = new MockInstance("testinstance1"), mockInstance2 = new MockInstance("testinstance2");
+    
+    int seq1 = AccumuloOutputFormat.nextSequence(), seq2 = AccumuloOutputFormat.nextSequence();
+    
+    Configuration conf = new Configuration();
+    AccumuloOutputFormat.setOutputInfo(conf, seq1, "root1", "1".getBytes(), false, "testtable1");
+    AccumuloOutputFormat.setMockInstance(conf, seq1, "testinstance1");
+    
+    AccumuloOutputFormat.setOutputInfo(conf, seq2, "root2", "2".getBytes(), true, "testtable2");
+    AccumuloOutputFormat.setMockInstance(conf, seq2, "testinstance2");
+    
+    assertEquals("root1", AccumuloOutputFormat.getUsername(conf, seq1));
+    assertEquals("1", new String(AccumuloOutputFormat.getPassword(conf, seq1)));
+    assertEquals(false, AccumuloOutputFormat.canCreateTables(conf, seq1));
+    assertEquals("testtable1", AccumuloOutputFormat.getDefaultTableName(conf, seq1));
+    
+    Instance inst1 = AccumuloOutputFormat.getInstance(conf, seq1);
+    assertEquals("testinstance1", inst1.getInstanceName());
+    
+    assertEquals("root2", AccumuloOutputFormat.getUsername(conf, seq2));
+    assertEquals("2", new String(AccumuloOutputFormat.getPassword(conf, seq2)));
+    assertEquals(true, AccumuloOutputFormat.canCreateTables(conf, seq2));
+    assertEquals("testtable2", AccumuloOutputFormat.getDefaultTableName(conf, seq2));
+    
+    Instance inst2 = AccumuloOutputFormat.getInstance(conf, seq2);
+    assertEquals("testinstance2", inst2.getInstanceName());
+    
+  }
 }


Mime
View raw message