Updated Branches:
  refs/heads/ACCUMULO-391 793b5183b -> 686257d40

ACCUMULO-1732 Using table id in RangeInputSplit so that it can be resolved back 
to "working" table name in mappers. Scanner uses the "working" table name while 
everything else can still safely use the original configured table name.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/686257d4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/686257d4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/686257d4

Branch: refs/heads/ACCUMULO-391
Commit: 686257d40a37acb31fee7636bf6c295f6234cc04
Parents: 793b518
Author: Corey J. Nolet <cjno...@gmail.com>
Authored: Sun Sep 29 20:37:07 2013 -0400
Committer: Corey J. Nolet <cjno...@gmail.com>
Committed: Sun Sep 29 20:37:07 2013 -0400

----------------------------------------------------------------------
 .../apache/accumulo/core/client/mapred/InputFormatBase.java    | 5 ++---
 .../apache/accumulo/core/client/mapreduce/InputFormatBase.java | 4 ++--
 .../core/client/mapreduce/lib/util/InputConfigurator.java      | 6 +++---
 3 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/686257d4/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
 
b/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
index 15c2dd2..cbb069d 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
@@ -599,7 +599,7 @@ public abstract class InputFormatBase<K,V> implements 
InputFormat<K,V> {
       // in case the table name changed, we can still use the previous name 
for terms of configuration,
       // but for the scanner, we'll need to reference the new table name.
       String actualNameForId = split.getTableName();
-      if(!(instance instanceof MockInstance)) {   // Really, the Tables helper 
class should not be tied to Zookeeper
+      if(!(instance instanceof MockInstance)) {
         try {
           actualNameForId = Tables.getTableName(instance, split.getTableId());
           if (!actualNameForId.equals(split.getTableName()))
@@ -615,7 +615,7 @@ public abstract class InputFormatBase<K,V> implements 
InputFormat<K,V> {
         log.debug("Creating scanner for table: " + getInputTableName(job));
         log.debug("Authorizations are: " + authorizations);
         if (isOfflineScan(job)) {
-          scanner = new OfflineScanner(instance, new Credentials(user, token), 
Tables.getTableId(instance, getInputTableName(job)), authorizations);
+          scanner = new OfflineScanner(instance, new Credentials(user, token), 
split.getTableId(), authorizations);
         } else {
           scanner = conn.createScanner(actualNameForId, authorizations);
         }
@@ -881,7 +881,6 @@ public abstract class InputFormatBase<K,V> implements 
InputFormat<K,V> {
     protected RangeInputSplit(String table, String tableId, Range range, 
String[] locations) {
       super(table, tableId,  range, locations);
     }
-
   }
 
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/686257d4/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
 
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
index 5392459..98a3ae4 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
@@ -661,7 +661,7 @@ public abstract class InputFormatBase<K,V> extends 
InputFormat<K,V> {
       // in case the table name changed, we can still use the previous name 
for terms of configuration,
       // but for the scanner, we'll need to reference the new table name.
       String actualNameForId = split.getTableName();
-      if(!(instance instanceof MockInstance)) {   // Really, the Tables helper 
class should not be tied to Zookeeper
+      if(!(instance instanceof MockInstance)) {
         try {
           actualNameForId = Tables.getTableName(instance, split.getTableId());
           if (!actualNameForId.equals(split.getTableName()))
@@ -682,7 +682,7 @@ public abstract class InputFormatBase<K,V> extends 
InputFormat<K,V> {
         if (isOfflineScan(attempt)) {
           scanner = new OfflineScanner(instance, new Credentials(principal, 
token), split.getTableId(), authorizations);
         } else {
-          scanner = conn.createScanner(split.getTableName(), authorizations);
+          scanner = conn.createScanner(actualNameForId, authorizations);
         }
         if (isIsolated(attempt)) {
           log.info("Creating isolated scanner");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/686257d4/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
 
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
index 82df3a1..9c1d553 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
@@ -67,7 +67,7 @@ public class InputConfigurator extends ConfiguratorBase {
    * @since 1.5.0
    */
   public static enum ScanOpts {
-    TABLE, AUTHORIZATIONS, RANGES, COLUMNS, ITERATORS, TABLE_CONFIGS
+    TABLE_NAME, AUTHORIZATIONS, RANGES, COLUMNS, ITERATORS, TABLE_CONFIGS
   }
 
   /**
@@ -92,7 +92,7 @@ public class InputConfigurator extends ConfiguratorBase {
    */
   public static void setInputTableName(Class<?> implementingClass, 
Configuration conf, String tableName) {
     notNull(tableName);
-    conf.set(enumToConfKey(implementingClass, ScanOpts.TABLE), tableName);
+    conf.set(enumToConfKey(implementingClass, ScanOpts.TABLE_NAME), tableName);
   }
 
   /**
@@ -105,7 +105,7 @@ public class InputConfigurator extends ConfiguratorBase {
    * @since 1.5.0
    */
   public static String getInputTableName(Class<?> implementingClass, 
Configuration conf) {
-    return conf.get(enumToConfKey(implementingClass, ScanOpts.TABLE));
+    return conf.get(enumToConfKey(implementingClass, ScanOpts.TABLE_NAME));
   }
 
   /**

Reply via email to