accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cjno...@apache.org
Subject [09/11] git commit: 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.
Date Wed, 02 Oct 2013 03:22:45 GMT
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/10b4eb82
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/10b4eb82
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/10b4eb82

Branch: refs/heads/ACCUMULO-391
Commit: 10b4eb8206ab4395ef2d4df375b52a7ffe77d655
Parents: 7b8585f
Author: Corey J. Nolet <cjnolet@gmail.com>
Authored: Sun Sep 29 20:37:07 2013 -0400
Committer: Corey J. Nolet <cjnolet@gmail.com>
Committed: Tue Oct 1 21:46:17 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/10b4eb82/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/10b4eb82/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/10b4eb82/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));
   }
 
   /**


Mime
View raw message