|
@@ -700,13 +700,23 @@ public class MockRM extends ResourceManager {
|
|
|
|
|
|
public RMApp submitApp(List<ResourceRequest> amResourceRequests)
|
|
public RMApp submitApp(List<ResourceRequest> amResourceRequests)
|
|
throws Exception {
|
|
throws Exception {
|
|
- return submitApp(amResourceRequests, "app1",
|
|
|
|
- "user", null, false, null,
|
|
|
|
|
|
+ return submitApp(amResourceRequests, "app1", "user", 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,
|
|
|
|
|
|
+ YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS), null, null, true,
|
|
false, false, null, 0, null, true,
|
|
false, false, null, 0, null, true,
|
|
amResourceRequests.get(0).getPriority(),
|
|
amResourceRequests.get(0).getPriority(),
|
|
- amResourceRequests.get(0).getNodeLabelExpression(), null, null);
|
|
|
|
|
|
+ amResourceRequests.get(0).getNodeLabelExpression(), null, null, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public RMApp submitApp(List<ResourceRequest> amResourceRequests,
|
|
|
|
+ String appNodeLabel) throws Exception {
|
|
|
|
+ return submitApp(amResourceRequests, "app1", "user", null, false, null,
|
|
|
|
+ super.getConfig().getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
|
|
+ YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS), null, null, true,
|
|
|
|
+ false, false, null, 0, null, true,
|
|
|
|
+ amResourceRequests.get(0).getPriority(),
|
|
|
|
+ amResourceRequests.get(0).getNodeLabelExpression(), null, null,
|
|
|
|
+ appNodeLabel);
|
|
}
|
|
}
|
|
|
|
|
|
public RMApp submitApp(Resource capability, String name, String user,
|
|
public RMApp submitApp(Resource capability, String name, String user,
|
|
@@ -730,7 +740,7 @@ public class MockRM extends ResourceManager {
|
|
keepContainers, isAppIdProvided, applicationId,
|
|
keepContainers, isAppIdProvided, applicationId,
|
|
attemptFailuresValidityInterval, logAggregationContext,
|
|
attemptFailuresValidityInterval, logAggregationContext,
|
|
cancelTokensWhenComplete, priority, amLabel, applicationTimeouts,
|
|
cancelTokensWhenComplete, priority, amLabel, applicationTimeouts,
|
|
- tokensConf);
|
|
|
|
|
|
+ tokensConf, null);
|
|
}
|
|
}
|
|
|
|
|
|
public RMApp submitApp(List<ResourceRequest> amResourceRequests, String name,
|
|
public RMApp submitApp(List<ResourceRequest> amResourceRequests, String name,
|
|
@@ -741,8 +751,7 @@ public class MockRM extends ResourceManager {
|
|
LogAggregationContext logAggregationContext,
|
|
LogAggregationContext logAggregationContext,
|
|
boolean cancelTokensWhenComplete, Priority priority, String amLabel,
|
|
boolean cancelTokensWhenComplete, Priority priority, String amLabel,
|
|
Map<ApplicationTimeoutType, Long> applicationTimeouts,
|
|
Map<ApplicationTimeoutType, Long> applicationTimeouts,
|
|
- ByteBuffer tokensConf)
|
|
|
|
- throws Exception {
|
|
|
|
|
|
+ ByteBuffer tokensConf, String appNodeLabel) throws Exception {
|
|
ApplicationId appId = isAppIdProvided ? applicationId : null;
|
|
ApplicationId appId = isAppIdProvided ? applicationId : null;
|
|
ApplicationClientProtocol client = getClientRMService();
|
|
ApplicationClientProtocol client = getClientRMService();
|
|
if (! isAppIdProvided) {
|
|
if (! isAppIdProvided) {
|
|
@@ -770,6 +779,9 @@ public class MockRM extends ResourceManager {
|
|
if (priority != null) {
|
|
if (priority != null) {
|
|
sub.setPriority(priority);
|
|
sub.setPriority(priority);
|
|
}
|
|
}
|
|
|
|
+ if (appNodeLabel != null) {
|
|
|
|
+ sub.setNodeLabelExpression(appNodeLabel);
|
|
|
|
+ }
|
|
sub.setApplicationType(appType);
|
|
sub.setApplicationType(appType);
|
|
ContainerLaunchContext clc = Records
|
|
ContainerLaunchContext clc = Records
|
|
.newRecord(ContainerLaunchContext.class);
|
|
.newRecord(ContainerLaunchContext.class);
|