hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject svn commit: r1482200 - in /hadoop/common/branches/branch-2/hadoop-yarn-project: ./ hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ hadoo...
Date Tue, 14 May 2013 04:13:01 GMT
Author: sseth
Date: Tue May 14 04:13:00 2013
New Revision: 1482200

URL: http://svn.apache.org/r1482200
Log:
merge YARN-615 from trunk. Rename ContainerLaunchContext.containerTokens to tokens. Contributed
by Vinod Kumar Vavilapalli.

Modified:
    hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerLaunchContextPBImpl.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAMAuthorization.java
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt Tue May 14 04:13:00 2013
@@ -46,6 +46,9 @@ Release 2.0.5-beta - UNRELEASED
     YARN-630. Changed AMRMProtocol api to throw IOException and
     YarnRemoteException. (Xuan Gong via vinodkv)
 
+    YARN-615. Rename ContainerLaunchContext.containerTokens to tokens.
+    (Vinod Kumar Vavilapalli via sseth)
+
   NEW FEATURES
 
     YARN-482. FS: Extend SchedulingMode to intermediate queues. 

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java
Tue May 14 04:13:00 2013
@@ -68,20 +68,24 @@ public interface ContainerLaunchContext 
   void setUser(String user);
 
   /**
-   * Get security tokens (if security is enabled).
-   * @return security tokens (if security is enabled)
+   * Get all the tokens needed by this container. It may include file-system
+   * tokens, ApplicationMaster related tokens if this container is an
+   * ApplicationMaster or framework level tokens needed by this container to
+   * communicate to various services in a secure manner.
+   * 
+   * @return tokens needed by this container.
    */
   @Public
   @Stable
-  ByteBuffer getContainerTokens();
+  ByteBuffer getTokens();
 
   /**
-   * Set security tokens (if security is enabled).
-   * @param containerToken security tokens 
+   * Set security tokens needed by this container.
+   * @param tokens security tokens 
    */
   @Public
   @Stable
