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/security/authorize/RMPolicyProvider.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/security/authorize/RMPolicyProvider.java?rev=1493624&r1=1493623&r2=1493624&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/security/authorize/RMPolicyProvider.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/security/authorize/RMPolicyProvider.java Mon Jun 17 02:29:56 2013 @@ -21,10 +21,10 @@ import org.apache.hadoop.classification. import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.security.authorize.PolicyProvider; import org.apache.hadoop.security.authorize.Service; -import org.apache.hadoop.yarn.api.AMRMProtocolPB; -import org.apache.hadoop.yarn.api.ClientRMProtocolPB; -import org.apache.hadoop.yarn.api.ContainerManagerPB; -import org.apache.hadoop.yarn.api.RMAdminProtocolPB; +import org.apache.hadoop.yarn.api.ApplicationMasterProtocolPB; +import org.apache.hadoop.yarn.api.ApplicationClientProtocolPB; +import org.apache.hadoop.yarn.api.ContainerManagementProtocolPB; +import org.apache.hadoop.yarn.api.ResourceManagerAdministrationProtocolPB; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.server.api.ResourceTrackerPB; @@ -38,20 +38,20 @@ public class RMPolicyProvider extends Po private static final Service[] resourceManagerServices = new Service[] { new Service( - YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCETRACKER, + YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCETRACKER_PROTOCOL, ResourceTrackerPB.class), new Service( - YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_CLIENT_RESOURCEMANAGER, - ClientRMProtocolPB.class), + YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONCLIENT_PROTOCOL, + ApplicationClientProtocolPB.class), new Service( - YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONMASTER_RESOURCEMANAGER, - AMRMProtocolPB.class), + YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONMASTER_PROTOCOL, + ApplicationMasterProtocolPB.class), new Service( - YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_ADMIN, - RMAdminProtocolPB.class), + YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCEMANAGER_ADMINISTRATION_PROTOCOL, + ResourceManagerAdministrationProtocolPB.class), new Service( - YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_CONTAINER_MANAGER, - ContainerManagerPB.class), + YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_CONTAINER_MANAGEMENT_PROTOCOL, + ContainerManagementProtocolPB.class), }; @Override
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/MockAM.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/MockAM.java?rev=1493624&r1=1493623&r2=1493624&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/MockAM.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/MockAM.java Mon Jun 17 02:29:56 2013 @@ -23,7 +23,7 @@ import java.util.List; import junit.framework.Assert; -import org.apache.hadoop.yarn.api.AMRMProtocol; +import org.apache.hadoop.yarn.api.ApplicationMasterProtocol; import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest; import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse; import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest; @@ -44,19 +44,19 @@ public class MockAM { private volatile int responseId = 0; private final ApplicationAttemptId attemptId; private final RMContext context; - private AMRMProtocol amRMProtocol; + private ApplicationMasterProtocol amRMProtocol; private final List<ResourceRequest> requests = new ArrayList<ResourceRequest>(); private final List<ContainerId> releases = new ArrayList<ContainerId>(); - MockAM(RMContext context, AMRMProtocol amRMProtocol, + MockAM(RMContext context, ApplicationMasterProtocol amRMProtocol, ApplicationAttemptId attemptId) { this.context = context; this.amRMProtocol = amRMProtocol; this.attemptId = attemptId; } - void setAMRMProtocol(AMRMProtocol amRMProtocol) { + void setAMRMProtocol(ApplicationMasterProtocol amRMProtocol) { this.amRMProtocol = amRMProtocol; } 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=1493624&r1=1493623&r2=1493624&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 Mon Jun 17 02:29:56 2013 @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configurat import org.apache.hadoop.io.DataOutputBuffer; import org.apache.hadoop.security.Credentials; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.yarn.api.ClientRMProtocol; +import org.apache.hadoop.yarn.api.ApplicationClientProtocol; import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationResponse; import org.apache.hadoop.yarn.api.protocolrecords.KillApplicationRequest; @@ -123,7 +123,7 @@ public class MockRM extends ResourceMana // get new application id public GetNewApplicationResponse getNewAppId() throws Exception { - ClientRMProtocol client = getClientRMService(); + ApplicationClientProtocol client = getClientRMService(); return client.getNewApplication(Records .newRecord(GetNewApplicationRequest.class)); } @@ -164,7 +164,7 @@ public class MockRM extends ResourceMana public RMApp submitApp(int masterMemory, String name, String user, Map<ApplicationAccessType, String> acls, boolean unmanaged, String queue, int maxAppAttempts, Credentials ts, String appType) throws Exception { - ClientRMProtocol client = getClientRMService(); + ApplicationClientProtocol client = getClientRMService(); GetNewApplicationResponse resp = client.getNewApplication(Records .newRecord(GetNewApplicationRequest.class)); ApplicationId appId = resp.getApplicationId(); @@ -201,7 +201,7 @@ public class MockRM extends ResourceMana UserGroupInformation.createUserForTesting(user, new String[] {"someGroup"}); PrivilegedAction<SubmitApplicationResponse> action = new PrivilegedAction<SubmitApplicationResponse>() { - ClientRMProtocol client; + ApplicationClientProtocol client; SubmitApplicationRequest req; @Override public SubmitApplicationResponse run() { @@ -215,7 +215,7 @@ public class MockRM extends ResourceMana return null; } PrivilegedAction<SubmitApplicationResponse> setClientReq( - ClientRMProtocol client, SubmitApplicationRequest req) { + ApplicationClientProtocol client, SubmitApplicationRequest req) { this.client = client; this.req = req; return this; @@ -261,7 +261,7 @@ public class MockRM extends ResourceMana } public void killApp(ApplicationId appId) throws Exception { - ClientRMProtocol client = getClientRMService(); + ApplicationClientProtocol client = getClientRMService(); KillApplicationRequest req = Records .newRecord(KillApplicationRequest.class); req.setApplicationId(appId); 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/MockRMWithCustomAMLauncher.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/MockRMWithCustomAMLauncher.java?rev=1493624&r1=1493623&r2=1493624&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/MockRMWithCustomAMLauncher.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/MockRMWithCustomAMLauncher.java Mon Jun 17 02:29:56 2013 @@ -19,7 +19,7 @@ package org.apache.hadoop.yarn.server.resourcemanager; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.yarn.api.ContainerManager; +import org.apache.hadoop.yarn.api.ContainerManagementProtocol; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncher; import org.apache.hadoop.yarn.server.resourcemanager.amlauncher.AMLauncherEventType; @@ -28,14 +28,14 @@ import org.apache.hadoop.yarn.server.res public class MockRMWithCustomAMLauncher extends MockRM { - private final ContainerManager containerManager; + private final ContainerManagementProtocol containerManager; - public MockRMWithCustomAMLauncher(ContainerManager containerManager) { + public MockRMWithCustomAMLauncher(ContainerManagementProtocol containerManager) { this(new Configuration(), containerManager); } public MockRMWithCustomAMLauncher(Configuration conf, - ContainerManager containerManager) { + ContainerManagementProtocol containerManager) { super(conf); this.containerManager = containerManager; } @@ -48,7 +48,7 @@ public class MockRMWithCustomAMLauncher AMLauncherEventType event) { return new AMLauncher(context, application, event, getConfig()) { @Override - protected ContainerManager getContainerMgrProxy( + protected ContainerManagementProtocol getContainerMgrProxy( ContainerId containerId) { return containerManager; } 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/NodeManager.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/NodeManager.java?rev=1493624&r1=1493623&r2=1493624&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/NodeManager.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/NodeManager.java Mon Jun 17 02:29:56 2013 @@ -30,7 +30,7 @@ import junit.framework.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience.Private; -import org.apache.hadoop.yarn.api.ContainerManager; +import org.apache.hadoop.yarn.api.ContainerManagementProtocol; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse; import org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest; @@ -60,7 +60,7 @@ import org.apache.hadoop.yarn.server.res import org.apache.hadoop.yarn.server.utils.BuilderUtils; @Private -public class NodeManager implements ContainerManager { +public class NodeManager implements ContainerManagementProtocol { private static final Log LOG = LogFactory.getLog(NodeManager.class); private static final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(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/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=1493624&r1=1493623&r2=1493624&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 Mon Jun 17 02:29:56 2013 @@ -32,8 +32,8 @@ import org.apache.hadoop.fs.CommonConfig import org.apache.hadoop.io.DataInputByteBuffer; import org.apache.hadoop.security.Credentials; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.yarn.api.AMRMProtocol; -import org.apache.hadoop.yarn.api.ContainerManager; +import org.apache.hadoop.yarn.api.ApplicationMasterProtocol; +import org.apache.hadoop.yarn.api.ContainerManagementProtocol; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse; import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest; @@ -67,7 +67,7 @@ public class TestAMAuthorization { UserGroupInformation.setConfiguration(confWithSecurityEnabled); } - public static final class MyContainerManager implements ContainerManager { + public static final class MyContainerManager implements ContainerManagementProtocol { public ByteBuffer amTokens; @@ -99,7 +99,7 @@ public class TestAMAuthorization { public static class MockRMWithAMS extends MockRMWithCustomAMLauncher { - public MockRMWithAMS(Configuration conf, ContainerManager containerManager) { + public MockRMWithAMS(Configuration conf, ContainerManagementProtocol containerManager) { super(conf, containerManager); } @@ -154,11 +154,11 @@ public class TestAMAuthorization { credentials.readTokenStorageStream(buf); currentUser.addCredentials(credentials); - AMRMProtocol client = currentUser - .doAs(new PrivilegedAction<AMRMProtocol>() { + ApplicationMasterProtocol client = currentUser + .doAs(new PrivilegedAction<ApplicationMasterProtocol>() { @Override - public AMRMProtocol run() { - return (AMRMProtocol) rpc.getProxy(AMRMProtocol.class, rm + public ApplicationMasterProtocol run() { + return (ApplicationMasterProtocol) rpc.getProxy(ApplicationMasterProtocol.class, rm .getApplicationMasterService().getBindAddress(), conf); } }); @@ -208,11 +208,11 @@ public class TestAMAuthorization { .createRemoteUser(applicationAttemptId.toString()); // First try contacting NM without tokens - AMRMProtocol client = currentUser - .doAs(new PrivilegedAction<AMRMProtocol>() { + ApplicationMasterProtocol client = currentUser + .doAs(new PrivilegedAction<ApplicationMasterProtocol>() { @Override - public AMRMProtocol run() { - return (AMRMProtocol) rpc.getProxy(AMRMProtocol.class, + public ApplicationMasterProtocol run() { + return (ApplicationMasterProtocol) rpc.getProxy(ApplicationMasterProtocol.class, serviceAddr, conf); } }); @@ -240,10 +240,10 @@ public class TestAMAuthorization { // Create a client to the RM. client = currentUser - .doAs(new PrivilegedAction<AMRMProtocol>() { + .doAs(new PrivilegedAction<ApplicationMasterProtocol>() { @Override - public AMRMProtocol run() { - return (AMRMProtocol) rpc.getProxy(AMRMProtocol.class, + public ApplicationMasterProtocol run() { + return (ApplicationMasterProtocol) rpc.getProxy(ApplicationMasterProtocol.class, serviceAddr, conf); } }); 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/TestApplicationACLs.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/TestApplicationACLs.java?rev=1493624&r1=1493623&r2=1493624&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/TestApplicationACLs.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/TestApplicationACLs.java Mon Jun 17 02:29:56 2013 @@ -32,7 +32,7 @@ import org.apache.commons.logging.LogFac import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.authorize.AccessControlList; -import org.apache.hadoop.yarn.api.ClientRMProtocol; +import org.apache.hadoop.yarn.api.ApplicationClientProtocol; import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; @@ -78,7 +78,7 @@ public class TestApplicationACLs { YarnConfiguration.RM_ADDRESS, YarnConfiguration.DEFAULT_RM_ADDRESS, YarnConfiguration.DEFAULT_RM_PORT); - private static ClientRMProtocol rmClient; + private static ApplicationClientProtocol rmClient; private static RecordFactory recordFactory = RecordFactoryProvider .getRecordFactory(conf); @@ -121,10 +121,10 @@ public class TestApplicationACLs { UserGroupInformation owner = UserGroupInformation .createRemoteUser(APP_OWNER); - rmClient = owner.doAs(new PrivilegedExceptionAction<ClientRMProtocol>() { + rmClient = owner.doAs(new PrivilegedExceptionAction<ApplicationClientProtocol>() { @Override - public ClientRMProtocol run() throws Exception { - return (ClientRMProtocol) rpc.getProxy(ClientRMProtocol.class, + public ApplicationClientProtocol run() throws Exception { + return (ApplicationClientProtocol) rpc.getProxy(ApplicationClientProtocol.class, rmAddress, conf); } }); @@ -178,15 +178,15 @@ public class TestApplicationACLs { return applicationId; } - private ClientRMProtocol getRMClientForUser(String user) + private ApplicationClientProtocol getRMClientForUser(String user) throws IOException, InterruptedException { UserGroupInformation userUGI = UserGroupInformation .createRemoteUser(user); - ClientRMProtocol userClient = userUGI - .doAs(new PrivilegedExceptionAction<ClientRMProtocol>() { + ApplicationClientProtocol userClient = userUGI + .doAs(new PrivilegedExceptionAction<ApplicationClientProtocol>() { @Override - public ClientRMProtocol run() throws Exception { - return (ClientRMProtocol) rpc.getProxy(ClientRMProtocol.class, + public ApplicationClientProtocol run() throws Exception { + return (ApplicationClientProtocol) rpc.getProxy(ApplicationClientProtocol.class, rmAddress, conf); } }); @@ -237,7 +237,7 @@ public class TestApplicationACLs { .newRecordInstance(KillApplicationRequest.class); finishAppRequest.setApplicationId(applicationId); - ClientRMProtocol superUserClient = getRMClientForUser(SUPER_USER); + ApplicationClientProtocol superUserClient = getRMClientForUser(SUPER_USER); // View as the superUser superUserClient.getApplicationReport(appReportRequest); @@ -268,7 +268,7 @@ public class TestApplicationACLs { .newRecordInstance(KillApplicationRequest.class); finishAppRequest.setApplicationId(applicationId); - ClientRMProtocol friendClient = getRMClientForUser(FRIEND); + ApplicationClientProtocol friendClient = getRMClientForUser(FRIEND); // View as the friend friendClient.getApplicationReport(appReportRequest); @@ -299,7 +299,7 @@ public class TestApplicationACLs { .newRecordInstance(KillApplicationRequest.class); finishAppRequest.setApplicationId(applicationId); - ClientRMProtocol enemyRmClient = getRMClientForUser(ENEMY); + ApplicationClientProtocol enemyRmClient = getRMClientForUser(ENEMY); // View as the enemy ApplicationReport appReport = enemyRmClient.getApplicationReport( 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/TestApplicationMasterLauncher.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/TestApplicationMasterLauncher.java?rev=1493624&r1=1493623&r2=1493624&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/TestApplicationMasterLauncher.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/TestApplicationMasterLauncher.java Mon Jun 17 02:29:56 2013 @@ -24,7 +24,7 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.yarn.api.ApplicationConstants; -import org.apache.hadoop.yarn.api.ContainerManager; +import org.apache.hadoop.yarn.api.ContainerManagementProtocol; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse; import org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest; @@ -55,7 +55,7 @@ public class TestApplicationMasterLaunch .getLog(TestApplicationMasterLauncher.class); private static final class MyContainerManagerImpl implements - ContainerManager { + ContainerManagementProtocol { boolean launched = false; boolean cleanedup = false; 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/TestClientRMService.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/TestClientRMService.java?rev=1493624&r1=1493623&r2=1493624&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/TestClientRMService.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/TestClientRMService.java Mon Jun 17 02:29:56 2013 @@ -40,7 +40,7 @@ import org.apache.hadoop.io.Text; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.yarn.MockApps; -import org.apache.hadoop.yarn.api.ClientRMProtocol; +import org.apache.hadoop.yarn.api.ApplicationClientProtocol; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest; @@ -124,9 +124,9 @@ public class TestClientRMService { YarnRPC rpc = YarnRPC.create(conf); InetSocketAddress rmAddress = rm.getClientRMService().getBindAddress(); LOG.info("Connecting to ResourceManager at " + rmAddress); - ClientRMProtocol client = - (ClientRMProtocol) rpc - .getProxy(ClientRMProtocol.class, rmAddress, conf); + ApplicationClientProtocol client = + (ApplicationClientProtocol) rpc + .getProxy(ApplicationClientProtocol.class, rmAddress, conf); // Make call GetClusterNodesRequest request = 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/TestClientRMTokens.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/TestClientRMTokens.java?rev=1493624&r1=1493623&r2=1493624&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/TestClientRMTokens.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/TestClientRMTokens.java Mon Jun 17 02:29:56 2013 @@ -52,7 +52,7 @@ import org.apache.hadoop.security.token. import org.apache.hadoop.security.token.SecretManager.InvalidToken; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.TokenIdentifier; -import org.apache.hadoop.yarn.api.ClientRMProtocol; +import org.apache.hadoop.yarn.api.ApplicationClientProtocol; import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; @@ -108,7 +108,7 @@ public class TestClientRMTokens { clientRMService.init(conf); clientRMService.start(); - ClientRMProtocol clientRMWithDT = null; + ApplicationClientProtocol clientRMWithDT = null; try { // Create a user for the renewr and fake the authentication-method @@ -351,7 +351,7 @@ public class TestClientRMTokens { // the kerberos based rpc. private org.apache.hadoop.yarn.api.records.Token getDelegationToken( final UserGroupInformation loggedInUser, - final ClientRMProtocol clientRMService, final String renewerString) + final ApplicationClientProtocol clientRMService, final String renewerString) throws IOException, InterruptedException { org.apache.hadoop.yarn.api.records.Token token = loggedInUser .doAs(new PrivilegedExceptionAction<org.apache.hadoop.yarn.api.records.Token>() { @@ -369,7 +369,7 @@ public class TestClientRMTokens { } private long renewDelegationToken(final UserGroupInformation loggedInUser, - final ClientRMProtocol clientRMService, + final ApplicationClientProtocol clientRMService, final org.apache.hadoop.yarn.api.records.Token dToken) throws IOException, InterruptedException { long nextExpTime = loggedInUser.doAs(new PrivilegedExceptionAction<Long>() { @@ -386,7 +386,7 @@ public class TestClientRMTokens { } private void cancelDelegationToken(final UserGroupInformation loggedInUser, - final ClientRMProtocol clientRMService, + final ApplicationClientProtocol clientRMService, final org.apache.hadoop.yarn.api.records.Token dToken) throws IOException, InterruptedException { loggedInUser.doAs(new PrivilegedExceptionAction<Void>() { @@ -401,7 +401,7 @@ public class TestClientRMTokens { }); } - private ClientRMProtocol getClientRMProtocolWithDT( + private ApplicationClientProtocol getClientRMProtocolWithDT( org.apache.hadoop.yarn.api.records.Token token, final InetSocketAddress rmAddress, String user, final Configuration conf) { // Maybe consider converting to Hadoop token, serialize de-serialize etc @@ -412,11 +412,11 @@ public class TestClientRMTokens { ugi.addToken(ProtoUtils.convertFromProtoFormat(token, rmAddress)); final YarnRPC rpc = YarnRPC.create(conf); - ClientRMProtocol clientRMWithDT = ugi - .doAs(new PrivilegedAction<ClientRMProtocol>() { + ApplicationClientProtocol clientRMWithDT = ugi + .doAs(new PrivilegedAction<ApplicationClientProtocol>() { @Override - public ClientRMProtocol run() { - return (ClientRMProtocol) rpc.getProxy(ClientRMProtocol.class, + public ApplicationClientProtocol run() { + return (ApplicationClientProtocol) rpc.getProxy(ApplicationClientProtocol.class, rmAddress, conf); } }); 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/scheduler/TestSchedulerUtils.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/scheduler/TestSchedulerUtils.java?rev=1493624&r1=1493623&r2=1493624&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/scheduler/TestSchedulerUtils.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/scheduler/TestSchedulerUtils.java Mon Jun 17 02:29:56 2013 @@ -31,7 +31,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.yarn.api.AMRMProtocol; +import org.apache.hadoop.yarn.api.ApplicationMasterProtocol; import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest; import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest; import org.apache.hadoop.yarn.api.records.ApplicationAccessType; @@ -295,11 +295,11 @@ public class TestSchedulerUtils { UserGroupInformation currentUser = UserGroupInformation.createRemoteUser(applicationAttemptId.toString()); - AMRMProtocol client = currentUser - .doAs(new PrivilegedAction<AMRMProtocol>() { + ApplicationMasterProtocol client = currentUser + .doAs(new PrivilegedAction<ApplicationMasterProtocol>() { @Override - public AMRMProtocol run() { - return (AMRMProtocol) rpc.getProxy(AMRMProtocol.class, rm + public ApplicationMasterProtocol run() { + return (ApplicationMasterProtocol) rpc.getProxy(ApplicationMasterProtocol.class, rm .getApplicationMasterService().getBindAddress(), conf); } }); 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/security/TestApplicationTokens.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/security/TestApplicationTokens.java?rev=1493624&r1=1493623&r2=1493624&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/security/TestApplicationTokens.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/security/TestApplicationTokens.java Mon Jun 17 02:29:56 2013 @@ -29,7 +29,7 @@ import org.apache.hadoop.fs.CommonConfig import org.apache.hadoop.io.DataInputByteBuffer; import org.apache.hadoop.security.Credentials; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.yarn.api.AMRMProtocol; +import org.apache.hadoop.yarn.api.ApplicationMasterProtocol; import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest; import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest; import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest; @@ -75,7 +75,7 @@ public class TestApplicationTokens { final Configuration conf = rm.getConfig(); final YarnRPC rpc = YarnRPC.create(conf); - AMRMProtocol rmClient = null; + ApplicationMasterProtocol rmClient = null; try { MockNM nm1 = rm.registerNode("localhost:1234", 5120); @@ -167,7 +167,7 @@ public class TestApplicationTokens { final Configuration conf = rm.getConfig(); final YarnRPC rpc = YarnRPC.create(conf); - AMRMProtocol rmClient = null; + ApplicationMasterProtocol rmClient = null; try { MockNM nm1 = rm.registerNode("localhost:1234", 5120); @@ -235,13 +235,13 @@ public class TestApplicationTokens { } } - private AMRMProtocol createRMClient(final MockRM rm, + private ApplicationMasterProtocol createRMClient(final MockRM rm, final Configuration conf, final YarnRPC rpc, UserGroupInformation currentUser) { - return currentUser.doAs(new PrivilegedAction<AMRMProtocol>() { + return currentUser.doAs(new PrivilegedAction<ApplicationMasterProtocol>() { @Override - public AMRMProtocol run() { - return (AMRMProtocol) rpc.getProxy(AMRMProtocol.class, rm + public ApplicationMasterProtocol run() { + return (ApplicationMasterProtocol) rpc.getProxy(ApplicationMasterProtocol.class, rm .getApplicationMasterService().getBindAddress(), conf); } }); 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/security/TestClientTokens.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/security/TestClientTokens.java?rev=1493624&r1=1493623&r2=1493624&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/security/TestClientTokens.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/security/TestClientTokens.java Mon Jun 17 02:29:56 2013 @@ -45,7 +45,7 @@ import org.apache.hadoop.security.token. import org.apache.hadoop.security.token.TokenInfo; import org.apache.hadoop.security.token.TokenSelector; import org.apache.hadoop.yarn.api.ApplicationConstants; -import org.apache.hadoop.yarn.api.ContainerManager; +import org.apache.hadoop.yarn.api.ContainerManagementProtocol; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest; @@ -149,7 +149,7 @@ public class TestClientTokens { } } - private static class CustomNM implements ContainerManager { + private static class CustomNM implements ContainerManagementProtocol { public String clientTokensSecret; Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java?rev=1493624&r1=1493623&r2=1493624&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java (original) +++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java Mon Jun 17 02:29:56 2013 @@ -44,8 +44,8 @@ import org.apache.hadoop.security.Securi import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.util.Shell; -import org.apache.hadoop.yarn.api.AMRMProtocol; -import org.apache.hadoop.yarn.api.ContainerManager; +import org.apache.hadoop.yarn.api.ApplicationMasterProtocol; +import org.apache.hadoop.yarn.api.ContainerManagementProtocol; import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; import org.apache.hadoop.yarn.api.protocolrecords.KillApplicationRequest; @@ -141,7 +141,7 @@ public class TestContainerManagerSecurit ApplicationId appID = resourceManager.getClientRMService() .getNewApplication(Records.newRecord(GetNewApplicationRequest.class)) .getApplicationId(); - AMRMProtocol scheduler = submitAndRegisterApplication(resourceManager, + ApplicationMasterProtocol scheduler = submitAndRegisterApplication(resourceManager, yarnRPC, appID); // Now request a container. @@ -162,8 +162,8 @@ public class TestContainerManagerSecurit authenticatedUser.doAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { - ContainerManager client = (ContainerManager) yarnRPC.getProxy( - ContainerManager.class, NetUtils + ContainerManagementProtocol client = (ContainerManagementProtocol) yarnRPC.getProxy( + ContainerManagementProtocol.class, NetUtils .createSocketAddr(allocatedContainer.getNodeId().toString()), conf); LOG.info("Going to make a legal stopContainer() request"); @@ -203,7 +203,7 @@ public class TestContainerManagerSecurit ApplicationId appID = resourceManager.getClientRMService() .getNewApplication(Records.newRecord(GetNewApplicationRequest.class)) .getApplicationId(); - AMRMProtocol scheduler = submitAndRegisterApplication(resourceManager, + ApplicationMasterProtocol scheduler = submitAndRegisterApplication(resourceManager, yarnRPC, appID); // Now request a container. @@ -270,8 +270,8 @@ public class TestContainerManagerSecurit maliceUser.doAs(new PrivilegedAction<Void>() { @Override public Void run() { - ContainerManager client = (ContainerManager) yarnRPC.getProxy( - ContainerManager.class, NetUtils + ContainerManagementProtocol client = (ContainerManagementProtocol) yarnRPC.getProxy( + ContainerManagementProtocol.class, NetUtils .createSocketAddr(allocatedContainer.getNodeId().toString()), conf); @@ -318,7 +318,7 @@ public class TestContainerManagerSecurit final ApplicationId appID = resourceManager.getClientRMService() .getNewApplication(Records.newRecord(GetNewApplicationRequest.class)) .getApplicationId(); - AMRMProtocol scheduler = submitAndRegisterApplication(resourceManager, + ApplicationMasterProtocol scheduler = submitAndRegisterApplication(resourceManager, yarnRPC, appID); // Now request a container. @@ -358,8 +358,8 @@ public class TestContainerManagerSecurit unauthorizedUser.doAs(new PrivilegedAction<Void>() { @Override public Void run() { - ContainerManager client = (ContainerManager) yarnRPC.getProxy( - ContainerManager.class, NetUtils + ContainerManagementProtocol client = (ContainerManagementProtocol) yarnRPC.getProxy( + ContainerManagementProtocol.class, NetUtils .createSocketAddr(allocatedContainer.getNodeId().toString()), conf); @@ -403,7 +403,7 @@ public class TestContainerManagerSecurit resourceManager.getClientRMService().forceKillApplication(request); } - private AMRMProtocol submitAndRegisterApplication( + private ApplicationMasterProtocol submitAndRegisterApplication( ResourceManager resourceManager, final YarnRPC yarnRPC, ApplicationId appID) throws IOException, UnsupportedFileSystemException, YarnException, @@ -472,11 +472,11 @@ public class TestContainerManagerSecurit currentUser.addToken(appToken); } - AMRMProtocol scheduler = currentUser - .doAs(new PrivilegedAction<AMRMProtocol>() { + ApplicationMasterProtocol scheduler = currentUser + .doAs(new PrivilegedAction<ApplicationMasterProtocol>() { @Override - public AMRMProtocol run() { - return (AMRMProtocol) yarnRPC.getProxy(AMRMProtocol.class, + public ApplicationMasterProtocol run() { + return (ApplicationMasterProtocol) yarnRPC.getProxy(ApplicationMasterProtocol.class, schedulerAddr, conf); } }); @@ -490,7 +490,7 @@ public class TestContainerManagerSecurit return scheduler; } - private Container requestAndGetContainer(AMRMProtocol scheduler, + private Container requestAndGetContainer(ApplicationMasterProtocol scheduler, ApplicationId appID) throws YarnException, InterruptedException, IOException { Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/AppReportFetcher.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/AppReportFetcher.java?rev=1493624&r1=1493623&r2=1493624&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/AppReportFetcher.java (original) +++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/AppReportFetcher.java Mon Jun 17 02:29:56 2013 @@ -24,7 +24,7 @@ import java.net.InetSocketAddress; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.yarn.api.ClientRMProtocol; +import org.apache.hadoop.yarn.api.ApplicationClientProtocol; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse; import org.apache.hadoop.yarn.api.records.ApplicationId; @@ -41,7 +41,7 @@ import org.apache.hadoop.yarn.ipc.YarnRP public class AppReportFetcher { private static final Log LOG = LogFactory.getLog(AppReportFetcher.class); private final Configuration conf; - private final ClientRMProtocol applicationsManager; + private final ApplicationClientProtocol applicationsManager; private final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null); /** @@ -57,7 +57,7 @@ public class AppReportFetcher { YarnConfiguration.DEFAULT_RM_PORT); LOG.info("Connecting to ResourceManager at " + rmAddress); applicationsManager = - (ClientRMProtocol) rpc.getProxy(ClientRMProtocol.class, + (ApplicationClientProtocol) rpc.getProxy(ApplicationClientProtocol.class, rmAddress, this.conf); LOG.info("Connected to ResourceManager at " + rmAddress); } @@ -69,7 +69,7 @@ public class AppReportFetcher { * @param conf the configuration to use * @param applicationsManager what to use to get the RM reports. */ - public AppReportFetcher(Configuration conf, ClientRMProtocol applicationsManager) { + public AppReportFetcher(Configuration conf, ApplicationClientProtocol applicationsManager) { this.conf = conf; this.applicationsManager = applicationsManager; } Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/WritingYarnApplications.apt.vm URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/WritingYarnApplications.apt.vm?rev=1493624&r1=1493623&r2=1493624&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/WritingYarnApplications.apt.vm (original) +++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/WritingYarnApplications.apt.vm Mon Jun 17 02:29:56 2013 @@ -32,10 +32,10 @@ Hadoop MapReduce Next Generation - Writi The general concept is that an 'Application Submission Client' submits an 'Application' to the YARN Resource Manager. The client communicates with the - ResourceManager using the 'ClientRMProtocol' to first acquire a new - 'ApplicationId' if needed via ClientRMProtocol#getNewApplication and then - submit the 'Application' to be run via ClientRMProtocol#submitApplication. As - part of the ClientRMProtocol#submitApplication call, the client needs to + ResourceManager using the 'ApplicationClientProtocol' to first acquire a new + 'ApplicationId' if needed via ApplicationClientProtocol#getNewApplication and then + submit the 'Application' to be run via ApplicationClientProtocol#submitApplication. As + part of the ApplicationClientProtocol#submitApplication call, the client needs to provide sufficient information to the ResourceManager to 'launch' the application's first container i.e. the ApplicationMaster. You need to provide information such as the details about the local @@ -47,35 +47,35 @@ Hadoop MapReduce Next Generation - Writi The YARN ResourceManager will then launch the ApplicationMaster (as specified) on an allocated container. The ApplicationMaster is then expected to - communicate with the ResourceManager using the 'AMRMProtocol'. Firstly, the + communicate with the ResourceManager using the 'ApplicationMasterProtocol'. Firstly, the ApplicationMaster needs to register itself with the ResourceManager. To complete the task assigned to it, the ApplicationMaster can then request for - and receive containers via AMRMProtocol#allocate. After a container is + and receive containers via ApplicationMasterProtocol#allocate. After a container is allocated to it, the ApplicationMaster communicates with the NodeManager using ContainerManager#startContainer to launch the container for its task. As part of launching this container, the ApplicationMaster has to specify the ContainerLaunchContext which, similar to the ApplicationSubmissionContext, has the launch information such as command line specification, environment, etc. Once the task is completed, the ApplicationMaster has to signal the - ResourceManager of its completion via the AMRMProtocol#finishApplicationMaster. + ResourceManager of its completion via the ApplicationMasterProtocol#finishApplicationMaster. Meanwhile, the client can monitor the application's status by querying the ResourceManager or by directly querying the ApplicationMaster if it supports such a service. If needed, it can also kill the application via - ClientRMProtocol#forceKillApplication. + ApplicationClientProtocol#forceKillApplication. * Interfaces The interfaces you'd most like be concerned with are: - * ClientRMProtocol - Client\<--\>ResourceManager\ + * ApplicationClientProtocol - Client\<--\>ResourceManager\ The protocol for a client that wishes to communicate with the ResourceManager to launch a new application (i.e. the ApplicationMaster), check on the status of the application or kill the application. For example, a job-client (a job launching program from the gateway) would use this protocol. - * AMRMProtocol - ApplicationMaster\<--\>ResourceManager\ + * ApplicationMasterProtocol - ApplicationMaster\<--\>ResourceManager\ The protocol used by the ApplicationMaster to register/unregister itself to/from the ResourceManager as well as to request for resources from the Scheduler to complete its tasks. @@ -93,7 +93,7 @@ Hadoop MapReduce Next Generation - Writi interface of the ResourceManager. +---+ - ClientRMProtocol applicationsManager; + ApplicationClientProtocol applicationsManager; YarnConfiguration yarnConf = new YarnConfiguration(conf); InetSocketAddress rmAddress = NetUtils.createSocketAddr(yarnConf.get( @@ -104,8 +104,8 @@ Hadoop MapReduce Next Generation - Writi appsManagerServerConf.setClass( YarnConfiguration.YARN_SECURITY_INFO, ClientRMSecurityInfo.class, SecurityInfo.class); - applicationsManager = ((ClientRMProtocol) rpc.getProxy( - ClientRMProtocol.class, rmAddress, appsManagerServerConf)); + applicationsManager = ((ApplicationClientProtocol) rpc.getProxy( + ApplicationClientProtocol.class, rmAddress, appsManagerServerConf)); +---+ * Once a handle is obtained to the ASM, the client needs to request the @@ -256,7 +256,7 @@ Hadoop MapReduce Next Generation - Writi * There are multiple ways a client can track progress of the actual task. * It can communicate with the ResourceManager and request for a report of - the application via ClientRMProtocol#getApplicationReport. + the application via ApplicationClientProtocol#getApplicationReport. +-----+ GetApplicationReportRequest reportRequest = @@ -299,7 +299,7 @@ Hadoop MapReduce Next Generation - Writi * In certain situations, if the application is taking too long or due to other factors, the client may wish to kill the application. The - ClientRMProtocol supports the forceKillApplication call that allows a + ApplicationClientProtocol supports the forceKillApplication call that allows a client to send a kill signal to the ApplicationMaster via the ResourceManager. An ApplicationMaster if so designed may also support an abort call via its rpc layer that a client may be able to leverage. @@ -350,7 +350,7 @@ Hadoop MapReduce Next Generation - Writi * After an ApplicationMaster has initialized itself completely, it needs to register with the ResourceManager via - AMRMProtocol#registerApplicationMaster. The ApplicationMaster always + ApplicationMasterProtocol#registerApplicationMaster. The ApplicationMaster always communicate via the Scheduler interface of the ResourceManager. +---+ @@ -361,8 +361,8 @@ Hadoop MapReduce Next Generation - Writi YarnConfiguration.RM_SCHEDULER_ADDRESS, YarnConfiguration.DEFAULT_RM_SCHEDULER_ADDRESS)); LOG.info("Connecting to ResourceManager at " + rmAddress); - AMRMProtocol resourceManager = - (AMRMProtocol) rpc.getProxy(AMRMProtocol.class, rmAddress, conf); + ApplicationMasterProtocol resourceManager = + (ApplicationMasterProtocol) rpc.getProxy(ApplicationMasterProtocol.class, rmAddress, conf); // Register the AM with the RM // Set the required info into the registration request: @@ -391,7 +391,7 @@ Hadoop MapReduce Next Generation - Writi timeout expiry interval at the ResourceManager is defined by a config setting accessible via YarnConfiguration.RM_AM_EXPIRY_INTERVAL_MS with the default being defined by YarnConfiguration.DEFAULT_RM_AM_EXPIRY_INTERVAL_MS. - The AMRMProtocol#allocate calls to the ResourceManager count as heartbeats + The ApplicationMasterProtocol#allocate calls to the ResourceManager count as heartbeats as it also supports sending progress update information. Therefore, an allocate call with no containers requested and progress information updated if any is a valid way for making heartbeat calls to the ResourceManager. @@ -682,7 +682,7 @@ Hadoop MapReduce Next Generation - Writi +---+ * The ApplicationMaster, as mentioned previously, will get updates of - completed containers as part of the response from the AMRMProtocol#allocate + completed containers as part of the response from the ApplicationMasterProtocol#allocate calls. It can also monitor its launched containers pro-actively by querying the ContainerManager for the status.
