You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by vi...@apache.org on 2013/05/06 21:04:33 UTC
svn commit: r1479680 - in /hadoop/common/trunk/hadoop-mapreduce-project: ./
hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/
hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main...
Author: vinodkv
Date: Mon May 6 19:04:31 2013
New Revision: 1479680
URL: http://svn.apache.org/r1479680
Log:
YARN-629. Make YarnRemoteException not be rooted at IOException. Contributed by Xuan Gong.
MAPREDUCE-5204. Handling YarnRemoteException separately from IOException in MR app after YARN-629. Contributed by Xuan Gong.
Modified:
hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/MRDelegationTokenRenewer.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientServiceDelegate.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestResourceMgrDelegate.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java
hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
Modified: hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt Mon May 6 19:04:31 2013
@@ -377,6 +377,9 @@ Release 2.0.5-beta - UNRELEASED
MAPREDUCE-5205. Fixed MR App to load tokens correctly. (vinodkv)
+ MAPREDUCE-5204. Handling YarnRemoteException separately from IOException in
+ MR app after YARN-629. (Xuan Gong via vinodkv)
+
Release 2.0.4-alpha - UNRELEASED
INCOMPATIBLE CHANGES
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/MRDelegationTokenRenewer.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/MRDelegationTokenRenewer.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/MRDelegationTokenRenewer.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/security/MRDelegationTokenRenewer.java Mon May 6 19:04:31 2013
@@ -37,6 +37,7 @@ import org.apache.hadoop.security.UserGr
import org.apache.hadoop.security.token.Token;
import org.apache.hadoop.security.token.TokenRenewer;
import org.apache.hadoop.yarn.api.records.DelegationToken;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
import org.apache.hadoop.yarn.ipc.YarnRPC;
import org.apache.hadoop.yarn.util.BuilderUtils;
import org.apache.hadoop.yarn.util.Records;
@@ -67,6 +68,8 @@ public class MRDelegationTokenRenewer ex
.newRecord(RenewDelegationTokenRequest.class);
request.setDelegationToken(dToken);
return histProxy.renewDelegationToken(request).getNextExpirationTime();
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
} finally {
stopHistoryProxy(histProxy);
}
@@ -88,6 +91,8 @@ public class MRDelegationTokenRenewer ex
.newRecord(CancelDelegationTokenRequest.class);
request.setDelegationToken(dToken);
histProxy.cancelDelegationToken(request);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
} finally {
stopHistoryProxy(histProxy);
}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java Mon May 6 19:04:31 2013
@@ -302,13 +302,13 @@ public class ClientServiceDelegate {
return methodOb.invoke(getProxy(), args);
} catch (YarnRemoteException yre) {
LOG.warn("Exception thrown by remote end.", yre);
- throw yre;
+ throw new IOException(yre);
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof YarnRemoteException) {
LOG.warn("Error from remote end: " + e
.getTargetException().getLocalizedMessage());
LOG.debug("Tracing remote error ", e.getTargetException());
- throw (YarnRemoteException) e.getTargetException();
+ throw new IOException(e.getTargetException());
}
LOG.debug("Failed to contact AM/History for job " + jobId +
" retrying..", e.getTargetException());
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ResourceMgrDelegate.java Mon May 6 19:04:31 2013
@@ -43,6 +43,7 @@ import org.apache.hadoop.yarn.api.record
import org.apache.hadoop.yarn.api.records.YarnClusterMetrics;
import org.apache.hadoop.yarn.client.YarnClientImpl;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
import org.apache.hadoop.yarn.util.ProtoUtils;
public class ResourceMgrDelegate extends YarnClientImpl {
@@ -65,11 +66,19 @@ public class ResourceMgrDelegate extends
public TaskTrackerInfo[] getActiveTrackers() throws IOException,
InterruptedException {
- return TypeConverter.fromYarnNodes(super.getNodeReports());
+ try {
+ return TypeConverter.fromYarnNodes(super.getNodeReports());
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public JobStatus[] getAllJobs() throws IOException, InterruptedException {
- return TypeConverter.fromYarnApps(super.getApplicationList(), this.conf);
+ try {
+ return TypeConverter.fromYarnApps(super.getApplicationList(), this.conf);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public TaskTrackerInfo[] getBlacklistedTrackers() throws IOException,
@@ -81,11 +90,17 @@ public class ResourceMgrDelegate extends
public ClusterMetrics getClusterMetrics() throws IOException,
InterruptedException {
- YarnClusterMetrics metrics = super.getYarnClusterMetrics();
- ClusterMetrics oldMetrics = new ClusterMetrics(1, 1, 1, 1, 1, 1,
- metrics.getNumNodeManagers() * 10, metrics.getNumNodeManagers() * 2, 1,
- metrics.getNumNodeManagers(), 0, 0);
- return oldMetrics;
+ try {
+ YarnClusterMetrics metrics = super.getYarnClusterMetrics();
+ ClusterMetrics oldMetrics =
+ new ClusterMetrics(1, 1, 1, 1, 1, 1,
+ metrics.getNumNodeManagers() * 10,
+ metrics.getNumNodeManagers() * 2, 1,
+ metrics.getNumNodeManagers(), 0, 0);
+ return oldMetrics;
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
InetSocketAddress getConnectAddress() {
@@ -95,8 +110,12 @@ public class ResourceMgrDelegate extends
@SuppressWarnings("rawtypes")
public Token getDelegationToken(Text renewer) throws IOException,
InterruptedException {
- return ProtoUtils.convertFromProtoFormat(
- super.getRMDelegationToken(renewer), rmAddress);
+ try {
+ return ProtoUtils.convertFromProtoFormat(
+ super.getRMDelegationToken(renewer), rmAddress);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public String getFilesystemName() throws IOException, InterruptedException {
@@ -104,36 +123,62 @@ public class ResourceMgrDelegate extends
}
public JobID getNewJobID() throws IOException, InterruptedException {
- this.application = super.getNewApplication();
- this.applicationId = this.application.getApplicationId();
- return TypeConverter.fromYarn(applicationId);
+ try {
+ this.application = super.getNewApplication();
+ this.applicationId = this.application.getApplicationId();
+ return TypeConverter.fromYarn(applicationId);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public QueueInfo getQueue(String queueName) throws IOException,
InterruptedException {
- org.apache.hadoop.yarn.api.records.QueueInfo queueInfo =
- super.getQueueInfo(queueName);
- return (queueInfo == null) ? null : TypeConverter.fromYarn(queueInfo, conf);
+ try {
+ org.apache.hadoop.yarn.api.records.QueueInfo queueInfo =
+ super.getQueueInfo(queueName);
+ return (queueInfo == null) ? null : TypeConverter.fromYarn(queueInfo,
+ conf);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public QueueAclsInfo[] getQueueAclsForCurrentUser() throws IOException,
InterruptedException {
- return TypeConverter.fromYarnQueueUserAclsInfo(super
- .getQueueAclsInfo());
+ try {
+ return TypeConverter.fromYarnQueueUserAclsInfo(super
+ .getQueueAclsInfo());
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public QueueInfo[] getQueues() throws IOException, InterruptedException {
- return TypeConverter.fromYarnQueueInfo(super.getAllQueues(), this.conf);
+ try {
+ return TypeConverter.fromYarnQueueInfo(super.getAllQueues(), this.conf);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public QueueInfo[] getRootQueues() throws IOException, InterruptedException {
- return TypeConverter.fromYarnQueueInfo(super.getRootQueueInfos(), this.conf);
+ try {
+ return TypeConverter.fromYarnQueueInfo(super.getRootQueueInfos(),
+ this.conf);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public QueueInfo[] getChildQueues(String parent) throws IOException,
InterruptedException {
- return TypeConverter.fromYarnQueueInfo(super.getChildQueueInfos(parent),
- this.conf);
+ try {
+ return TypeConverter.fromYarnQueueInfo(super.getChildQueueInfos(parent),
+ this.conf);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
public String getStagingAreaDir() throws IOException, InterruptedException {
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java Mon May 6 19:04:31 2013
@@ -80,6 +80,7 @@ import org.apache.hadoop.yarn.api.record
import org.apache.hadoop.yarn.api.records.URL;
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
import org.apache.hadoop.yarn.factories.RecordFactory;
import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
import org.apache.hadoop.yarn.security.client.RMTokenSelector;
@@ -207,10 +208,15 @@ public class YARNRunner implements Clien
GetDelegationTokenRequest request = recordFactory
.newRecordInstance(GetDelegationTokenRequest.class);
request.setRenewer(Master.getMasterPrincipal(conf));
- DelegationToken mrDelegationToken = hsProxy.getDelegationToken(request)
- .getDelegationToken();
- return ProtoUtils.convertFromProtoFormat(mrDelegationToken,
- hsProxy.getConnectAddress());
+ DelegationToken mrDelegationToken;
+ try {
+ mrDelegationToken = hsProxy.getDelegationToken(request)
+ .getDelegationToken();
+ return ProtoUtils.convertFromProtoFormat(mrDelegationToken,
+ hsProxy.getConnectAddress());
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
@Override
@@ -295,19 +301,25 @@ public class YARNRunner implements Clien
createApplicationSubmissionContext(conf, jobSubmitDir, ts);
// Submit to ResourceManager
- ApplicationId applicationId = resMgrDelegate.submitApplication(appContext);
+ try {
+ ApplicationId applicationId =
+ resMgrDelegate.submitApplication(appContext);
- ApplicationReport appMaster = resMgrDelegate
- .getApplicationReport(applicationId);
- String diagnostics =
- (appMaster == null ?
- "application report is null" : appMaster.getDiagnostics());
- if (appMaster == null || appMaster.getYarnApplicationState() == YarnApplicationState.FAILED
- || appMaster.getYarnApplicationState() == YarnApplicationState.KILLED) {
- throw new IOException("Failed to run job : " +
- diagnostics);
+ ApplicationReport appMaster = resMgrDelegate
+ .getApplicationReport(applicationId);
+ String diagnostics =
+ (appMaster == null ?
+ "application report is null" : appMaster.getDiagnostics());
+ if (appMaster == null
+ || appMaster.getYarnApplicationState() == YarnApplicationState.FAILED
+ || appMaster.getYarnApplicationState() == YarnApplicationState.KILLED) {
+ throw new IOException("Failed to run job : " +
+ diagnostics);
+ }
+ return clientCache.getClient(jobId).getJobStatus(jobId);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
}
- return clientCache.getClient(jobId).getJobStatus(jobId);
}
private LocalResource createApplicationResource(FileContext fs, Path p, LocalResourceType type)
@@ -552,7 +564,11 @@ public class YARNRunner implements Clien
/* check if the status is not running, if not send kill to RM */
JobStatus status = clientCache.getClient(arg0).getJobStatus(arg0);
if (status.getState() != JobStatus.State.RUNNING) {
- resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
+ try {
+ resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
return;
}
@@ -576,7 +592,11 @@ public class YARNRunner implements Clien
LOG.debug("Error when checking for application status", io);
}
if (status.getState() != JobStatus.State.KILLED) {
- resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
+ try {
+ resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
}
@@ -607,7 +627,11 @@ public class YARNRunner implements Clien
@Override
public LogParams getLogFileParams(JobID jobID, TaskAttemptID taskAttemptID)
throws IOException {
- return clientCache.getClient(jobID).getLogFilePath(jobID, taskAttemptID);
+ try {
+ return clientCache.getClient(jobID).getLogFilePath(jobID, taskAttemptID);
+ } catch (YarnRemoteException e) {
+ throw new IOException(e);
+ }
}
private static void warnForJavaLibPath(String opts, String component,
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientServiceDelegate.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientServiceDelegate.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientServiceDelegate.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClientServiceDelegate.java Mon May 6 19:04:31 2013
@@ -115,8 +115,9 @@ public class TestClientServiceDelegate {
try {
clientServiceDelegate.getJobStatus(oldJobId);
Assert.fail("Invoke should throw exception after retries.");
- } catch (YarnRemoteException e) {
- Assert.assertEquals("Job ID doesnot Exist", e.getMessage());
+ } catch (IOException e) {
+ Assert.assertTrue(e.getMessage().contains(
+ "Job ID doesnot Exist"));
}
}
@@ -198,7 +199,8 @@ public class TestClientServiceDelegate {
}
@Test
- public void testReconnectOnAMRestart() throws IOException {
+ public void testReconnectOnAMRestart() throws IOException,
+ YarnRemoteException {
//test not applicable when AM not reachable
//as instantiateAMProxy is not called at all
if(!isAMReachableFromClient) {
@@ -265,7 +267,7 @@ public class TestClientServiceDelegate {
}
@Test
- public void testAMAccessDisabled() throws IOException {
+ public void testAMAccessDisabled() throws IOException, YarnRemoteException {
//test only applicable when AM not reachable
if(isAMReachableFromClient) {
return;
@@ -317,7 +319,8 @@ public class TestClientServiceDelegate {
}
@Test
- public void testRMDownForJobStatusBeforeGetAMReport() throws IOException {
+ public void testRMDownForJobStatusBeforeGetAMReport() throws IOException,
+ YarnRemoteException {
Configuration conf = new YarnConfiguration();
testRMDownForJobStatusBeforeGetAMReport(conf,
MRJobConfig.DEFAULT_MR_CLIENT_MAX_RETRIES);
@@ -325,7 +328,7 @@ public class TestClientServiceDelegate {
@Test
public void testRMDownForJobStatusBeforeGetAMReportWithRetryTimes()
- throws IOException {
+ throws IOException, YarnRemoteException {
Configuration conf = new YarnConfiguration();
conf.setInt(MRJobConfig.MR_CLIENT_MAX_RETRIES, 2);
testRMDownForJobStatusBeforeGetAMReport(conf, conf.getInt(
@@ -335,7 +338,7 @@ public class TestClientServiceDelegate {
@Test
public void testRMDownRestoreForJobStatusBeforeGetAMReport()
- throws IOException {
+ throws IOException, YarnRemoteException {
Configuration conf = new YarnConfiguration();
conf.setInt(MRJobConfig.MR_CLIENT_MAX_RETRIES, 3);
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestResourceMgrDelegate.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestResourceMgrDelegate.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestResourceMgrDelegate.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestResourceMgrDelegate.java Mon May 6 19:04:31 2013
@@ -38,6 +38,7 @@ import org.apache.hadoop.yarn.api.record
import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
import org.apache.hadoop.yarn.util.Records;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -47,9 +48,12 @@ public class TestResourceMgrDelegate {
/**
* Tests that getRootQueues makes a request for the (recursive) child queues
+ * @throws YarnRemoteException
+ * @throws IOException
*/
@Test
- public void testGetRootQueues() throws IOException, InterruptedException {
+ public void testGetRootQueues() throws IOException, InterruptedException,
+ YarnRemoteException {
final ClientRMProtocol applicationsManager = Mockito.mock(ClientRMProtocol.class);
GetQueueInfoResponse response = Mockito.mock(GetQueueInfoResponse.class);
org.apache.hadoop.yarn.api.records.QueueInfo queueInfo =
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java Mon May 6 19:04:31 2013
@@ -40,7 +40,6 @@ import org.apache.hadoop.mapreduce.tools
import org.apache.hadoop.util.ExitUtil;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
-import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
/**
test CLI class. CLI class implemented the Tool interface.
@@ -155,7 +154,7 @@ public class TestMRJobClient extends Clu
try {
runTool(conf, jc, new String[] { "-fail-task", taid.toString() }, out);
fail(" this task should field");
- } catch (YarnRemoteException e) {
+ } catch (IOException e) {
// task completed !
assertTrue(e.getMessage().contains("_0001_m_000000_1"));
}
@@ -175,7 +174,7 @@ public class TestMRJobClient extends Clu
try {
runTool(conf, jc, new String[] { "-kill-task", taid.toString() }, out);
fail(" this task should be killed");
- } catch (YarnRemoteException e) {
+ } catch (IOException e) {
// task completed
assertTrue(e.getMessage().contains("_0001_m_000000_1"));
}
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestJHSSecurity.java Mon May 6 19:04:31 2013
@@ -62,7 +62,8 @@ public class TestJHSSecurity {
private static final Log LOG = LogFactory.getLog(TestJHSSecurity.class);
@Test
- public void testDelegationToken() throws IOException, InterruptedException {
+ public void testDelegationToken() throws IOException, InterruptedException,
+ YarnRemoteException {
Logger rootLogger = LogManager.getRootLogger();
rootLogger.setLevel(Level.DEBUG);
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java?rev=1479680&r1=1479679&r2=1479680&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobsWithHistoryService.java Mon May 6 19:04:31 2013
@@ -46,6 +46,7 @@ import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ContainerId;
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
import org.apache.hadoop.yarn.ipc.YarnRPC;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState;
import org.apache.hadoop.yarn.util.BuilderUtils;
@@ -114,7 +115,7 @@ public class TestMRJobsWithHistoryServic
@Test (timeout = 30000)
public void testJobHistoryData() throws IOException, InterruptedException,
- AvroRemoteException, ClassNotFoundException {
+ AvroRemoteException, ClassNotFoundException, YarnRemoteException {
if (!(new File(MiniMRYarnCluster.APPJAR)).exists()) {
LOG.info("MRAppJar " + MiniMRYarnCluster.APPJAR
+ " not found. Not running test.");