From c4148c8db1c7b49572156f825a39c03e34339b79 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Wed, 5 Oct 2011 11:47:00 +0000 Subject: [PATCH] MAPREDUCE-3013. svn merge -c r1179174 --ignore-ancestry ../../trunk/ git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1179175 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../mapreduce/v2/app/client/MRClientService.java | 5 +---- .../v2/app/launcher/ContainerLauncherImpl.java | 8 +------- .../hadoop/mapreduce/v2/app/rm/RMCommunicator.java | 5 +---- .../hadoop/mapreduce/v2/hs/HistoryClientService.java | 9 +++------ .../java/org/apache/hadoop/mapred/ClientCache.java | 7 ++----- .../apache/hadoop/mapred/ClientServiceDelegate.java | 8 ++------ .../org/apache/hadoop/mapred/ResourceMgrDelegate.java | 6 +----- .../yarn/applications/distributedshell/Client.java | 6 ++---- .../apache/hadoop/yarn/conf/YarnConfiguration.java | 9 +-------- .../apache/hadoop/yarn/ipc/HadoopYarnProtoRPC.java | 9 ++------- .../org/apache/hadoop/yarn/ipc/HadoopYarnRPC.java | 9 ++------- .../server/nodemanager/NodeStatusUpdaterImpl.java | 9 +++------ .../containermanager/ContainerManagerImpl.java | 7 ++----- .../localizer/ContainerLocalizer.java | 10 ++-------- .../localizer/ResourceLocalizationService.java | 7 ++----- .../yarn/server/resourcemanager/AdminService.java | 11 ++++------- .../resourcemanager/ApplicationMasterService.java | 10 ++++------ .../yarn/server/resourcemanager/ClientRMService.java | 11 ++++------- .../resourcemanager/ResourceTrackerService.java | 11 ++++------- .../server/resourcemanager/amlauncher/AMLauncher.java | 5 +---- .../yarn/server/resourcemanager/tools/RMAdmin.java | 6 ------ .../yarn/server/TestContainerTokenSecretManager.java | 6 ------ 23 files changed, 47 insertions(+), 130 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 51f179a9d5a..801d1005ed5 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -309,6 +309,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-3138. Add a utility to help applications bridge changes in Context Objects APIs due to MAPREDUCE-954. (omalley via acmurthy) + MAPREDUCE-3013. Removed YarnConfiguration.YARN_SECURITY_INFO and its usage + as it doesn't affect security any more. (vinodkv) + OPTIMIZATIONS MAPREDUCE-2026. Make JobTracker.getJobCounters() and diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/client/MRClientService.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/client/MRClientService.java index f84a4d9dbe4..faf11a117cc 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/client/MRClientService.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/client/MRClientService.java @@ -114,7 +114,7 @@ public class MRClientService extends AbstractService } public void start() { - Configuration conf = new Configuration(getConfig()); // Just for not messing up sec-info class config + Configuration conf = getConfig(); YarnRPC rpc = YarnRPC.create(conf); InetSocketAddress address = NetUtils.createSocketAddr("0.0.0.0:0"); InetAddress hostNameResolved = null; @@ -134,9 +134,6 @@ public class MRClientService extends AbstractService ApplicationTokenIdentifier identifier = new ApplicationTokenIdentifier(this.appContext.getApplicationID()); secretManager.setMasterKey(identifier, bytes); - conf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - SchedulerSecurityInfo.class, SecurityInfo.class); // Same for now. } server = rpc.getServer(MRClientProtocol.class, protocolHandler, address, diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/launcher/ContainerLauncherImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/launcher/ContainerLauncherImpl.java index 95e17d8f4f6..6e7996b6da0 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/launcher/ContainerLauncherImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/launcher/ContainerLauncherImpl.java @@ -91,17 +91,11 @@ public class ContainerLauncherImpl extends AbstractService implements @Override public synchronized void init(Configuration conf) { - // Clone configuration for this component so that the SecurityInfo setting - // doesn't affect the original configuration - Configuration myLocalConfig = new Configuration(conf); - myLocalConfig.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - ContainerManagerSecurityInfo.class, SecurityInfo.class); this.recordFactory = RecordFactoryProvider.getRecordFactory(conf); this.limitOnPoolSize = conf.getInt( MRJobConfig.MR_AM_CONTAINERLAUNCHER_THREAD_COUNT_LIMIT, MRJobConfig.DEFAULT_MR_AM_CONTAINERLAUNCHER_THREAD_COUNT_LIMIT); - super.init(myLocalConfig); + super.init(conf); } public void start() { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java index 6655581178d..91d60c20817 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java @@ -247,7 +247,7 @@ public abstract class RMCommunicator extends AbstractService { protected AMRMProtocol createSchedulerProxy() { final YarnRPC rpc = YarnRPC.create(getConfig()); - final Configuration conf = new Configuration(getConfig()); + final Configuration conf = getConfig(); final String serviceAddr = conf.get( YarnConfiguration.RM_SCHEDULER_ADDRESS, YarnConfiguration.DEFAULT_RM_SCHEDULER_ADDRESS); @@ -260,9 +260,6 @@ public abstract class RMCommunicator extends AbstractService { } if (UserGroupInformation.isSecurityEnabled()) { - conf.setClass(YarnConfiguration.YARN_SECURITY_INFO, - SchedulerSecurityInfo.class, SecurityInfo.class); - String tokenURLEncodedStr = System.getenv().get( ApplicationConstants.APPLICATION_MASTER_TOKEN_ENV_NAME); LOG.debug("AppMasterToken is " + tokenURLEncodedStr); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java index e86eb279e9a..35bf9696c20 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryClientService.java @@ -101,12 +101,9 @@ public class HistoryClientService extends AbstractService { } public void start() { - YarnRPC rpc = YarnRPC.create(getConfig()); - Configuration conf = new Configuration(getConfig()); - conf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - ClientHSSecurityInfo.class, SecurityInfo.class); - initializeWebApp(getConfig()); + Configuration conf = getConfig(); + YarnRPC rpc = YarnRPC.create(conf); + initializeWebApp(conf); String serviceAddr = conf.get(JHAdminConfig.MR_HISTORY_ADDRESS, JHAdminConfig.DEFAULT_MR_HISTORY_ADDRESS); InetSocketAddress address = NetUtils.createSocketAddr(serviceAddr); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientCache.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientCache.java index 20c6ce7c000..24c13e745df 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientCache.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientCache.java @@ -80,17 +80,14 @@ public class ClientCache { return null; } LOG.info("Connecting to HistoryServer at: " + serviceAddr); - final Configuration myConf = new Configuration(conf); - myConf.setClass(YarnConfiguration.YARN_SECURITY_INFO, - ClientHSSecurityInfo.class, SecurityInfo.class); - final YarnRPC rpc = YarnRPC.create(myConf); + final YarnRPC rpc = YarnRPC.create(conf); LOG.info("Connected to HistoryServer at: " + serviceAddr); UserGroupInformation currentUser = UserGroupInformation.getCurrentUser(); return currentUser.doAs(new PrivilegedAction() { @Override public MRClientProtocol run() { return (MRClientProtocol) rpc.getProxy(MRClientProtocol.class, - NetUtils.createSocketAddr(serviceAddr), myConf); + NetUtils.createSocketAddr(serviceAddr), conf); } }); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java index 4b848b5cd3a..20817af8e1b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java @@ -243,13 +243,9 @@ public class ClientServiceDelegate { realProxy = currentUser.doAs(new PrivilegedAction() { @Override public MRClientProtocol run() { - Configuration myConf = new Configuration(conf); - myConf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - SchedulerSecurityInfo.class, SecurityInfo.class); - YarnRPC rpc = YarnRPC.create(myConf); + YarnRPC rpc = YarnRPC.create(conf); return (MRClientProtocol) rpc.getProxy(MRClientProtocol.class, - NetUtils.createSocketAddr(serviceAddr), myConf); + NetUtils.createSocketAddr(serviceAddr), conf); } }); LOG.trace("Connected to ApplicationMaster at: " + serviceAddr); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java index 8b7c818b1e3..180ecbe9d69 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java @@ -91,13 +91,9 @@ public class ResourceMgrDelegate { YarnConfiguration.RM_ADDRESS, YarnConfiguration.DEFAULT_RM_ADDRESS)); LOG.info("Connecting to ResourceManager at " + rmAddress); - Configuration appsManagerServerConf = new Configuration(this.conf); - appsManagerServerConf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - ClientRMSecurityInfo.class, SecurityInfo.class); applicationsManager = (ClientRMProtocol) rpc.getProxy(ClientRMProtocol.class, - rmAddress, appsManagerServerConf); + rmAddress, this.conf); LOG.info("Connected to ResourceManager at " + rmAddress); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java index 63be4cbcc50..caccb2615cb 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java @@ -724,10 +724,8 @@ public class Client { YarnConfiguration.RM_ADDRESS, YarnConfiguration.DEFAULT_RM_ADDRESS)); LOG.info("Connecting to ResourceManager at " + rmAddress); - Configuration appsManagerServerConf = new Configuration(conf); - appsManagerServerConf.setClass(YarnConfiguration.YARN_SECURITY_INFO, - ClientRMSecurityInfo.class, SecurityInfo.class); - applicationsManager = ((ClientRMProtocol) rpc.getProxy(ClientRMProtocol.class, rmAddress, appsManagerServerConf)); + applicationsManager = ((ClientRMProtocol) rpc.getProxy( + ClientRMProtocol.class, rmAddress, conf)); } /** diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java index cb955af8c43..780561d81aa 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java @@ -44,14 +44,7 @@ public class YarnConfiguration extends Configuration { /** ACL of who can modify this application.*/ public static final String APPLICATION_ACL_MODIFY_APP = "yarn.app.acl.modify-job"; - - /** - * Security info class This is an internal config set and - * read by YARN itself. - */ - public static final String YARN_SECURITY_INFO = - "yarn.security.info.class"; - + /** Delay before deleting resource to ease debugging of NM issues */ public static final String DEBUG_NM_DELETE_DELAY_SEC = YarnConfiguration.NM_PREFIX + "delete.debug-delay-sec"; diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/HadoopYarnProtoRPC.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/HadoopYarnProtoRPC.java index 37096ba54ce..885682111e3 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/HadoopYarnProtoRPC.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/HadoopYarnProtoRPC.java @@ -45,12 +45,9 @@ public class HadoopYarnProtoRPC extends YarnRPC { @Override public Object getProxy(Class protocol, InetSocketAddress addr, Configuration conf) { - Configuration myConf = new Configuration(conf); LOG.info("Creating a HadoopYarnProtoRpc proxy for protocol " + protocol); - LOG.debug("Configured SecurityInfo class name is " - + myConf.get(YarnConfiguration.YARN_SECURITY_INFO)); - - return RpcFactoryProvider.getClientFactory(myConf).getClient(protocol, 1, addr, myConf); + return RpcFactoryProvider.getClientFactory(conf).getClient(protocol, 1, + addr, conf); } @Override @@ -60,8 +57,6 @@ public class HadoopYarnProtoRPC extends YarnRPC { int numHandlers) { LOG.info("Creating a HadoopYarnProtoRpc server for protocol " + protocol + " with " + numHandlers + " handlers"); - LOG.info("Configured SecurityInfo class name is " - + conf.get(YarnConfiguration.YARN_SECURITY_INFO)); final RPC.Server hadoopServer; hadoopServer = diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/HadoopYarnRPC.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/HadoopYarnRPC.java index 3358189a4a0..9bd2ff03f3f 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/HadoopYarnRPC.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/HadoopYarnRPC.java @@ -46,13 +46,10 @@ public class HadoopYarnRPC extends YarnRPC { @Override public Object getProxy(Class protocol, InetSocketAddress addr, Configuration conf) { - Configuration myConf = new Configuration(conf); LOG.info("Creating a HadoopYarnRpc proxy for protocol " + protocol); - LOG.debug("Configured SecurityInfo class name is " - + myConf.get(YarnConfiguration.YARN_SECURITY_INFO)); - RPC.setProtocolEngine(myConf, protocol, AvroSpecificRpcEngine.class); + RPC.setProtocolEngine(conf, protocol, AvroSpecificRpcEngine.class); try { - return RPC.getProxy(protocol, 1, addr, myConf); + return RPC.getProxy(protocol, 1, addr, conf); } catch (IOException e) { throw new YarnException(e); } @@ -65,8 +62,6 @@ public class HadoopYarnRPC extends YarnRPC { int numHandlers) { LOG.info("Creating a HadoopYarnRpc server for protocol " + protocol + " with " + numHandlers + " handlers"); - LOG.info("Configured SecurityInfo class name is " - + conf.get(YarnConfiguration.YARN_SECURITY_INFO)); RPC.setProtocolEngine(conf, protocol, AvroSpecificRpcEngine.class); final RPC.Server hadoopServer; try { diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java index e69ca7ba31d..f5d0c528b2b 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java @@ -139,14 +139,11 @@ public class NodeStatusUpdaterImpl extends AbstractService implements } protected ResourceTracker getRMClient() { - YarnRPC rpc = YarnRPC.create(getConfig()); + Configuration conf = getConfig(); + YarnRPC rpc = YarnRPC.create(conf); InetSocketAddress rmAddress = NetUtils.createSocketAddr(this.rmAddress); - Configuration rmClientConf = new Configuration(getConfig()); - rmClientConf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - RMNMSecurityInfoClass.class, SecurityInfo.class); return (ResourceTracker) rpc.getProxy(ResourceTracker.class, rmAddress, - rmClientConf); + conf); } private void registerWithRM() throws YarnRemoteException { diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java index 7c79bd982fe..3c92c0b53c5 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java @@ -192,13 +192,10 @@ public class ContainerManagerImpl extends CompositeService implements InetSocketAddress initialAddress = NetUtils.createSocketAddr(conf.get( YarnConfiguration.NM_ADDRESS, YarnConfiguration.DEFAULT_NM_ADDRESS)); - Configuration cmConf = new Configuration(conf); - cmConf.setClass(YarnConfiguration.YARN_SECURITY_INFO, - ContainerManagerSecurityInfo.class, SecurityInfo.class); server = - rpc.getServer(ContainerManager.class, this, initialAddress, cmConf, + rpc.getServer(ContainerManager.class, this, initialAddress, conf, this.containerTokenSecretManager, - cmConf.getInt(YarnConfiguration.NM_CONTAINER_MGR_THREAD_COUNT, + conf.getInt(YarnConfiguration.NM_CONTAINER_MGR_THREAD_COUNT, YarnConfiguration.DEFAULT_NM_CONTAINER_MGR_THREAD_COUNT)); server.start(); InetAddress hostNameResolved = null; diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ContainerLocalizer.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ContainerLocalizer.java index fc302c2481a..4c9a9bf5212 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ContainerLocalizer.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ContainerLocalizer.java @@ -114,15 +114,9 @@ public class ContainerLocalizer { } LocalizationProtocol getProxy(final InetSocketAddress nmAddr) { - Configuration localizerConf = new Configuration(); - YarnRPC rpc = YarnRPC.create(localizerConf); - if (UserGroupInformation.isSecurityEnabled()) { - localizerConf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - LocalizerSecurityInfo.class, SecurityInfo.class); - } + YarnRPC rpc = YarnRPC.create(conf); return (LocalizationProtocol) - rpc.getProxy(LocalizationProtocol.class, nmAddr, localizerConf); + rpc.getProxy(LocalizationProtocol.class, nmAddr, conf); } public int runLocalization(final InetSocketAddress nmAddr) diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java index ead650fab89..89d523436cc 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java @@ -227,13 +227,10 @@ public class ResourceLocalizationService extends CompositeService } Server createServer() { - YarnRPC rpc = YarnRPC.create(getConfig()); - Configuration conf = new Configuration(getConfig()); // Clone to separate - // sec-info classes + Configuration conf = getConfig(); + YarnRPC rpc = YarnRPC.create(conf); LocalizerTokenSecretManager secretManager = null; if (UserGroupInformation.isSecurityEnabled()) { - conf.setClass(YarnConfiguration.YARN_SECURITY_INFO, - LocalizerSecurityInfo.class, SecurityInfo.class); secretManager = new LocalizerTokenSecretManager(); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java index 6237f8961f0..7be950f3d19 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java @@ -92,15 +92,12 @@ public class AdminService extends AbstractService implements RMAdminProtocol { } public void start() { - YarnRPC rpc = YarnRPC.create(getConfig()); - Configuration serverConf = new Configuration(getConfig()); - serverConf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - SchedulerSecurityInfo.class, SecurityInfo.class); + Configuration conf = getConfig(); + YarnRPC rpc = YarnRPC.create(conf); this.server = rpc.getServer(RMAdminProtocol.class, this, masterServiceAddress, - serverConf, null, - serverConf.getInt(YarnConfiguration.RM_ADMIN_CLIENT_THREAD_COUNT, + conf, null, + conf.getInt(YarnConfiguration.RM_ADMIN_CLIENT_THREAD_COUNT, YarnConfiguration.DEFAULT_RM_ADMIN_CLIENT_THREAD_COUNT)); this.server.start(); super.start(); diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java index 8601545229e..bcc8c08daec 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java @@ -98,14 +98,12 @@ public class ApplicationMasterService extends AbstractService implements @Override public void start() { - YarnRPC rpc = YarnRPC.create(getConfig()); - Configuration serverConf = new Configuration(getConfig()); - serverConf.setClass(YarnConfiguration.YARN_SECURITY_INFO, - SchedulerSecurityInfo.class, SecurityInfo.class); + Configuration conf = getConfig(); + YarnRPC rpc = YarnRPC.create(conf); this.server = rpc.getServer(AMRMProtocol.class, this, masterServiceAddress, - serverConf, this.appTokenManager, - serverConf.getInt(YarnConfiguration.RM_SCHEDULER_CLIENT_THREAD_COUNT, + conf, this.appTokenManager, + conf.getInt(YarnConfiguration.RM_SCHEDULER_CLIENT_THREAD_COUNT, YarnConfiguration.DEFAULT_RM_SCHEDULER_CLIENT_THREAD_COUNT)); this.server.start(); super.start(); diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java index b576307ef1c..01eab2111be 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java @@ -125,16 +125,13 @@ public class ClientRMService extends AbstractService implements public void start() { // All the clients to appsManager are supposed to be authenticated via // Kerberos if security is enabled, so no secretManager. - YarnRPC rpc = YarnRPC.create(getConfig()); - Configuration clientServerConf = new Configuration(getConfig()); - clientServerConf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - ClientRMSecurityInfo.class, SecurityInfo.class); + Configuration conf = getConfig(); + YarnRPC rpc = YarnRPC.create(conf); this.server = rpc.getServer(ClientRMProtocol.class, this, clientBindAddress, - clientServerConf, null, - clientServerConf.getInt(YarnConfiguration.RM_CLIENT_THREAD_COUNT, + conf, null, + conf.getInt(YarnConfiguration.RM_CLIENT_THREAD_COUNT, YarnConfiguration.DEFAULT_RM_CLIENT_THREAD_COUNT)); this.server.start(); super.start(); diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceTrackerService.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceTrackerService.java index d8c2d2c5433..a80736d4bdd 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceTrackerService.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceTrackerService.java @@ -109,15 +109,12 @@ public class ResourceTrackerService extends AbstractService implements super.start(); // ResourceTrackerServer authenticates NodeManager via Kerberos if // security is enabled, so no secretManager. - YarnRPC rpc = YarnRPC.create(getConfig()); - Configuration rtServerConf = new Configuration(getConfig()); - rtServerConf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - RMNMSecurityInfoClass.class, SecurityInfo.class); + Configuration conf = getConfig(); + YarnRPC rpc = YarnRPC.create(conf); this.server = rpc.getServer(ResourceTracker.class, this, resourceTrackerAddress, - rtServerConf, null, - rtServerConf.getInt(YarnConfiguration.RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT, + conf, null, + conf.getInt(YarnConfiguration.RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT, YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT)); this.server.start(); diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java index 337f4816890..07aac74f799 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java @@ -92,12 +92,9 @@ public class AMLauncher implements Runnable { ApplicationTokenSecretManager applicationTokenSecretManager, ClientToAMSecretManager clientToAMSecretManager, Configuration conf) { this.application = application; - this.conf = new Configuration(conf); // Just not to touch the sec-info class + this.conf = conf; this.applicationTokenSecretManager = applicationTokenSecretManager; this.clientToAMSecretManager = clientToAMSecretManager; - this.conf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - ContainerManagerSecurityInfo.class, SecurityInfo.class); this.eventType = eventType; this.handler = rmContext.getDispatcher().getEventHandler(); } diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/tools/RMAdmin.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/tools/RMAdmin.java index 3c367a6a6b2..84e48f039f8 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/tools/RMAdmin.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/tools/RMAdmin.java @@ -23,7 +23,6 @@ import java.security.PrivilegedAction; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; -import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.security.SecurityInfo; @@ -149,11 +148,6 @@ public class RMAdmin extends Configured implements Tool { YarnConfiguration.RM_ADMIN_ADDRESS); final YarnRPC rpc = YarnRPC.create(conf); - if (UserGroupInformation.isSecurityEnabled()) { - conf.setClass(YarnConfiguration.YARN_SECURITY_INFO, - AdminSecurityInfo.class, SecurityInfo.class); - } - RMAdminProtocol adminProtocol = getUGI(conf).doAs(new PrivilegedAction() { @Override diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java index 1b681628c98..e4178300c19 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java @@ -209,9 +209,6 @@ public class TestContainerTokenSecretManager { appToken.setService(new Text(schedulerAddressString)); currentUser.addToken(appToken); - conf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - SchedulerSecurityInfo.class, SecurityInfo.class); AMRMProtocol scheduler = currentUser.doAs(new PrivilegedAction() { @Override @@ -271,9 +268,6 @@ public class TestContainerTokenSecretManager { containerToken.getKind()), new Text( containerToken.getService())); currentUser.addToken(token); - conf.setClass( - YarnConfiguration.YARN_SECURITY_INFO, - ContainerManagerSecurityInfo.class, SecurityInfo.class); currentUser.doAs(new PrivilegedAction() { @Override public Void run() {