helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject git commit: Set tokens when starting new containers
Date Thu, 03 Jul 2014 17:47:36 GMT
Repository: helix
Updated Branches:
  refs/heads/helix-provisioning d2209f726 -> 99f5ff7bb


Set tokens when starting new containers


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

Branch: refs/heads/helix-provisioning
Commit: 99f5ff7bb6db9be7a92cb04bc5bba68b5130a871
Parents: d2209f7
Author: Kanak Biscuitwala <kanak@apache.org>
Authored: Thu Jul 3 10:47:31 2014 -0700
Committer: Kanak Biscuitwala <kanak@apache.org>
Committed: Thu Jul 3 10:47:31 2014 -0700

----------------------------------------------------------------------
 .../helix/provisioning/yarn/GenericApplicationMaster.java       | 2 ++
 .../org/apache/helix/provisioning/yarn/YarnProvisioner.java     | 5 +++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/99f5ff7b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/GenericApplicationMaster.java
----------------------------------------------------------------------
diff --git a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/GenericApplicationMaster.java
b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/GenericApplicationMaster.java
index 346af4b..defa3d8 100644
--- a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/GenericApplicationMaster.java
+++ b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/GenericApplicationMaster.java
@@ -190,12 +190,14 @@ public class GenericApplicationMaster {
     LOG.info("Starting ApplicationMaster");
 
     Credentials credentials = UserGroupInformation.getCurrentUser().getCredentials();
+    LOG.info("Credentials: " + credentials);
     DataOutputBuffer dob = new DataOutputBuffer();
     credentials.writeTokenStorageToStream(dob);
     // Now remove the AM->RM token so that containers cannot access it.
     Iterator<Token<?>> iter = credentials.getAllTokens().iterator();
     while (iter.hasNext()) {
       Token<?> token = iter.next();
+      LOG.info("Processing token: " + token);
       if (token.getKind().equals(AMRMTokenIdentifier.KIND_NAME)) {
         iter.remove();
       }

http://git-wip-us.apache.org/repos/asf/helix/blob/99f5ff7b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
----------------------------------------------------------------------
diff --git a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
index 833efa5..ce6b1bc 100644
--- a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
+++ b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
@@ -200,6 +200,11 @@ public class YarnProvisioner implements Provisioner, TargetProvider,
ContainerPr
 
     participantContainer.setEnvironment(env);
 
+    if (applicationMaster.allTokens != null) {
+      LOG.info("Setting tokens: " + applicationMaster.allTokens);
+      participantContainer.setTokens(applicationMaster.allTokens);
+    }
+
     // Set the necessary command to execute the application master
     Vector<CharSequence> vargs = new Vector<CharSequence>(30);
 


Mime
View raw message