accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject accumulo git commit: ACCUMULO-3704 Use the ClientConfiguration from the Job's configuration
Date Wed, 01 Apr 2015 18:32:32 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 5cd14aa1c -> 24c5dd1fb


ACCUMULO-3704 Use the ClientConfiguration from the Job's configuration

The ClientConfiguration is serialized into the Job's configuration
in the Tool's VM, but then is subsequently ignored. This is very problematic
for installations where a client.conf doesn't exist in the few
"expected" locations. Also enforces that all YARN nodes have the
expected Accumulo configuration files installed.


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

Branch: refs/heads/master
Commit: 24c5dd1fb2b2002585c5f15e5368117ef1611ddd
Parents: 5cd14aa
Author: Josh Elser <elserj@apache.org>
Authored: Wed Apr 1 14:29:02 2015 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Apr 1 14:29:02 2015 -0400

----------------------------------------------------------------------
 .../accumulo/core/client/mapred/AbstractInputFormat.java  |  5 +++--
 .../core/client/mapreduce/AbstractInputFormat.java        |  5 +++--
 .../accumulo/core/client/mapreduce/RangeInputSplit.java   | 10 +++++++++-
 3 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/24c5dd1f/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
index ebfbe1b..7d43e0c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
@@ -407,7 +407,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V>
{
       split = (RangeInputSplit) inSplit;
       log.debug("Initializing input split: " + split.getRange());
 
-      Instance instance = split.getInstance();
+      Instance instance = split.getInstance(getClientConfiguration(job));
       if (null == instance) {
         instance = getInstance(job);
       }
@@ -467,7 +467,8 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V>
{
         } else if (instance instanceof MockInstance) {
           scanner = instance.getConnector(principal, token).createScanner(split.getTableName(),
authorizations);
         } else {
-          ClientContext context = new ClientContext(instance, new Credentials(principal,
token), ClientConfiguration.loadDefault());
+          ClientConfiguration clientConf = getClientConfiguration(job);
+          ClientContext context = new ClientContext(instance, new Credentials(principal,
token), clientConf);
           scanner = new ScannerImpl(context, split.getTableId(), authorizations);
         }
         if (isIsolated) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/24c5dd1f/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
index 9ed6315..bf18e4e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
@@ -438,7 +438,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V>
{
       split = (RangeInputSplit) inSplit;
       log.debug("Initializing input split: " + split.getRange());
 
-      Instance instance = split.getInstance();
+      Instance instance = split.getInstance(getClientConfiguration(attempt));
       if (null == instance) {
         instance = getInstance(attempt);
       }
@@ -488,7 +488,8 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V>
{
         } else if (instance instanceof MockInstance) {
           scanner = instance.getConnector(principal, token).createScanner(split.getTableName(),
authorizations);
         } else {
-          ClientContext context = new ClientContext(instance, new Credentials(principal,
token), ClientConfiguration.loadDefault());
+          ClientConfiguration clientConf = getClientConfiguration(attempt);
+          ClientContext context = new ClientContext(instance, new Credentials(principal,
token), clientConf);
           scanner = new ScannerImpl(context, split.getTableId(), authorizations);
         }
         if (isIsolated) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/24c5dd1f/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
index fe27b01..08bb4d8 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
@@ -388,7 +388,15 @@ public class RangeInputSplit extends InputSplit implements Writable {
     return tableId;
   }
 
+  /**
+   * @see #getInstance(ClientConfiguration)
+   */
+  @Deprecated
   public Instance getInstance() {
+    return getInstance(ClientConfiguration.loadDefault());
+  }
+
+  public Instance getInstance(ClientConfiguration base) {
     if (null == instanceName) {
       return null;
     }
@@ -401,7 +409,7 @@ public class RangeInputSplit extends InputSplit implements Writable {
       return null;
     }
 
-    return new ZooKeeperInstance(ClientConfiguration.loadDefault().withInstance(getInstanceName()).withZkHosts(getZooKeepers()));
+    return new ZooKeeperInstance(base.withInstance(getInstanceName()).withZkHosts(getZooKeepers()));
   }
 
   public String getInstanceName() {


Mime
View raw message