Merge -r 1167330:1167331 from trunk to branch-0.23 to fix MAPREDUCE-2975.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1167332 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2011-09-09 19:01:39 +00:00
parent 23b9aea740
commit 4cc34c9cdd
4 changed files with 13 additions and 8 deletions

View File

@ -1246,6 +1246,9 @@ Release 0.23.0 - Unreleased
MAPREDUCE-2954. Fixed a deadlock in NM caused due to wrong synchronization MAPREDUCE-2954. Fixed a deadlock in NM caused due to wrong synchronization
in protocol buffer records. (Siddharth Seth via vinodkv) in protocol buffer records. (Siddharth Seth via vinodkv)
MAPREDUCE-2975. Fixed YARNRunner to use YarnConfiguration rather than
Configuration. (mahadev via acmurthy)
Release 0.22.0 - Unreleased Release 0.22.0 - Unreleased
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -101,18 +101,18 @@ public class YARNRunner implements ClientProtocol {
* yarn * yarn
* @param conf the configuration object for the client * @param conf the configuration object for the client
*/ */
public YARNRunner(Configuration conf) { public YARNRunner(YarnConfiguration conf) {
this(conf, new ResourceMgrDelegate(conf)); this(conf, new ResourceMgrDelegate(conf));
} }
/** /**
* Similar to {@link #YARNRunner(Configuration)} but allowing injecting * Similar to {@link #YARNRunner(YarnConfiguration)} but allowing injecting
* {@link ResourceMgrDelegate}. Enables mocking and testing. * {@link ResourceMgrDelegate}. Enables mocking and testing.
* @param conf the configuration object for the client * @param conf the configuration object for the client
* @param resMgrDelegate the resourcemanager client handle. * @param resMgrDelegate the resourcemanager client handle.
*/ */
public YARNRunner(Configuration conf, ResourceMgrDelegate resMgrDelegate) { public YARNRunner(YarnConfiguration conf, ResourceMgrDelegate resMgrDelegate) {
this.conf = new YarnConfiguration(conf); this.conf = conf;
try { try {
this.resMgrDelegate = resMgrDelegate; this.resMgrDelegate = resMgrDelegate;
this.clientCache = new ClientCache(this.conf, this.clientCache = new ClientCache(this.conf,

View File

@ -25,13 +25,14 @@
import org.apache.hadoop.mapreduce.MRConfig; import org.apache.hadoop.mapreduce.MRConfig;
import org.apache.hadoop.mapreduce.protocol.ClientProtocol; import org.apache.hadoop.mapreduce.protocol.ClientProtocol;
import org.apache.hadoop.mapreduce.protocol.ClientProtocolProvider; import org.apache.hadoop.mapreduce.protocol.ClientProtocolProvider;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
public class YarnClientProtocolProvider extends ClientProtocolProvider { public class YarnClientProtocolProvider extends ClientProtocolProvider {
@Override @Override
public ClientProtocol create(Configuration conf) throws IOException { public ClientProtocol create(Configuration conf) throws IOException {
if ("yarn".equals(conf.get(MRConfig.FRAMEWORK_NAME))) { if ("yarn".equals(conf.get(MRConfig.FRAMEWORK_NAME))) {
return new YARNRunner(conf); return new YARNRunner(new YarnConfiguration(conf));
} }
return null; return null;
} }

View File

@ -45,6 +45,7 @@
import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.ApplicationState; import org.apache.hadoop.yarn.api.records.ApplicationState;
import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext; import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.factories.RecordFactory; import org.apache.hadoop.yarn.factories.RecordFactory;
import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
import org.junit.Before; import org.junit.Before;
@ -63,7 +64,7 @@ public class TestYARNRunner extends TestCase {
private YARNRunner yarnRunner; private YARNRunner yarnRunner;
private ResourceMgrDelegate resourceMgrDelegate; private ResourceMgrDelegate resourceMgrDelegate;
private Configuration conf; private YarnConfiguration conf;
private ApplicationId appId; private ApplicationId appId;
private JobID jobId; private JobID jobId;
private File testWorkDir = private File testWorkDir =
@ -74,7 +75,7 @@ public class TestYARNRunner extends TestCase {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
resourceMgrDelegate = mock(ResourceMgrDelegate.class); resourceMgrDelegate = mock(ResourceMgrDelegate.class);
conf = new Configuration(); conf = new YarnConfiguration();
yarnRunner = new YARNRunner(conf, resourceMgrDelegate); yarnRunner = new YARNRunner(conf, resourceMgrDelegate);
yarnRunner = spy(yarnRunner); yarnRunner = spy(yarnRunner);
submissionContext = mock(ApplicationSubmissionContext.class); submissionContext = mock(ApplicationSubmissionContext.class);