diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 48f15b6b7be..6947a404b65 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -207,6 +207,8 @@ Release 2.1.0-beta - 2013-07-02 MAPREDUCE-5333. Add test that verifies MRAM works correctly when sending requests with non-normalized capabilities. (ywskycn via tucu) + MAPREDUCE-5398. MR changes for YARN-513 (Jian He via bikas) + OPTIMIZATIONS MAPREDUCE-4974. Optimising the LineRecordReader initialize() method 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 fb2cca31bd0..ca64cc83125 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 @@ -21,7 +21,6 @@ package org.apache.hadoop.mapreduce.v2.app.rm; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; -import java.security.PrivilegedAction; import java.util.Map; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicBoolean; @@ -50,12 +49,11 @@ import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.FinalApplicationStatus; import org.apache.hadoop.yarn.api.records.Resource; -import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.apache.hadoop.yarn.client.ClientRMProxy; import org.apache.hadoop.yarn.event.EventHandler; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.factories.RecordFactory; import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; -import org.apache.hadoop.yarn.ipc.YarnRPC; /** * Registers/unregisters to RM and sends heartbeats to RM. @@ -265,27 +263,12 @@ public abstract class RMCommunicator extends AbstractService protected ApplicationMasterProtocol createSchedulerProxy() { final Configuration conf = getConfig(); - final YarnRPC rpc = YarnRPC.create(conf); - final InetSocketAddress serviceAddr = conf.getSocketAddr( - YarnConfiguration.RM_SCHEDULER_ADDRESS, - YarnConfiguration.DEFAULT_RM_SCHEDULER_ADDRESS, - YarnConfiguration.DEFAULT_RM_SCHEDULER_PORT); - UserGroupInformation currentUser; try { - currentUser = UserGroupInformation.getCurrentUser(); + return ClientRMProxy.createRMProxy(conf, ApplicationMasterProtocol.class); } catch (IOException e) { throw new YarnRuntimeException(e); } - - // CurrentUser should already have AMToken loaded. - return currentUser.doAs(new PrivilegedAction() { - @Override - public ApplicationMasterProtocol run() { - return (ApplicationMasterProtocol) rpc.getProxy(ApplicationMasterProtocol.class, - serviceAddr, conf); - } - }); } protected abstract void heartbeat() throws Exception; 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 45242629fd4..efdd4fb6b45 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 @@ -75,36 +75,18 @@ public class ResourceMgrDelegate extends YarnClient { * @param conf the configuration object. */ public ResourceMgrDelegate(YarnConfiguration conf) { - this(conf, null); - } - - /** - * Delegate responsible for communicating with the Resource Manager's - * {@link ApplicationClientProtocol}. - * @param conf the configuration object. - * @param rmAddress the address of the Resource Manager - */ - public ResourceMgrDelegate(YarnConfiguration conf, - InetSocketAddress rmAddress) { super(ResourceMgrDelegate.class.getName()); this.conf = conf; - this.rmAddress = rmAddress; - if (rmAddress == null) { - client = YarnClient.createYarnClient(); - } else { - client = YarnClient.createYarnClient(rmAddress); - } + this.client = YarnClient.createYarnClient(); init(conf); start(); } @Override protected void serviceInit(Configuration conf) throws Exception { - if (rmAddress == null) { - this.rmAddress = conf.getSocketAddr(YarnConfiguration.RM_ADDRESS, + this.rmAddress = conf.getSocketAddr(YarnConfiguration.RM_ADDRESS, YarnConfiguration.DEFAULT_RM_ADDRESS, YarnConfiguration.DEFAULT_RM_PORT); - } client.init(conf); super.serviceInit(conf); }