|
@@ -313,7 +313,7 @@ public class MockRM extends ResourceManager {
|
|
boolean waitForAccepted, boolean keepContainers) throws Exception {
|
|
boolean waitForAccepted, boolean keepContainers) throws Exception {
|
|
return submitApp(masterMemory, name, user, acls, unmanaged, queue,
|
|
return submitApp(masterMemory, name, user, acls, unmanaged, queue,
|
|
maxAppAttempts, ts, appType, waitForAccepted, keepContainers,
|
|
maxAppAttempts, ts, appType, waitForAccepted, keepContainers,
|
|
- false, null, 0, null);
|
|
|
|
|
|
+ false, null, 0, null, true);
|
|
}
|
|
}
|
|
|
|
|
|
public RMApp submitApp(int masterMemory, long attemptFailuresValidityInterval)
|
|
public RMApp submitApp(int masterMemory, long attemptFailuresValidityInterval)
|
|
@@ -322,7 +322,7 @@ public class MockRM extends ResourceManager {
|
|
.getShortUserName(), null, false, null,
|
|
.getShortUserName(), null, false, null,
|
|
super.getConfig().getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
super.getConfig().getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS), null, null, true, false,
|
|
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS), null, null, true, false,
|
|
- false, null, attemptFailuresValidityInterval, null);
|
|
|
|
|
|
+ false, null, attemptFailuresValidityInterval, null, true);
|
|
}
|
|
}
|
|
|
|
|
|
public RMApp submitApp(int masterMemory, String name, String user,
|
|
public RMApp submitApp(int masterMemory, String name, String user,
|
|
@@ -332,26 +332,24 @@ public class MockRM extends ResourceManager {
|
|
ApplicationId applicationId) throws Exception {
|
|
ApplicationId applicationId) throws Exception {
|
|
return submitApp(masterMemory, name, user, acls, unmanaged, queue,
|
|
return submitApp(masterMemory, name, user, acls, unmanaged, queue,
|
|
maxAppAttempts, ts, appType, waitForAccepted, keepContainers,
|
|
maxAppAttempts, ts, appType, waitForAccepted, keepContainers,
|
|
- isAppIdProvided, applicationId, 0, null);
|
|
|
|
|
|
+ isAppIdProvided, applicationId, 0, null, true);
|
|
}
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("deprecation")
|
|
|
|
public RMApp submitApp(int masterMemory,
|
|
public RMApp submitApp(int masterMemory,
|
|
LogAggregationContext logAggregationContext) throws Exception {
|
|
LogAggregationContext logAggregationContext) throws Exception {
|
|
return submitApp(masterMemory, "", UserGroupInformation.getCurrentUser()
|
|
return submitApp(masterMemory, "", UserGroupInformation.getCurrentUser()
|
|
.getShortUserName(), null, false, null,
|
|
.getShortUserName(), null, false, null,
|
|
super.getConfig().getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
super.getConfig().getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS), null, null, true, false,
|
|
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS), null, null, true, false,
|
|
- false, null, 0, logAggregationContext);
|
|
|
|
|
|
+ false, null, 0, logAggregationContext, true);
|
|
}
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("deprecation")
|
|
|
|
public RMApp submitApp(int masterMemory, String name, String user,
|
|
public RMApp submitApp(int masterMemory, String name, String user,
|
|
Map<ApplicationAccessType, String> acls, boolean unmanaged, String queue,
|
|
Map<ApplicationAccessType, String> acls, boolean unmanaged, String queue,
|
|
int maxAppAttempts, Credentials ts, String appType,
|
|
int maxAppAttempts, Credentials ts, String appType,
|
|
boolean waitForAccepted, boolean keepContainers, boolean isAppIdProvided,
|
|
boolean waitForAccepted, boolean keepContainers, boolean isAppIdProvided,
|
|
ApplicationId applicationId, long attemptFailuresValidityInterval,
|
|
ApplicationId applicationId, long attemptFailuresValidityInterval,
|
|
- LogAggregationContext logAggregationContext)
|
|
|
|
|
|
+ LogAggregationContext logAggregationContext, boolean cancelTokensWhenComplete)
|
|
throws Exception {
|
|
throws Exception {
|
|
ApplicationId appId = isAppIdProvided ? applicationId : null;
|
|
ApplicationId appId = isAppIdProvided ? applicationId : null;
|
|
ApplicationClientProtocol client = getClientRMService();
|
|
ApplicationClientProtocol client = getClientRMService();
|
|
@@ -392,6 +390,7 @@ public class MockRM extends ResourceManager {
|
|
if (logAggregationContext != null) {
|
|
if (logAggregationContext != null) {
|
|
sub.setLogAggregationContext(logAggregationContext);
|
|
sub.setLogAggregationContext(logAggregationContext);
|
|
}
|
|
}
|
|
|
|
+ sub.setCancelTokensWhenComplete(cancelTokensWhenComplete);
|
|
req.setApplicationSubmissionContext(sub);
|
|
req.setApplicationSubmissionContext(sub);
|
|
UserGroupInformation fakeUser =
|
|
UserGroupInformation fakeUser =
|
|
UserGroupInformation.createUserForTesting(user, new String[] {"someGroup"});
|
|
UserGroupInformation.createUserForTesting(user, new String[] {"someGroup"});
|