accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1229162 - in /incubator/accumulo/branches/1.4/src: core/src/main/java/org/apache/accumulo/core/client/mapreduce/ core/src/test/java/org/apache/accumulo/core/client/mapreduce/ examples/src/main/java/org/apache/accumulo/examples/mapreduce/ e...
Date Mon, 09 Jan 2012 14:14:37 GMT
Author: vines
Date: Mon Jan  9 14:14:36 2012
New Revision: 1229162

URL: http://svn.apache.org/viewvc?rev=1229162&view=rev
Log:
Fixes ACCUMULO-267

Also cleaned up import in cloudtrace

Modified:
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
    incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
    incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
    incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java
    incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java
    incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java
    incubator/accumulo/branches/1.4/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkInputFormatTest.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java
    incubator/accumulo/branches/1.4/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java Mon Jan  9 14:14:36 2012
@@ -43,7 +43,7 @@ import org.apache.hadoop.mapreduce.TaskA
 public class AccumuloInputFormat extends InputFormatBase<Key,Value> {
   @Override
   public RecordReader<Key,Value> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException {
-    log.setLevel(getLogLevel(context));
+    log.setLevel(getLogLevel(context.getConfiguration()));
     return new RecordReaderBase<Key,Value>() {
       @Override
       public boolean nextKeyValue() throws IOException, InterruptedException {

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java Mon Jan  9 14:14:36 2012
@@ -143,9 +143,19 @@ public abstract class InputFormatBase<K,
    * 
    * @param job
    * @param enable
+   * @deprecated Use {@link #setIsolated(Configuration,boolean)} instead
    */
   public static void setIsolated(JobContext job, boolean enable) {
-    Configuration conf = job.getConfiguration();
+    setIsolated(job.getConfiguration(), enable);
+  }
+
+  /**
+   * Enable or disable use of the {@link IsolatedScanner}. By default it is not enabled.
+   * 
+   * @param conf
+   * @param enable
+   */
+  public static void setIsolated(Configuration conf, boolean enable) {
     conf.setBoolean(ISOLATED, enable);
   }
   
@@ -154,14 +164,30 @@ public abstract class InputFormatBase<K,
    * 
    * @param job
    * @param enable
+   * @deprecated Use {@link #setLocalIterators(Configuration,boolean)} instead
    */
   public static void setLocalIterators(JobContext job, boolean enable) {
-    Configuration conf = job.getConfiguration();
+    setLocalIterators(job.getConfiguration(), enable);
+  }
+
+  /**
+   * Enable or disable use of the {@link ClientSideIteratorScanner}. By default it is not enabled.
+   * 
+   * @param job
+   * @param enable
+   */
+  public static void setLocalIterators(Configuration conf, boolean enable) {
     conf.setBoolean(LOCAL_ITERATORS, 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) {
-    Configuration conf = job.getConfiguration();
+    setInputInfo(job.getConfiguration(), user, passwd, table, auths);
+  }
+
+  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);
@@ -174,8 +200,14 @@ public abstract class InputFormatBase<K,
       conf.set(AUTHORIZATIONS, auths.serialize());
   }
   
+  /**
+   * @deprecated Use {@link #setZooKeeperInstance(Configuration,String,String)} instead
+   */
   public static void setZooKeeperInstance(JobContext job, String instanceName, String zooKeepers) {
-    Configuration conf = job.getConfiguration();
+    setZooKeeperInstance(job.getConfiguration(), instanceName, zooKeepers);
+  }
+
+  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);
@@ -185,14 +217,27 @@ public abstract class InputFormatBase<K,
     conf.set(ZOOKEEPERS, zooKeepers);
   }
   
+  /**
+   * @deprecated Use {@link #setMockInstance(Configuration,String)} instead
+   */
   public static void setMockInstance(JobContext job, String instanceName) {
-    Configuration conf = job.getConfiguration();
+    setMockInstance(job.getConfiguration(), instanceName);
+  }
+
+  public static void setMockInstance(Configuration conf, String instanceName) {
     conf.setBoolean(INSTANCE_HAS_BEEN_SET, true);
     conf.setBoolean(MOCK, true);
     conf.set(INSTANCE_NAME, instanceName);
   }
   
+  /**
+   * @deprecated Use {@link #setRanges(Configuration,Collection<Range>)} instead
+   */
   public static void setRanges(JobContext job, Collection<Range> ranges) {
+    setRanges(job.getConfiguration(), ranges);
+  }
+
+  public static void setRanges(Configuration conf, Collection<Range> ranges) {
     ArgumentChecker.notNull(ranges);
     ArrayList<String> rangeStrings = new ArrayList<String>(ranges.size());
     try {
@@ -204,11 +249,18 @@ public abstract class InputFormatBase<K,
     } catch (IOException ex) {
       throw new IllegalArgumentException("Unable to encode ranges to Base64", ex);
     }
-    job.getConfiguration().setStrings(RANGES, rangeStrings.toArray(new String[0]));
+    conf.setStrings(RANGES, rangeStrings.toArray(new String[0]));
   }
   
+  /**
+   * @deprecated Use {@link #disableAutoAdjustRanges(Configuration)} instead
+   */
   public static void disableAutoAdjustRanges(JobContext job) {
-    job.getConfiguration().setBoolean(AUTO_ADJUST_RANGES, false);
+    disableAutoAdjustRanges(job.getConfiguration());
+  }
+
+  public static void disableAutoAdjustRanges(Configuration conf) {
+    conf.setBoolean(AUTO_ADJUST_RANGES, false);
   }
   
   public static enum RegexType {
@@ -216,7 +268,7 @@ public abstract class InputFormatBase<K,
   }
   
   /**
-   * @deprecated since 1.4 {@link #addIterator(JobContext, IteratorSetting)}
+   * @deprecated since 1.4 {@link #addIterator(Configuration, IteratorSetting)}
    * @see org.apache.accumulo.core.iterators.user.RegExFilter#setRegexs(IteratorSetting, String, String, String, String, boolean)
    * @param job
    * @param type
@@ -258,11 +310,26 @@ public abstract class InputFormatBase<K,
    * @param maxVersions
    *          the max versions
    * @throws IOException
+   * @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.
+   * 
+   * @param conf
+   *          the job
+   * @param maxVersions
+   *          the max versions
+   * @throws IOException
+   */
+  public static void setMaxVersions(Configuration conf, int maxVersions) throws IOException {
     if (maxVersions < 1)
       throw new IOException("Invalid maxVersions: " + maxVersions + ".  Must be >= 1");
-    job.getConfiguration().setInt(MAX_VERSIONS, maxVersions);
+    conf.setInt(MAX_VERSIONS, maxVersions);
   }
   
   /**
@@ -270,8 +337,19 @@ public abstract class InputFormatBase<K,
    * @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.
+   * @deprecated Use {@link #fetchColumns(Configuration,Collection<Pair<Text, Text>>)} instead
    */
   public static void fetchColumns(JobContext job, Collection<Pair<Text,Text>> columnFamilyColumnQualifierPairs) {
+    fetchColumns(job.getConfiguration(), columnFamilyColumnQualifierPairs);
+  }
+  
+  /**
+   * 
+   * @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, Collection<Pair<Text,Text>> columnFamilyColumnQualifierPairs) {
     ArgumentChecker.notNull(columnFamilyColumnQualifierPairs);
     ArrayList<String> columnStrings = new ArrayList<String>(columnFamilyColumnQualifierPairs.size());
     for (Pair<Text,Text> column : columnFamilyColumnQualifierPairs) {
@@ -283,13 +361,20 @@ public abstract class InputFormatBase<K,
         col += ":" + new String(Base64.encodeBase64(TextUtil.getBytes(column.getSecond())));
       columnStrings.add(col);
     }
-    job.getConfiguration().setStrings(COLUMNS, columnStrings.toArray(new String[0]));
+    conf.setStrings(COLUMNS, columnStrings.toArray(new String[0]));
   }
   
+  /**
+   * @deprecated Use {@link #setLogLevel(Configuration,Level)} instead
+   */
   public static void setLogLevel(JobContext job, Level level) {
+    setLogLevel(job.getConfiguration(), level);
+  }
+  
+  public static void setLogLevel(Configuration conf, Level level) {
     ArgumentChecker.notNull(level);
     log.setLevel(level);
-    job.getConfiguration().setInt(LOGLEVEL, level.toInt());
+    conf.setInt(LOGLEVEL, level.toInt());
   }
   
   /**
@@ -301,10 +386,25 @@ public abstract class InputFormatBase<K,
    *          The priority of the iterator
    * @param cfg
    *          The configuration of the iterator
+   * @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.
+   * 
+   * @param conf
+   *          The job in which to save the iterator configuration
+   * @param priority
+   *          The priority of the iterator
+   * @param cfg
+   *          The configuration of the iterator
+   */
+  public static void addIterator(Configuration conf, IteratorSetting cfg) {
     // First check to see if anything has been set already
-    String iterators = job.getConfiguration().get(ITERATORS);
+    String iterators = conf.get(ITERATORS);
     
     // No iterators specified yet, create a new string
     if (iterators == null || iterators.isEmpty()) {
@@ -314,12 +414,12 @@ public abstract class InputFormatBase<K,
       iterators = iterators.concat(ITERATORS_DELIM + new AccumuloIterator(cfg.getPriority(), cfg.getIteratorClass(), cfg.getName()).toString());
     }
     // Store the iterators w/ the job
-    job.getConfiguration().set(ITERATORS, iterators);
+    conf.set(ITERATORS, iterators);
     for (Entry<String,String> entry : cfg.getProperties().entrySet()) {
       if (entry.getValue() == null)
         continue;
       
-      String iteratorOptions = job.getConfiguration().get(ITERATORS_OPTIONS);
+      String iteratorOptions = conf.get(ITERATORS_OPTIONS);
       
       // No options specified yet, create a new string
       if (iteratorOptions == null || iteratorOptions.isEmpty()) {
@@ -330,7 +430,7 @@ public abstract class InputFormatBase<K,
       }
       
       // Store the options w/ the job
-      job.getConfiguration().set(ITERATORS_OPTIONS, iteratorOptions);
+      conf.set(ITERATORS_OPTIONS, iteratorOptions);
     }
   }
   
@@ -347,7 +447,7 @@ public abstract class InputFormatBase<K,
    * @param iteratorName
    *          the iterator name
    * 
-   * @deprecated since 1.4, see {@link #addIterator(JobContext, IteratorSetting)}
+   * @deprecated since 1.4, see {@link #addIterator(Configuration, IteratorSetting)}
    */
   public static void setIterator(JobContext job, int priority, String iteratorClass, String iteratorName) {
     // First check to see if anything has been set already
@@ -377,7 +477,7 @@ public abstract class InputFormatBase<K,
    * @param value
    *          the value
    * 
-   * @deprecated since 1.4, see {@link #addIterator(JobContext, IteratorSetting)}
+   * @deprecated since 1.4, see {@link #addIterator(Configuration, IteratorSetting)}
    */
   public static void setIteratorOption(JobContext job, String iteratorName, String key, String value) {
     if (iteratorName == null || key == null || value == null)
@@ -397,56 +497,120 @@ public abstract class InputFormatBase<K,
     job.getConfiguration().set(ITERATORS_OPTIONS, iteratorOptions);
   }
   
+  /**
+   * @deprecated Use {@link #isIsolated(Configuration)} instead
+   */
   protected static boolean isIsolated(JobContext job) {
-    return job.getConfiguration().getBoolean(ISOLATED, false);
+    return isIsolated(job.getConfiguration());
+  }
+
+  protected static boolean isIsolated(Configuration conf) {
+    return conf.getBoolean(ISOLATED, false);
   }
   
+  /**
+   * @deprecated Use {@link #usesLocalIterators(Configuration)} instead
+   */
   protected static boolean usesLocalIterators(JobContext job) {
-    return job.getConfiguration().getBoolean(LOCAL_ITERATORS, false);
+    return usesLocalIterators(job.getConfiguration());
+  }
+
+  protected static boolean usesLocalIterators(Configuration conf) {
+    return conf.getBoolean(LOCAL_ITERATORS, false);
   }
   
+  /**
+   * @deprecated Use {@link #getUsername(Configuration)} instead
+   */
   protected static String getUsername(JobContext job) {
-    return job.getConfiguration().get(USERNAME);
+    return getUsername(job.getConfiguration());
+  }
+
+  protected static String getUsername(Configuration conf) {
+    return conf.get(USERNAME);
   }
   
   /**
    * 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.
+   * @deprecated Use {@link #getPassword(Configuration)} instead
    */
   protected static byte[] getPassword(JobContext job) {
-    return Base64.decodeBase64(job.getConfiguration().get(PASSWORD, "").getBytes());
+    return getPassword(job.getConfiguration());
+  }
+
+  /**
+   * 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.
+   */
+  protected static byte[] getPassword(Configuration conf) {
+    return Base64.decodeBase64(conf.get(PASSWORD, "").getBytes());
   }
   
+  /**
+   * @deprecated Use {@link #getTablename(Configuration)} instead
+   */
   protected static String getTablename(JobContext job) {
-    return job.getConfiguration().get(TABLE_NAME);
+    return getTablename(job.getConfiguration());
+  }
+
+  protected static String getTablename(Configuration conf) {
+    return conf.get(TABLE_NAME);
   }
   
+  /**
+   * @deprecated Use {@link #getAuthorizations(Configuration)} instead
+   */
   protected static Authorizations getAuthorizations(JobContext job) {
-    String authString = job.getConfiguration().get(AUTHORIZATIONS);
+    return getAuthorizations(job.getConfiguration());
+  }
+
+  protected static Authorizations getAuthorizations(Configuration conf) {
+    String authString = conf.get(AUTHORIZATIONS);
     return authString == null ? Constants.NO_AUTHS : new Authorizations(authString.split(","));
   }
   
+  /**
+   * @deprecated Use {@link #getInstance(Configuration)} instead
+   */
   protected static Instance getInstance(JobContext job) {
-    Configuration conf = job.getConfiguration();
+    return getInstance(job.getConfiguration());
+  }
+
+  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));
   }
   
+  /**
+   * @deprecated Use {@link #getTabletLocator(Configuration)} instead
+   */
   protected static TabletLocator getTabletLocator(JobContext job) throws TableNotFoundException {
-    if (job.getConfiguration().getBoolean(MOCK, false))
+    return getTabletLocator(job.getConfiguration());
+  }
+
+  protected static TabletLocator getTabletLocator(Configuration conf) throws TableNotFoundException {
+    if (conf.getBoolean(MOCK, false))
       return new MockTabletLocator();
-    Instance instance = getInstance(job);
-    String username = getUsername(job);
-    byte[] password = getPassword(job);
-    String tableName = getTablename(job);
+    Instance instance = getInstance(conf);
+    String username = getUsername(conf);
+    byte[] password = getPassword(conf);
+    String tableName = getTablename(conf);
     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());
+  }
+
+  protected static List<Range> getRanges(Configuration conf) throws IOException {
     ArrayList<Range> ranges = new ArrayList<Range>();
-    for (String rangeString : job.getConfiguration().getStringCollection(RANGES)) {
+    for (String rangeString : conf.getStringCollection(RANGES)) {
       ByteArrayInputStream bais = new ByteArrayInputStream(Base64.decodeBase64(rangeString.getBytes()));
       Range range = new Range();
       range.readFields(new DataInputStream(bais));
@@ -455,7 +619,14 @@ public abstract class InputFormatBase<K,
     return ranges;
   }
   
+  /**
+   * @deprecated Use {@link #getRegex(Configuration,RegexType)} instead
+   */
   protected static String getRegex(JobContext job, RegexType type) {
+    return getRegex(job.getConfiguration(), type);
+  }
+
+  protected static String getRegex(Configuration conf, RegexType type) {
     String key = null;
     switch (type) {
       case ROW:
@@ -474,7 +645,7 @@ public abstract class InputFormatBase<K,
         throw new NoSuchElementException();
     }
     try {
-      String s = job.getConfiguration().get(key);
+      String s = conf.get(key);
       if (s == null)
         return null;
       return URLDecoder.decode(s, "UTF-8");
@@ -484,9 +655,16 @@ public abstract class InputFormatBase<K,
     }
   }
   
+  /**
+   * @deprecated Use {@link #getFetchedColumns(Configuration)} instead
+   */
   protected static Set<Pair<Text,Text>> getFetchedColumns(JobContext job) {
+    return getFetchedColumns(job.getConfiguration());
+  }
+
+  protected static Set<Pair<Text,Text>> getFetchedColumns(Configuration conf) {
     Set<Pair<Text,Text>> columns = new HashSet<Pair<Text,Text>>();
-    for (String col : job.getConfiguration().getStringCollection(COLUMNS)) {
+    for (String col : conf.getStringCollection(COLUMNS)) {
       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()));
@@ -495,33 +673,55 @@ public abstract class InputFormatBase<K,
     return columns;
   }
   
+  /**
+   * @deprecated Use {@link #getAutoAdjustRanges(Configuration)} instead
+   */
   protected static boolean getAutoAdjustRanges(JobContext job) {
-    return job.getConfiguration().getBoolean(AUTO_ADJUST_RANGES, true);
+    return getAutoAdjustRanges(job.getConfiguration());
+  }
+
+  protected static boolean getAutoAdjustRanges(Configuration conf) {
+    return conf.getBoolean(AUTO_ADJUST_RANGES, true);
   }
   
+  /**
+   * @deprecated Use {@link #getLogLevel(Configuration)} instead
+   */
   protected static Level getLogLevel(JobContext job) {
-    return Level.toLevel(job.getConfiguration().getInt(LOGLEVEL, Level.INFO.toInt()));
+    return getLogLevel(job.getConfiguration());
+  }
+
+  protected static Level getLogLevel(Configuration conf) {
+    return Level.toLevel(conf.getInt(LOGLEVEL, Level.INFO.toInt()));
   }
   
   // InputFormat doesn't have the equivalent of OutputFormat's
   // checkOutputSpecs(JobContext job)
+  /**
+   * @deprecated Use {@link #validateOptions(Configuration)} instead
+   */
   protected static void validateOptions(JobContext job) throws IOException {
-    Configuration conf = job.getConfiguration();
+    validateOptions(job.getConfiguration());
+  }
+
+  // InputFormat doesn't have the equivalent of OutputFormat's
+  // checkOutputSpecs(JobContext job)
+  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.");
     // validate that we can connect as configured
     try {
-      Connector c = getInstance(job).getConnector(getUsername(job), getPassword(job));
-      if (!c.securityOperations().authenticateUser(getUsername(job), getPassword(job)))
+      Connector c = getInstance(conf).getConnector(getUsername(conf), getPassword(conf));
+      if (!c.securityOperations().authenticateUser(getUsername(conf), getPassword(conf)))
         throw new IOException("Unable to authenticate user");
-      if (!c.securityOperations().hasTablePermission(getUsername(job), getTablename(job), TablePermission.READ))
+      if (!c.securityOperations().hasTablePermission(getUsername(conf), getTablename(conf), TablePermission.READ))
         throw new IOException("Unable to access table");
       
-      if (!usesLocalIterators(job)) {
+      if (!usesLocalIterators(conf)) {
         // validate that any scan-time iterators can be loaded by the the tablet servers
-        for (AccumuloIterator iter : getIterators(job)) {
+        for (AccumuloIterator iter : getIterators(conf)) {
           if (!c.instanceOperations().testClassLoad(iter.getIteratorClass(), SortedKeyValueIterator.class.getName()))
             throw new AccumuloException("Servers are unable to load " + iter.getIteratorClass() + " as a " + SortedKeyValueIterator.class.getName());
         }
@@ -535,21 +735,37 @@ public abstract class InputFormatBase<K,
   }
   
   // Get the maxVersions the VersionsIterator should be configured with. Return -1 if none.
+  /**
+   * @deprecated Use {@link #getMaxVersions(Configuration)} instead
+   */
   protected static int getMaxVersions(JobContext job) {
-    return job.getConfiguration().getInt(MAX_VERSIONS, -1);
+    return getMaxVersions(job.getConfiguration());
+  }
+
+  // Get the maxVersions the VersionsIterator should be configured with. Return -1 if none.
+  protected static int getMaxVersions(Configuration conf) {
+    return conf.getInt(MAX_VERSIONS, -1);
   }
   
   // Return a list of the iterator settings (for iterators to apply to a scanner)
+  /**
+   * @deprecated Use {@link #getIterators(Configuration)} instead
+   */
   protected static List<AccumuloIterator> getIterators(JobContext job) {
+    return getIterators(job.getConfiguration());
+  }
+
+  // Return a list of the iterator settings (for iterators to apply to a scanner)
+  protected static List<AccumuloIterator> getIterators(Configuration conf) {
     
-    String iterators = job.getConfiguration().get(ITERATORS);
+    String iterators = conf.get(ITERATORS);
     
     // 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(job.getConfiguration().get(ITERATORS), ITERATORS_DELIM);
+    StringTokenizer tokens = new StringTokenizer(conf.get(ITERATORS), ITERATORS_DELIM);
     List<AccumuloIterator> list = new ArrayList<AccumuloIterator>();
     while (tokens.hasMoreTokens()) {
       String itstring = tokens.nextToken();
@@ -559,15 +775,23 @@ public abstract class InputFormatBase<K,
   }
   
   // Return a list of the iterator options specified
+  /**
+   * @deprecated Use {@link #getIteratorOptions(Configuration)} instead
+   */
   protected static List<AccumuloIteratorOption> getIteratorOptions(JobContext job) {
-    String iteratorOptions = job.getConfiguration().get(ITERATORS_OPTIONS);
+    return getIteratorOptions(job.getConfiguration());
+  }
+
+  // Return a list of the iterator options specified
+  protected static List<AccumuloIteratorOption> getIteratorOptions(Configuration conf) {
+    String iteratorOptions = conf.get(ITERATORS_OPTIONS);
     
     // 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(job.getConfiguration().get(ITERATORS_OPTIONS), ITERATORS_DELIM);
+    StringTokenizer tokens = new StringTokenizer(conf.get(ITERATORS_OPTIONS), ITERATORS_DELIM);
     List<AccumuloIteratorOption> list = new ArrayList<AccumuloIteratorOption>();
     while (tokens.hasMoreTokens()) {
       String optionString = tokens.nextToken();
@@ -595,12 +819,19 @@ public abstract class InputFormatBase<K,
       }
     }
     
+    /**
+     * @deprecated Use {@link #setupRegex(Configuration,Scanner)} instead
+     */
     protected boolean setupRegex(TaskAttemptContext attempt, Scanner scanner) throws AccumuloException {
+      return setupRegex(attempt.getConfiguration(), scanner);
+    }
+
+    protected boolean setupRegex(Configuration conf, Scanner scanner) throws AccumuloException {
       try {
-        checkAndEnableRegex(getRegex(attempt, RegexType.ROW), scanner, "setRowRegex");
-        checkAndEnableRegex(getRegex(attempt, RegexType.COLUMN_FAMILY), scanner, "setColumnFamilyRegex");
-        checkAndEnableRegex(getRegex(attempt, RegexType.COLUMN_QUALIFIER), scanner, "setColumnQualifierRegex");
-        checkAndEnableRegex(getRegex(attempt, RegexType.VALUE), scanner, "setValueRegex");
+        checkAndEnableRegex(getRegex(conf, RegexType.ROW), scanner, "setRowRegex");
+        checkAndEnableRegex(getRegex(conf, RegexType.COLUMN_FAMILY), scanner, "setColumnFamilyRegex");
+        checkAndEnableRegex(getRegex(conf, RegexType.COLUMN_QUALIFIER), scanner, "setColumnQualifierRegex");
+        checkAndEnableRegex(getRegex(conf, RegexType.VALUE), scanner, "setValueRegex");
         return true;
       } catch (Exception e) {
         throw new AccumuloException("Can't set up regex for scanner");
@@ -608,9 +839,17 @@ public abstract class InputFormatBase<K,
     }
     
     // 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 {
-      List<AccumuloIterator> iterators = getIterators(attempt);
-      List<AccumuloIteratorOption> options = getIteratorOptions(attempt);
+      setupIterators(attempt.getConfiguration(), scanner);
+    }
+
+    // Apply the configured iterators from the job to the scanner
+    protected void setupIterators(Configuration conf, Scanner scanner) throws AccumuloException {
+      List<AccumuloIterator> iterators = getIterators(conf);
+      List<AccumuloIteratorOption> options = getIteratorOptions(conf);
       
       Map<String,IteratorSetting> scanIterators = new HashMap<String,IteratorSetting>();
       for (AccumuloIterator iterator : iterators) {
@@ -625,8 +864,16 @@ public abstract class InputFormatBase<K,
     }
     
     // Apply the VersioningIterator at priority 0 based on the job config
+    /**
+     * @deprecated Use {@link #setupMaxVersions(Configuration,Scanner)} instead
+     */
     protected void setupMaxVersions(TaskAttemptContext attempt, Scanner scanner) {
-      int maxVersions = getMaxVersions(attempt);
+      setupMaxVersions(attempt.getConfiguration(), scanner);
+    }
+
+    // Apply the VersioningIterator at priority 0 based on the job config
+    protected void setupMaxVersions(Configuration conf, Scanner scanner) {
+      int maxVersions = getMaxVersions(conf);
       // Check to make sure its a legit value
       if (maxVersions >= 1) {
         IteratorSetting vers = new IteratorSetting(0, "vers", VersioningIterator.class);
@@ -639,34 +886,34 @@ public abstract class InputFormatBase<K,
       Scanner scanner;
       split = (RangeInputSplit) inSplit;
       log.debug("Initializing input split: " + split.range);
-      Instance instance = getInstance(attempt);
-      String user = getUsername(attempt);
-      byte[] password = getPassword(attempt);
-      Authorizations authorizations = getAuthorizations(attempt);
+      Instance instance = getInstance(attempt.getConfiguration());
+      String user = getUsername(attempt.getConfiguration());
+      byte[] password = getPassword(attempt.getConfiguration());
+      Authorizations authorizations = getAuthorizations(attempt.getConfiguration());
       
       try {
         log.debug("Creating connector with user: " + user);
         Connector conn = instance.getConnector(user, password);
-        log.debug("Creating scanner for table: " + getTablename(attempt));
+        log.debug("Creating scanner for table: " + getTablename(attempt.getConfiguration()));
         log.debug("Authorizations are: " + authorizations);
-        scanner = conn.createScanner(getTablename(attempt), authorizations);
-        if (isIsolated(attempt)) {
+        scanner = conn.createScanner(getTablename(attempt.getConfiguration()), authorizations);
+        if (isIsolated(attempt.getConfiguration())) {
           log.info("Creating isolated scanner");
           scanner = new IsolatedScanner(scanner);
         }
-        if (usesLocalIterators(attempt)) {
+        if (usesLocalIterators(attempt.getConfiguration())) {
           log.info("Using local iterators");
           scanner = new ClientSideIteratorScanner(scanner);
         }
-        setupMaxVersions(attempt, scanner);
-        setupRegex(attempt, scanner);
-        setupIterators(attempt, scanner);
+        setupMaxVersions(attempt.getConfiguration(), scanner);
+        setupRegex(attempt.getConfiguration(), scanner);
+        setupIterators(attempt.getConfiguration(), scanner);
       } catch (Exception e) {
         throw new IOException(e);
       }
       
       // setup a scanner within the bounds of this split
-      for (Pair<Text,Text> c : getFetchedColumns(attempt)) {
+      for (Pair<Text,Text> c : getFetchedColumns(attempt.getConfiguration())) {
         if (c.getSecond() != null) {
           log.debug("Fetching column " + c.getFirst() + ":" + c.getSecond());
           scanner.fetchColumn(c.getFirst(), c.getSecond());
@@ -712,12 +959,12 @@ public abstract class InputFormatBase<K,
    * read the metadata table to get tablets of interest these each become a split
    */
   public List<InputSplit> getSplits(JobContext job) throws IOException {
-    log.setLevel(getLogLevel(job));
-    validateOptions(job);
+    log.setLevel(getLogLevel(job.getConfiguration()));
+    validateOptions(job.getConfiguration());
     
-    String tableName = getTablename(job);
-    boolean autoAdjust = getAutoAdjustRanges(job);
-    List<Range> ranges = autoAdjust ? Range.mergeOverlapping(getRanges(job)) : getRanges(job);
+    String tableName = getTablename(job.getConfiguration());
+    boolean autoAdjust = getAutoAdjustRanges(job.getConfiguration());
+    List<Range> ranges = autoAdjust ? Range.mergeOverlapping(getRanges(job.getConfiguration())) : getRanges(job.getConfiguration());
     
     if (ranges.isEmpty()) {
       ranges = new ArrayList<Range>(1);
@@ -728,16 +975,10 @@ public abstract class InputFormatBase<K,
     Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<String,Map<KeyExtent,List<Range>>>();
     TabletLocator tl;
     try {
-      tl = getTabletLocator(job);
+      tl = getTabletLocator(job.getConfiguration());
       while (!tl.binRanges(ranges, binnedRanges).isEmpty()) {
         log.warn("Unable to locate bins for specified ranges. Retrying.");
-        UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep
-        // randomly
-        // between
-        // 100
-        // and
-        // 200
-        // ms
+        UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
       }
     } catch (Exception e) {
       throw new IOException(e);

Modified: incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java Mon Jan  9 14:14:36 2012
@@ -62,8 +62,8 @@ public class AccumuloInputFormatTest {
   @Test
   public void testMaxVersions() throws IOException {
     JobContext job = new JobContext(new Configuration(), new JobID());
-    AccumuloInputFormat.setMaxVersions(job, 1);
-    int version = AccumuloInputFormat.getMaxVersions(job);
+    AccumuloInputFormat.setMaxVersions(job.getConfiguration(), 1);
+    int version = AccumuloInputFormat.getMaxVersions(job.getConfiguration());
     assertEquals(1, version);
   }
   
@@ -76,7 +76,7 @@ public class AccumuloInputFormatTest {
   @Test(expected = IOException.class)
   public void testMaxVersionsLessThan1() throws IOException {
     JobContext job = new JobContext(new Configuration(), new JobID());
-    AccumuloInputFormat.setMaxVersions(job, 0);
+    AccumuloInputFormat.setMaxVersions(job.getConfiguration(), 0);
   }
   
   /**
@@ -85,7 +85,7 @@ public class AccumuloInputFormatTest {
   @Test
   public void testNoMaxVersion() {
     JobContext job = new JobContext(new Configuration(), new JobID());
-    assertEquals(-1, AccumuloInputFormat.getMaxVersions(job));
+    assertEquals(-1, AccumuloInputFormat.getMaxVersions(job.getConfiguration()));
   }
   
   /**
@@ -106,14 +106,14 @@ public class AccumuloInputFormatTest {
   public void testAddIterator() {
     JobContext job = new JobContext(new Configuration(), new JobID());
     
-    AccumuloInputFormat.addIterator(job, new IteratorSetting(1, "WholeRow", WholeRowIterator.class));
-    AccumuloInputFormat.addIterator(job, new IteratorSetting(2, "Versions", "org.apache.accumulo.core.iterators.VersioningIterator"));
+    AccumuloInputFormat.addIterator(job.getConfiguration(), new IteratorSetting(1, "WholeRow", WholeRowIterator.class));
+    AccumuloInputFormat.addIterator(job.getConfiguration(), new IteratorSetting(2, "Versions", "org.apache.accumulo.core.iterators.VersioningIterator"));
     IteratorSetting iter = new IteratorSetting(3, "Count", "org.apache.accumulo.core.iterators.CountingIterator");
     iter.addOption("v1", "1");
     iter.addOption("junk", "\0omg:!\\xyzzy");
-    AccumuloInputFormat.addIterator(job, iter);
+    AccumuloInputFormat.addIterator(job.getConfiguration(), iter);
     
-    List<AccumuloIterator> list = AccumuloInputFormat.getIterators(job);
+    List<AccumuloIterator> list = AccumuloInputFormat.getIterators(job.getConfiguration());
     
     // Check the list size
     assertTrue(list.size() == 3);
@@ -134,7 +134,7 @@ public class AccumuloInputFormatTest {
     assertEquals("org.apache.accumulo.core.iterators.CountingIterator", setting.getIteratorClass());
     assertEquals("Count", setting.getIteratorName());
     
-    List<AccumuloIteratorOption> iteratorOptions = AccumuloInputFormat.getIteratorOptions(job);
+    List<AccumuloIteratorOption> iteratorOptions = AccumuloInputFormat.getIteratorOptions(job.getConfiguration());
     assertEquals(2, iteratorOptions.size());
     assertEquals("Count", iteratorOptions.get(0).getIteratorName());
     assertEquals("Count", iteratorOptions.get(1).getIteratorName());
@@ -157,13 +157,13 @@ public class AccumuloInputFormatTest {
     IteratorSetting someSetting = new IteratorSetting(1, "iterator", "Iterator.class");
     someSetting.addOption(key, value);
     Job job = new Job();
-    AccumuloInputFormat.addIterator(job, someSetting);
+    AccumuloInputFormat.addIterator(job.getConfiguration(), someSetting);
     
     final String rawConfigOpt = new AccumuloIteratorOption("iterator", key, value).toString();
     
     assertEquals(rawConfigOpt, job.getConfiguration().get("AccumuloInputFormat.iterators.options"));
     
-    List<AccumuloIteratorOption> opts = AccumuloInputFormat.getIteratorOptions(job);
+    List<AccumuloIteratorOption> opts = AccumuloInputFormat.getIteratorOptions(job.getConfiguration());
     assertEquals(1, opts.size());
     assertEquals(opts.get(0).getKey(), key);
     assertEquals(opts.get(0).getValue(), value);
@@ -171,8 +171,8 @@ public class AccumuloInputFormatTest {
     someSetting.addOption(key + "2", value);
     someSetting.setPriority(2);
     someSetting.setName("it2");
-    AccumuloInputFormat.addIterator(job, someSetting);
-    opts = AccumuloInputFormat.getIteratorOptions(job);
+    AccumuloInputFormat.addIterator(job.getConfiguration(), someSetting);
+    opts = AccumuloInputFormat.getIteratorOptions(job.getConfiguration());
     assertEquals(3, opts.size());
     for (AccumuloIteratorOption opt : opts) {
       assertEquals(opt.getKey().substring(0, key.length()), key);
@@ -307,8 +307,8 @@ public class AccumuloInputFormatTest {
     job.setInputFormatClass(AccumuloInputFormat.class);
     job.setMapperClass(TestMapper.class);
     job.setNumReduceTasks(0);
-    AccumuloInputFormat.setInputInfo(job, "root", "".getBytes(), "testtable", new Authorizations());
-    AccumuloInputFormat.setMockInstance(job, "testmapinstance");
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), "root", "".getBytes(), "testtable", new Authorizations());
+    AccumuloInputFormat.setMockInstance(job.getConfiguration(), "testmapinstance");
     
     AccumuloInputFormat input = new AccumuloInputFormat();
     List<InputSplit> splits = input.getSplits(job);
@@ -339,8 +339,8 @@ public class AccumuloInputFormatTest {
     bw.close();
     
     JobContext job = new JobContext(new Configuration(), new JobID());
-    AccumuloInputFormat.setInputInfo(job, "root", "".getBytes(), "testtable2", new Authorizations());
-    AccumuloInputFormat.setMockInstance(job, "testmapinstance");
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), "root", "".getBytes(), "testtable2", new Authorizations());
+    AccumuloInputFormat.setMockInstance(job.getConfiguration(), "testmapinstance");
     AccumuloInputFormat input = new AccumuloInputFormat();
     RangeInputSplit ris = new RangeInputSplit();
     TaskAttemptContext tac = new TaskAttemptContext(job.getConfiguration(), new TaskAttemptID());

Modified: incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java Mon Jan  9 14:14:36 2012
@@ -27,7 +27,6 @@ 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.mapreduce.AccumuloRowInputFormat;
 import org.apache.accumulo.core.client.mapreduce.InputFormatBase.RangeInputSplit;
 import org.apache.accumulo.core.client.mock.MockInstance;
 import org.apache.accumulo.core.data.Key;
@@ -102,8 +101,8 @@ public class AccumuloRowInputFormatTest 
     bw.close();
     
     JobContext job = new JobContext(new Configuration(), new JobID());
-    AccumuloRowInputFormat.setInputInfo(job, "root", "".getBytes(), "test", new Authorizations());
-    AccumuloRowInputFormat.setMockInstance(job, "instance1");
+    AccumuloRowInputFormat.setInputInfo(job.getConfiguration(), "root", "".getBytes(), "test", new Authorizations());
+    AccumuloRowInputFormat.setMockInstance(job.getConfiguration(), "instance1");
     AccumuloRowInputFormat crif = new AccumuloRowInputFormat();
     RangeInputSplit ris = new RangeInputSplit();
     TaskAttemptContext tac = new TaskAttemptContext(job.getConfiguration(), new TaskAttemptID());

Modified: incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java (original)
+++ incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java Mon Jan  9 14:14:36 2012
@@ -45,12 +45,12 @@ public class RegexExample extends Config
     job.setJarByClass(this.getClass());
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setZooKeeperInstance(job, args[0], args[1]);
-    AccumuloInputFormat.setInputInfo(job, args[2], args[3].getBytes(), args[4], new Authorizations());
+    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), args[0], args[1]);
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), args[2], args[3].getBytes(), args[4], new Authorizations());
     
     IteratorSetting regex = new IteratorSetting(50, "regex", RegExFilter.class);
     RegExFilter.setRegexs(regex, args[5], args[6], args[7], args[8], false);
-    AccumuloInputFormat.addIterator(job, regex);
+    AccumuloInputFormat.addIterator(job.getConfiguration(), regex);
     
     job.setMapperClass(RegexMapper.class);
     job.setMapOutputKeyClass(Key.class);

Modified: incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java (original)
+++ incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java Mon Jan  9 14:14:36 2012
@@ -58,15 +58,15 @@ public class RowHash extends Configured 
     job.setJarByClass(this.getClass());
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setZooKeeperInstance(job, args[0], args[1]);
-    AccumuloInputFormat.setInputInfo(job, args[2], args[3].getBytes(), args[4], new Authorizations());
+    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), args[0], args[1]);
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), args[2], args[3].getBytes(), args[4], new Authorizations());
     
     String col = args[5];
     int idx = col.indexOf(":");
     Text cf = new Text(idx < 0 ? col : col.substring(0, idx));
     Text cq = idx < 0 ? null : new Text(col.substring(idx + 1));
     if (cf.getLength() > 0)
-      AccumuloInputFormat.fetchColumns(job, Collections.singleton(new Pair<Text,Text>(cf, cq)));
+      AccumuloInputFormat.fetchColumns(job.getConfiguration(), Collections.singleton(new Pair<Text,Text>(cf, cq)));
     
     // AccumuloInputFormat.setLogLevel(job, Level.TRACE);
     

Modified: incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java (original)
+++ incubator/accumulo/branches/1.4/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java Mon Jan  9 14:14:36 2012
@@ -76,8 +76,8 @@ public class TableToFile extends Configu
     job.setJarByClass(this.getClass());
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setZooKeeperInstance(job, args[0], args[1]);
-    AccumuloInputFormat.setInputInfo(job, args[2], args[3].getBytes(), args[4], new Authorizations());
+    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), args[0], args[1]);
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), args[2], args[3].getBytes(), args[4], new Authorizations());
     
     HashSet<Pair<Text,Text>> columnsToFetch = new HashSet<Pair<Text,Text>>();
     for (String col : args[5].split(",")) {
@@ -88,7 +88,7 @@ public class TableToFile extends Configu
         columnsToFetch.add(new Pair<Text,Text>(cf, cq));
     }
     if (!columnsToFetch.isEmpty())
-      AccumuloInputFormat.fetchColumns(job, columnsToFetch);
+      AccumuloInputFormat.fetchColumns(job.getConfiguration(), columnsToFetch);
     
     job.setMapperClass(TTFMapper.class);
     job.setMapOutputKeyClass(NullWritable.class);

Modified: incubator/accumulo/branches/1.4/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkInputFormatTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkInputFormatTest.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkInputFormatTest.java (original)
+++ incubator/accumulo/branches/1.4/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkInputFormatTest.java Mon Jan  9 14:14:36 2012
@@ -37,8 +37,6 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
-import org.apache.accumulo.examples.filedata.ChunkInputFormat;
-import org.apache.accumulo.examples.filedata.ChunkInputStream;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.mapreduce.JobContext;
 import org.apache.hadoop.mapreduce.JobID;
@@ -90,8 +88,8 @@ public class ChunkInputFormatTest extend
     bw.close();
     
     JobContext job = new JobContext(new Configuration(), new JobID());
-    ChunkInputFormat.setInputInfo(job, "root", "".getBytes(), "test", new Authorizations("A", "B", "C", "D"));
-    ChunkInputFormat.setMockInstance(job, "instance1");
+    ChunkInputFormat.setInputInfo(job.getConfiguration(), "root", "".getBytes(), "test", new Authorizations("A", "B", "C", "D"));
+    ChunkInputFormat.setMockInstance(job.getConfiguration(), "instance1");
     ChunkInputFormat cif = new ChunkInputFormat();
     RangeInputSplit ris = new RangeInputSplit();
     TaskAttemptContext tac = new TaskAttemptContext(job.getConfiguration(), new TaskAttemptID());
@@ -141,8 +139,8 @@ public class ChunkInputFormatTest extend
     bw.close();
     
     JobContext job = new JobContext(new Configuration(), new JobID());
-    ChunkInputFormat.setInputInfo(job, "root", "".getBytes(), "test", new Authorizations("A", "B", "C", "D"));
-    ChunkInputFormat.setMockInstance(job, "instance2");
+    ChunkInputFormat.setInputInfo(job.getConfiguration(), "root", "".getBytes(), "test", new Authorizations("A", "B", "C", "D"));
+    ChunkInputFormat.setMockInstance(job.getConfiguration(), "instance2");
     ChunkInputFormat cif = new ChunkInputFormat();
     RangeInputSplit ris = new RangeInputSplit();
     TaskAttemptContext tac = new TaskAttemptContext(job.getConfiguration(), new TaskAttemptID());
@@ -180,8 +178,8 @@ public class ChunkInputFormatTest extend
     bw.close();
     
     JobContext job = new JobContext(new Configuration(), new JobID());
-    ChunkInputFormat.setInputInfo(job, "root", "".getBytes(), "test", new Authorizations("A", "B", "C", "D"));
-    ChunkInputFormat.setMockInstance(job, "instance3");
+    ChunkInputFormat.setInputInfo(job.getConfiguration(), "root", "".getBytes(), "test", new Authorizations("A", "B", "C", "D"));
+    ChunkInputFormat.setMockInstance(job.getConfiguration(), "instance3");
     ChunkInputFormat cif = new ChunkInputFormat();
     RangeInputSplit ris = new RangeInputSplit();
     TaskAttemptContext tac = new TaskAttemptContext(job.getConfiguration(), new TaskAttemptID());

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java (original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousMoru.java Mon Jan  9 14:14:36 2012
@@ -128,16 +128,14 @@ public class ContinuousMoru extends Conf
     job.setJarByClass(this.getClass());
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setInputInfo(job, user, pass.getBytes(), table, new Authorizations());
-    AccumuloInputFormat.setZooKeeperInstance(job, instance, zookeepers);
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), user, pass.getBytes(), table, new Authorizations());
+    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), instance, zookeepers);
     
     // set up ranges
     try {
-      AccumuloInputFormat.setRanges(
-          job,
-          new ZooKeeperInstance(instance, zookeepers).getConnector(user, pass.getBytes()).tableOperations()
-              .splitRangeByTablets(table, new Range(), Integer.parseInt(maxMaps)));
-      AccumuloInputFormat.disableAutoAdjustRanges(job);
+      AccumuloInputFormat.setRanges(job.getConfiguration(), new ZooKeeperInstance(instance, zookeepers).getConnector(user, pass.getBytes()).tableOperations()
+          .splitRangeByTablets(table, new Range(), Integer.parseInt(maxMaps)));
+      AccumuloInputFormat.disableAutoAdjustRanges(job.getConfiguration());
     } catch (Exception e) {
       throw new IOException(e);
     }

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java (original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousVerify.java Mon Jan  9 14:14:36 2012
@@ -149,15 +149,15 @@ public class ContinuousVerify extends Co
     job.setJarByClass(this.getClass());
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setInputInfo(job, user, pass.getBytes(), table, new Authorizations());
-    AccumuloInputFormat.setZooKeeperInstance(job, instance, zookeepers);
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), user, pass.getBytes(), table, new Authorizations());
+    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), instance, zookeepers);
     
     // set up ranges
     try {
       Set<Range> ranges = new ZooKeeperInstance(instance, zookeepers).getConnector(user, pass.getBytes()).tableOperations()
           .splitRangeByTablets(table, new Range(), Integer.parseInt(maxMaps));
-      AccumuloInputFormat.setRanges(job, ranges);
-      AccumuloInputFormat.disableAutoAdjustRanges(job);
+      AccumuloInputFormat.setRanges(job.getConfiguration(), ranges);
+      AccumuloInputFormat.disableAutoAdjustRanges(job.getConfiguration());
     } catch (Exception e) {
       throw new IOException(e);
     }

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java (original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/multitable/CopyTool.java Mon Jan  9 14:14:36 2012
@@ -52,8 +52,8 @@ public class CopyTool extends Configured
     }
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setInputInfo(job, args[0], args[1].getBytes(), args[2], new Authorizations());
-    AccumuloInputFormat.setZooKeeperInstance(job, args[3], args[4]);
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), args[0], args[1].getBytes(), args[2], new Authorizations());
+    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), args[3], args[4]);
     
     job.setMapperClass(SeqMapClass.class);
     job.setMapOutputKeyClass(Text.class);

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java (original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/sequential/MapRedVerifyTool.java Mon Jan  9 14:14:36 2012
@@ -84,8 +84,8 @@ public class MapRedVerifyTool extends Co
     }
     
     job.setInputFormatClass(AccumuloInputFormat.class);
-    AccumuloInputFormat.setInputInfo(job, args[0], args[1].getBytes(), args[2], new Authorizations());
-    AccumuloInputFormat.setZooKeeperInstance(job, args[3], args[4]);
+    AccumuloInputFormat.setInputInfo(job.getConfiguration(), args[0], args[1].getBytes(), args[2], new Authorizations());
+    AccumuloInputFormat.setZooKeeperInstance(job.getConfiguration(), args[3], args[4]);
     
     job.setMapperClass(SeqMapClass.class);
     job.setMapOutputKeyClass(NullWritable.class);

Modified: incubator/accumulo/branches/1.4/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java?rev=1229162&r1=1229161&r2=1229162&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java (original)
+++ incubator/accumulo/branches/1.4/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java Mon Jan  9 14:14:36 2012
@@ -26,7 +26,6 @@ import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.Watcher.Event.EventType;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.ZooKeeper.States;
 



Mime
View raw message