public AllocateResponse allocate( String host, int memory, int numContainers, List<ContainerId> releases, String labelExpression) throws Exception { return allocate(host, memory, numContainers, 1, releases, labelExpression); }
public AllocateResponse allocate( String host, int memory, int numContainers, List<ContainerId> releases) throws Exception { return allocate(host, memory, numContainers, releases, null); }
public AllocateResponse allocate( String host, int memory, int numContainers, List<ContainerId> releases) throws Exception { return allocate(host, memory, numContainers, releases, null); }
public AllocateResponse doHeartbeat() throws Exception { return allocate(null, null); }
public AllocateResponse doHeartbeat() throws Exception { return allocate(null, null); }
public AllocateResponse schedule() throws Exception { AllocateResponse response = allocate(requests, releases); requests.clear(); releases.clear(); return response; }
public AllocateResponse schedule() throws Exception { AllocateResponse response = allocate(requests, releases); requests.clear(); releases.clear(); return response; }
public AllocateResponse allocate( String host, int memory, int numContainers, int priority, List<ContainerId> releases, String labelExpression) throws Exception { List<ResourceRequest> reqs = createReq(new String[] { host }, memory, priority, numContainers, labelExpression, -1); return allocate(reqs, releases); }
public AllocateResponse allocate( List<ResourceRequest> resourceRequest, List<ContainerId> releases) throws Exception { final AllocateRequest req = AllocateRequest.newInstance(0, 0F, resourceRequest, releases, null); return allocate(req); }
public AllocateResponse sendContainerResizingRequest( List<UpdateContainerRequest> updateRequests) throws Exception { final AllocateRequest req = AllocateRequest.newInstance(0, 0F, null, null, updateRequests, null); return allocate(req); }
public AllocateResponse sendContainerUpdateRequest( List<UpdateContainerRequest> updateRequests) throws Exception { final AllocateRequest req = AllocateRequest.newInstance(0, 0F, null, null, updateRequests, null); return allocate(req); }
public AllocateResponse allocate( String host, int memory, int numContainers, List<ContainerId> releases, String labelExpression) throws Exception { List<ResourceRequest> reqs = createReq(new String[] { host }, memory, 1, numContainers, labelExpression); return allocate(reqs, releases); }
public AllocateResponse allocate( List<ResourceRequest> resourceRequest, List<ContainerId> releases) throws Exception { final AllocateRequest req = AllocateRequest.newInstance(0, 0F, resourceRequest, releases, null); if (!schedulingRequests.isEmpty()) { req.setSchedulingRequests(schedulingRequests); schedulingRequests.clear(); } return allocate(req); }
public List<Container> allocateAndWaitForContainers(String host, int nContainer, int memory, MockNM nm) throws Exception { // AM request for containers allocate(host, memory, nContainer, null); // kick the scheduler nm.nodeHeartbeat(true); List<Container> conts = allocate(new ArrayList<ResourceRequest>(), null) .getAllocatedContainers(); while (conts.size() < nContainer) { nm.nodeHeartbeat(true); conts.addAll(allocate(new ArrayList<ResourceRequest>(), new ArrayList<ContainerId>()).getAllocatedContainers()); Thread.sleep(500); } return conts; } }
public List<Container> allocateAndWaitForContainers(int nContainer, int memory, MockNM nm) throws Exception { // AM request for containers allocate("ANY", memory, nContainer, null); // kick the scheduler nm.nodeHeartbeat(true); List<Container> conts = allocate(new ArrayList<ResourceRequest>(), null) .getAllocatedContainers(); while (conts.size() < nContainer) { nm.nodeHeartbeat(true); conts.addAll(allocate(new ArrayList<ResourceRequest>(), new ArrayList<ContainerId>()).getAllocatedContainers()); Thread.sleep(500); } return conts; } }
public AllocateResponse allocate(List<ResourceRequest> resourceRequest, List<SchedulingRequest> newSchedulingRequests, List<ContainerId> releases) throws Exception { final AllocateRequest req = AllocateRequest.newInstance(0, 0F, resourceRequest, releases, null); if (newSchedulingRequests != null) { addSchedulingRequest(newSchedulingRequests); } if (!schedulingRequests.isEmpty()) { req.setSchedulingRequests(schedulingRequests); schedulingRequests.clear(); } return allocate(req); }
private void waitContainerAllocated(MockAM am, int mem, int nContainer, int startContainerId, MockRM rm, MockNM nm) throws Exception { for (int cId = startContainerId; cId < startContainerId + nContainer; cId++) { am.allocate("*", mem, 1, new ArrayList<ContainerId>()); ContainerId containerId = ContainerId.newContainerId(am.getApplicationAttemptId(), cId); Assert.assertTrue(rm.waitForState(nm, containerId, RMContainerState.ALLOCATED)); } }
private void waitContainerAllocated(MockAM am, int mem, int nContainer, int startContainerId, MockRM rm, MockNM nm) throws Exception { for (int cId = startContainerId; cId < startContainerId + nContainer; cId++) { am.allocate("*", mem, 1, new ArrayList<ContainerId>()); ContainerId containerId = ContainerId.newContainerId(am.getApplicationAttemptId(), cId); Assert.assertTrue(rm.waitForState(nm, containerId, RMContainerState.ALLOCATED, 10 * 1000)); } }
public AllocateResponse allocateAppAntiAffinity( ResourceSizing resourceSizing, Priority priority, long allocationId, String namespace, Set<String> allocationTags, String... targetTags) throws Exception { return this.allocate(null, Arrays.asList(SchedulingRequest.newBuilder().executionType( ExecutionTypeRequest.newInstance(ExecutionType.GUARANTEED)) .allocationRequestId(allocationId).priority(priority) .allocationTags(allocationTags).placementConstraintExpression( PlacementConstraints .targetNotIn(PlacementConstraints.NODE, PlacementConstraints.PlacementTargets .allocationTagWithNamespace(namespace, targetTags)) .build()) .resourceSizing(resourceSizing).build()), null); }
public AllocateResponse allocateIntraAppAntiAffinity( String nodePartition, ResourceSizing resourceSizing, Priority priority, long allocationId, String... tags) throws Exception { return this.allocate(null, Arrays.asList(SchedulingRequest.newBuilder().executionType( ExecutionTypeRequest.newInstance(ExecutionType.GUARANTEED)) .allocationRequestId(allocationId).priority(priority) .placementConstraintExpression(PlacementConstraints .targetNotIn(PlacementConstraints.NODE, PlacementConstraints.PlacementTargets .allocationTag(tags), PlacementConstraints.PlacementTargets .nodePartition(nodePartition)).build()) .resourceSizing(resourceSizing).build()), null); }