Return-Path: X-Original-To: apmail-hadoop-yarn-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3912710911 for ; Fri, 27 Dec 2013 03:28:53 +0000 (UTC) Received: (qmail 86885 invoked by uid 500); 27 Dec 2013 03:28:52 -0000 Delivered-To: apmail-hadoop-yarn-commits-archive@hadoop.apache.org Received: (qmail 86857 invoked by uid 500); 27 Dec 2013 03:28:51 -0000 Mailing-List: contact yarn-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-commits@hadoop.apache.org Delivered-To: mailing list yarn-commits@hadoop.apache.org Received: (qmail 86849 invoked by uid 99); 27 Dec 2013 03:28:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Dec 2013 03:28:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Dec 2013 03:28:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6951223888A6; Fri, 27 Dec 2013 03:28:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1553616 - in /hadoop/common/trunk/hadoop-yarn-project: ./ hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/ hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/ hadoop-yarn/hadoop-yarn-ser... Date: Fri, 27 Dec 2013 03:28:24 -0000 To: yarn-commits@hadoop.apache.org From: kasha@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131227032824.6951223888A6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kasha Date: Fri Dec 27 03:28:23 2013 New Revision: 1553616 URL: http://svn.apache.org/r1553616 Log: YARN-1523. Use StandbyException instead of RMNotYetReadyException (kasha) Removed: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/RMNotYetActiveException.java Modified: hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/ResourceManagerAdministrationProtocol.java hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java Modified: hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt?rev=1553616&r1=1553615&r2=1553616&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt (original) +++ hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt Fri Dec 27 03:28:23 2013 @@ -189,6 +189,8 @@ Release 2.4.0 - UNRELEASED YARN-1172. Convert SecretManagers in RM to services (Tsuyoshi OZAWA via kasha) + YARN-1523. Use StandbyException instead of RMNotYetReadyException (kasha) + OPTIMIZATIONS BUG FIXES Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/ResourceManagerAdministrationProtocol.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/ResourceManagerAdministrationProtocol.java?rev=1553616&r1=1553615&r2=1553616&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/ResourceManagerAdministrationProtocol.java (original) +++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/ResourceManagerAdministrationProtocol.java Fri Dec 27 03:28:23 2013 @@ -24,10 +24,10 @@ import org.apache.hadoop.classification. import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.ipc.StandbyException; import org.apache.hadoop.tools.GetUserMappingsProtocol; import org.apache.hadoop.yarn.api.records.NodeId; import org.apache.hadoop.yarn.api.records.ResourceOption; -import org.apache.hadoop.yarn.exceptions.RMNotYetActiveException; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest; import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsResponse; @@ -51,25 +51,25 @@ public interface ResourceManagerAdminist @Public @Stable public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request) - throws RMNotYetActiveException, YarnException, IOException; + throws StandbyException, YarnException, IOException; @Public @Stable public RefreshNodesResponse refreshNodes(RefreshNodesRequest request) - throws RMNotYetActiveException, YarnException, IOException; + throws StandbyException, YarnException, IOException; @Public @Stable public RefreshSuperUserGroupsConfigurationResponse refreshSuperUserGroupsConfiguration( RefreshSuperUserGroupsConfigurationRequest request) - throws RMNotYetActiveException, YarnException, IOException; + throws StandbyException, YarnException, IOException; @Public @Stable public RefreshUserToGroupsMappingsResponse refreshUserToGroupsMappings( RefreshUserToGroupsMappingsRequest request) - throws RMNotYetActiveException, YarnException, IOException; + throws StandbyException, YarnException, IOException; @Public @Stable Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java?rev=1553616&r1=1553615&r2=1553616&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java (original) +++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java Fri Dec 27 03:28:23 2013 @@ -40,6 +40,7 @@ import org.apache.hadoop.ha.protocolPB.H import org.apache.hadoop.ipc.ProtobufRpcEngine; import org.apache.hadoop.ipc.RPC; import org.apache.hadoop.ipc.RPC.Server; +import org.apache.hadoop.ipc.StandbyException; import org.apache.hadoop.security.Groups; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.authorize.AccessControlList; @@ -49,7 +50,6 @@ import org.apache.hadoop.service.Abstrac import org.apache.hadoop.yarn.api.records.NodeId; import org.apache.hadoop.yarn.api.records.ResourceOption; import org.apache.hadoop.yarn.conf.YarnConfiguration; -import org.apache.hadoop.yarn.exceptions.RMNotYetActiveException; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.factories.RecordFactory; import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; @@ -82,6 +82,7 @@ public class AdminService extends Abstra private final RMContext rmContext; private final ResourceManager rm; + private String rmId; private Server server; private InetSocketAddress masterServiceAddress; @@ -105,6 +106,7 @@ public class AdminService extends Abstra adminAcl = new AccessControlList(conf.get( YarnConfiguration.YARN_ADMIN_ACL, YarnConfiguration.DEFAULT_YARN_ADMIN_ACL)); + rmId = conf.get(YarnConfiguration.RM_HA_ID); super.serviceInit(conf); } @@ -176,6 +178,10 @@ public class AdminService extends Abstra return HAServiceState.ACTIVE == rmContext.getHAServiceState(); } + private void throwStandbyException() throws StandbyException { + throw new StandbyException("ResourceManager " + rmId + " is not Active!"); + } + @Override public synchronized void monitorHealth() throws IOException { @@ -239,14 +245,14 @@ public class AdminService extends Abstra @Override public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request) - throws YarnException { + throws YarnException, StandbyException { UserGroupInformation user = checkAcls("refreshQueues"); if (!isRMActive()) { RMAuditLogger.logFailure(user.getShortUserName(), "refreshQueues", adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not refresh queues."); - throw new RMNotYetActiveException(); + throwStandbyException(); } try { @@ -265,14 +271,14 @@ public class AdminService extends Abstra @Override public RefreshNodesResponse refreshNodes(RefreshNodesRequest request) - throws YarnException { + throws YarnException, StandbyException { UserGroupInformation user = checkAcls("refreshNodes"); if (!isRMActive()) { RMAuditLogger.logFailure(user.getShortUserName(), "refreshNodes", adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not refresh nodes."); - throw new RMNotYetActiveException(); + throwStandbyException(); } try { @@ -291,7 +297,7 @@ public class AdminService extends Abstra @Override public RefreshSuperUserGroupsConfigurationResponse refreshSuperUserGroupsConfiguration( RefreshSuperUserGroupsConfigurationRequest request) - throws YarnException { + throws YarnException, StandbyException { UserGroupInformation user = checkAcls("refreshSuperUserGroupsConfiguration"); // TODO (YARN-1459): Revisit handling super-user-groups on Standby RM @@ -300,7 +306,7 @@ public class AdminService extends Abstra "refreshSuperUserGroupsConfiguration", adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not refresh super-user-groups."); - throw new RMNotYetActiveException(); + throwStandbyException(); } ProxyUsers.refreshSuperUserGroupsConfiguration(new Configuration()); @@ -313,7 +319,8 @@ public class AdminService extends Abstra @Override public RefreshUserToGroupsMappingsResponse refreshUserToGroupsMappings( - RefreshUserToGroupsMappingsRequest request) throws YarnException { + RefreshUserToGroupsMappingsRequest request) + throws YarnException, StandbyException { UserGroupInformation user = checkAcls("refreshUserToGroupsMappings"); // TODO (YARN-1459): Revisit handling user-groups on Standby RM @@ -322,7 +329,7 @@ public class AdminService extends Abstra "refreshUserToGroupsMapping", adminAcl.toString(), "AdminService", "ResourceManager is not active. Can not refresh user-groups."); - throw new RMNotYetActiveException(); + throwStandbyException(); } Groups.getUserToGroupsMappingService().refresh();