tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject tez git commit: TEZ-1982. TezChild setupUgi should not be using environment. (sseth)
Date Wed, 21 Jan 2015 19:28:26 GMT
Repository: tez
Updated Branches:
  refs/heads/master 59ca1f008 -> de904aebf


TEZ-1982. TezChild setupUgi should not be using environment. (sseth)


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

Branch: refs/heads/master
Commit: de904aebf98c1e2a69fdfd1a64f3cb74fb6e9996
Parents: 59ca1f0
Author: Siddharth Seth <sseth@apache.org>
Authored: Wed Jan 21 11:28:12 2015 -0800
Committer: Siddharth Seth <sseth@apache.org>
Committed: Wed Jan 21 11:28:12 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../tez/dag/app/launcher/LocalContainerLauncher.java  |  2 +-
 .../java/org/apache/tez/runtime/task/TezChild.java    | 14 ++++++++------
 3 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/de904aeb/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5f49b7b..fce9bb8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ Release 0.7.0: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-1982. TezChild setupUgi should not be using environment.
   TEZ-1980. Suppress tez-dag findbugs warnings until addressed.
   TEZ-1855. Avoid scanning for previously written files within Inputs / Outputs.
   TEZ-1902. Fix findbugs warnings in tez-mapreduce.

http://git-wip-us.apache.org/repos/asf/tez/blob/de904aeb/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java
index 9a83d3c..13601fe 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java
@@ -332,7 +332,7 @@ public class LocalContainerLauncher extends AbstractService implements
     TezChild tezChild =
         TezChild.newTezChild(defaultConf, null, 0, containerId.toString(), tokenIdentifier,
             attemptNumber, localDirs, workingDirectory, containerEnv, "", executionContext,
credentials,
-            Runtime.getRuntime().maxMemory());
+            Runtime.getRuntime().maxMemory(), context.getUser());
     tezChild.setUmbilical(tezTaskUmbilicalProtocol);
     return tezChild;
   }

http://git-wip-us.apache.org/repos/asf/tez/blob/de904aeb/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
----------------------------------------------------------------------
diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
index bfac476..d537846 100644
--- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
+++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
@@ -105,6 +105,7 @@ public class TezChild {
   private final Credentials credentials;
   private final long memAvailable;
   private final AtomicBoolean isShutdown = new AtomicBoolean(false);
+  private final String user;
 
   private Multimap<String, String> startedInputsMap = HashMultimap.create();
 
@@ -118,7 +119,7 @@ public class TezChild {
       Map<String, String> serviceProviderEnvMap,
       ObjectRegistryImpl objectRegistry, String pid,
       ExecutionContext executionContext,
-      Credentials credentials, long memAvailable)
+      Credentials credentials, long memAvailable, String user)
       throws IOException, InterruptedException {
     this.defaultConf = conf;
     this.containerIdString = containerIdentifier;
@@ -130,6 +131,7 @@ public class TezChild {
     this.executionContext = executionContext;
     this.credentials = credentials;
     this.memAvailable = memAvailable;
+    this.user = user;
 
     getTaskMaxSleepTime = defaultConf.getInt(
         TezConfiguration.TEZ_TASK_GET_TASK_SLEEP_INTERVAL_MS_MAX,
@@ -282,8 +284,7 @@ public class TezChild {
       if (taskCreds != null) {
         LOG.info("Credentials : #Tokens=" + taskCreds.numberOfTokens() + ", #SecretKeys="
             + taskCreds.numberOfSecretKeys());
-        childUGI = UserGroupInformation.createRemoteUser(System
-            .getenv(ApplicationConstants.Environment.USER.toString()));
+        childUGI = UserGroupInformation.createRemoteUser(user);
         childUGI.addCredentials(containerTask.getCredentials());
       } else {
         LOG.info("Not loading any credentials, since no credentials provided");
@@ -411,7 +412,7 @@ public class TezChild {
   public static TezChild newTezChild(Configuration conf, String host, int port, String containerIdentifier,
       String tokenIdentifier, int attemptNumber, String[] localDirs, String workingDirectory,
       Map<String, String> serviceProviderEnvMap, @Nullable String pid,
-      ExecutionContext executionContext, Credentials credentials, long memAvailable)
+      ExecutionContext executionContext, Credentials credentials, long memAvailable, String
user)
       throws IOException, InterruptedException, TezException {
 
     // Pull in configuration specified for the session.
@@ -428,7 +429,7 @@ public class TezChild {
 
     return new TezChild(conf, host, port, containerIdentifier, tokenIdentifier,
         attemptNumber, workingDirectory, localDirs, serviceProviderEnvMap, objectRegistry,
pid,
-        executionContext, credentials, memAvailable);
+        executionContext, credentials, memAvailable, user);
   }
 
   public static void main(String[] args) throws IOException, InterruptedException, TezException
{
@@ -461,7 +462,8 @@ public class TezChild {
     TezChild tezChild = newTezChild(defaultConf, host, port, containerIdentifier,
         tokenIdentifier, attemptNumber, localDirs, System.getenv(Environment.PWD.name()),
         System.getenv(), pid, new ExecutionContextImpl(System.getenv(Environment.NM_HOST.name())),
-        credentials, Runtime.getRuntime().maxMemory());
+        credentials, Runtime.getRuntime().maxMemory(), System
+            .getenv(ApplicationConstants.Environment.USER.toString()));
     tezChild.run();
   }
 


Mime
View raw message