diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 9fb988f545..6be1efbc88 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -341,6 +341,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 f84a4d9dbe..faf11a117c 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 MRClientService(AppContext appContext) { } 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 void start() { 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 95e17d8f4f..6e7996b6da 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 ContainerLauncherImpl(AppContext context) { @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 6655581178..91d60c2081 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 void run() { 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 @@ protected AMRMProtocol createSchedulerProxy() { } 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 e86eb279e9..35bf9696c2 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 HistoryClientService(HistoryContext history) { } 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 20c6ce7c00..24c13e745d 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 @@ private MRClientProtocol instantiateHistoryProxy() 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 4b848b5cd3..20817af8e1 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 @@ private void instantiateAMProxy(final String serviceAddr) throws IOException { 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 8b7c818b1e..180ecbe9d6 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 ResourceMgrDelegate(YarnConfiguration conf) { 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 63be4cbcc5..caccb2615c 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 ClientRMProtocol run() { 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 cb955af8c4..780561d81a 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 37096ba54c..885682111e 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 Server getServer(Class protocol, Object instance, 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 3358189a4a..9bd2ff03f3 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 Server getServer(Class protocol, Object instance, 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 e69ca7ba31..f5d0c528b2 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 synchronized void stop() { } 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 7c79bd982f..3c92c0b53c 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 void start() { 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 fc302c2481..4c9a9bf521 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 ContainerLocalizer(FileContext lfs, String user, String appId, } 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 ead650fab8..89d523436c 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 @@ LocalizerTracker createLocalizerTracker(Configuration conf) { } 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 6237f8961f..7be950f3d1 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 void init(Configuration conf) { } 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 8601545229..bcc8c08dae 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 void init(Configuration conf) { @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 b576307ef1..01eab2111b 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 void init(Configuration conf) { 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 d8c2d2c543..a80736d4bd 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 synchronized void start() { 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 337f481689..07aac74f79 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 AMLauncher(RMContext rmContext, RMAppAttempt application, 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 3c367a6a6b..84e48f039f 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 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 @@ private RMAdminProtocol createAdminProtocol() throws IOException { 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 1b681628c9..e4178300c1 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 void test() throws IOException, InterruptedException { 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 AMRMProtocol run() { 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() {