YARN-5124. Modify AMRMClient to set the ExecutionType in the ResourceRequest. Addendum to fix compilation. (Arun Suresh via kasha)

This commit is contained in:
Karthik Kambatla 2016-06-12 14:28:14 -07:00
parent f3c7a99e33
commit a92be02c2e
2 changed files with 15 additions and 8 deletions

View File

@ -29,6 +29,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
import org.apache.hadoop.yarn.api.records.LocalResource;
import org.apache.hadoop.yarn.api.records.NodeReport;
@ -126,12 +127,12 @@ public abstract class BaseAMRMProxyE2ETest {
}
ResourceBlacklistRequest resourceBlacklistRequest = ResourceBlacklistRequest
.newInstance(new ArrayList<>(), new ArrayList<>());
.newInstance(new ArrayList<String>(), new ArrayList<String>());
int responseId = 1;
return AllocateRequest.newInstance(responseId, 0, resourceAsk,
new ArrayList<>(), resourceBlacklistRequest);
new ArrayList<ContainerId>(), resourceBlacklistRequest);
}
protected ApplicationAttemptId createApp(YarnClient yarnClient,

View File

@ -448,19 +448,25 @@ public class TestDistributedScheduling extends BaseAMRMProxyE2ETest {
try {
ApplicationMasterProtocol mockRM = mock(ApplicationMasterProtocol
.class);
final Resource _capability = capability;
final String[] _nodes = nodes;
final String[] _racks = racks;
final Priority _priority = priority;
final Priority _priority2 = priority2;
when(mockRM.allocate(any(AllocateRequest.class))).thenAnswer(
new Answer<AllocateResponse>() {
public AllocateResponse answer(InvocationOnMock invocation)
throws Exception {
amc.removeContainerRequest(
new AMRMClient.ContainerRequest(capability, nodes,
racks, priority));
new AMRMClient.ContainerRequest(_capability, _nodes,
_racks, _priority));
amc.removeContainerRequest(
new AMRMClient.ContainerRequest(capability, nodes, racks,
priority));
new AMRMClient.ContainerRequest(_capability, _nodes, _racks,
_priority));
amc.removeContainerRequest(
new AMRMClient.ContainerRequest(capability, null, null,
priority2, true, null,
new AMRMClient.ContainerRequest(_capability, null, null,
_priority2, true, null,
ExecutionTypeRequest.newInstance(
ExecutionType.OPPORTUNISTIC, true)));
throw new Exception();