-  void setContainerTokens(ByteBuffer containerToken);
+  void setTokens(ByteBuffer tokens);
 
   /**
    * Get <code>LocalResource</code> required by the container.

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerLaunchContextPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerLaunchContextPBImpl.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerLaunchContextPBImpl.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerLaunchContextPBImpl.java
Tue May 14 04:13:00 2013
@@ -47,7 +47,7 @@ implements ContainerLaunchContext {
   boolean viaProto = false;
   
   private Map<String, LocalResource> localResources = null;
-  private ByteBuffer containerTokens = null;
+  private ByteBuffer tokens = null;
   private Map<String, ByteBuffer> serviceData = null;
   private Map<String, String> environment = null;
   private List<String> commands = null;
@@ -73,8 +73,8 @@ implements ContainerLaunchContext {
     if (this.localResources != null) {
       addLocalResourcesToProto();
     }
-    if (this.containerTokens != null) {
-      builder.setContainerTokens(convertToProtoFormat(this.containerTokens));
+    if (this.tokens != null) {
+      builder.setTokens(convertToProtoFormat(this.tokens));
     }
     if (this.serviceData != null) {
       addServiceDataToProto();
@@ -226,25 +226,25 @@ implements ContainerLaunchContext {
   }
   
   @Override
-  public ByteBuffer getContainerTokens() {
+  public ByteBuffer getTokens() {
     ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder;
-    if (this.containerTokens != null) {
-      return this.containerTokens;
+    if (this.tokens != null) {
+      return this.tokens;
     }
-    if (!p.hasContainerTokens()) {
+    if (!p.hasTokens()) {
       return null;
     }
-    this.containerTokens =  convertFromProtoFormat(p.getContainerTokens());
-    return this.containerTokens;
+    this.tokens =  convertFromProtoFormat(p.getTokens());
+    return this.tokens;
   }
 
   @Override
-  public void setContainerTokens(ByteBuffer containerTokens) {
+  public void setTokens(ByteBuffer tokens) {
     maybeInitBuilder();
-    if (containerTokens == null) {
-      builder.clearContainerTokens();
+    if (tokens == null) {
+      builder.clearTokens();
     }
-    this.containerTokens = containerTokens;
+    this.tokens = tokens;
   }
 
   @Override

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto
Tue May 14 04:13:00 2013
@@ -269,7 +269,7 @@ message QueueUserACLInfoProto {
 message ContainerLaunchContextProto {
   optional string user = 1;
   repeated StringLocalResourceMapProto localResources = 2;
-  optional bytes container_tokens = 3;
+  optional bytes tokens = 3;
   repeated StringBytesMapProto service_data = 4;
   repeated StringStringMapProto environment = 5;
   repeated string command = 6;

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/BuilderUtils.java
Tue May 14 04:13:00 2013
@@ -288,7 +288,7 @@ public class BuilderUtils {
   public static ContainerLaunchContext newContainerLaunchContext(
       String user, Map<String, LocalResource> localResources,
       Map<String, String> environment, List<String> commands,
-      Map<String, ByteBuffer> serviceData,  ByteBuffer containerTokens,
+      Map<String, ByteBuffer> serviceData,  ByteBuffer tokens,
       Map<ApplicationAccessType, String> acls) {
     ContainerLaunchContext container = recordFactory
         .newRecordInstance(ContainerLaunchContext.class);
@@ -297,7 +297,7 @@ public class BuilderUtils {
     container.setEnvironment(environment);
     container.setCommands(commands);
     container.setServiceData(serviceData);
-    container.setContainerTokens(containerTokens);
+    container.setTokens(tokens);
     container.setApplicationACLs(acls);
     return container;
   }

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java
Tue May 14 04:13:00 2013
@@ -427,7 +427,7 @@ public class ContainerManagerImpl extend
         + launchContext.getUser());
 
     // //////////// Parse credentials
-    ByteBuffer tokens = launchContext.getContainerTokens();
+    ByteBuffer tokens = launchContext.getTokens();
     Credentials credentials = new Credentials();
     if (tokens != null) {
       DataInputByteBuffer buf = new DataInputByteBuffer();

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java
Tue May 14 04:13:00 2013
@@ -316,7 +316,7 @@ public class RMAppManager implements Eve
       throws IOException {
     Credentials credentials = new Credentials();
     DataInputByteBuffer dibb = new DataInputByteBuffer();
-    ByteBuffer tokens = application.getAMContainerSpec().getContainerTokens();
+    ByteBuffer tokens = application.getAMContainerSpec().getTokens();
     if (tokens != null) {
       dibb.reset(tokens);
       credentials.readTokenStorageStream(dibb);

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java
Tue May 14 04:13:00 2013
@@ -195,9 +195,9 @@ public class AMLauncher implements Runna
       Credentials credentials = new Credentials();
 
       DataInputByteBuffer dibb = new DataInputByteBuffer();
-      if (container.getContainerTokens() != null) {
+      if (container.getTokens() != null) {
         // TODO: Don't do this kind of checks everywhere.
-        dibb.reset(container.getContainerTokens());
+        dibb.reset(container.getTokens());
         credentials.readTokenStorageStream(dibb);
       }
 
@@ -209,7 +209,7 @@ public class AMLauncher implements Runna
       }
       DataOutputBuffer dob = new DataOutputBuffer();
       credentials.writeTokenStorageToStream(dob);
-      container.setContainerTokens(ByteBuffer.wrap(dob.getData(), 0,
+      container.setTokens(ByteBuffer.wrap(dob.getData(), 0,
         dob.getLength()));
 
       SecretKey clientSecretKey =

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
Tue May 14 04:13:00 2013
@@ -184,7 +184,7 @@ public class MockRM extends ResourceMana
       DataOutputBuffer dob = new DataOutputBuffer();
       ts.writeTokenStorageToStream(dob);
       ByteBuffer securityTokens = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
-      clc.setContainerTokens(securityTokens);
+      clc.setTokens(securityTokens);
     }
     sub.setAMContainerSpec(clc);
     req.setApplicationSubmissionContext(sub);

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAMAuthorization.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAMAuthorization.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAMAuthorization.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAMAuthorization.java
Tue May 14 04:13:00 2013
@@ -78,7 +78,7 @@ public class TestAMAuthorization {
     public StartContainerResponse
         startContainer(StartContainerRequest request)
             throws YarnRemoteException {
-      amTokens = request.getContainerLaunchContext().getContainerTokens();
+      amTokens = request.getContainerLaunchContext().getTokens();
       return null;
     }
 

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java?rev=1482200&r1=1482199&r2=1482200&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMRestart.java
Tue May 14 04:13:00 2013
@@ -474,7 +474,7 @@ public class TestRMRestart {
     securityTokens.rewind();
     Assert.assertEquals(securityTokens, appState
       .getApplicationSubmissionContext().getAMContainerSpec()
-      .getContainerTokens());
+      .getTokens());
 
     // start new RM
     MockRM rm2 = new TestSecurityMockRM(conf, memStore);



Mime
View raw message