public static ContainerRequestEvent createContainerRequestEventForFailedContainer( TaskAttemptId attemptID, Resource capability) { //ContainerRequest for failed events does not consider rack / node locality? return new ContainerRequestEvent(attemptID, capability); }
public ContainerRequest(ContainerRequestEvent event, Priority priority, long requestTimeMs) { this(event.getAttemptID(), event.getCapability(), event.getHosts(), event.getRacks(), priority, requestTimeMs,null); }
private boolean preemptReducersForHangingMapRequests(long pendingThreshold) { int hangingMapRequests = getNumHangingRequests( pendingThreshold, scheduledRequests.maps); if (hangingMapRequests > 0) { preemptReducer(hangingMapRequests); return true; } return false; }
protected ContainerRequest getFilteredContainerRequest(ContainerRequest orig) { ArrayList<String> newHosts = new ArrayList<String>(); for (String host : orig.hosts) { if (!isNodeBlacklisted(host)) { newHosts.add(host); } } String[] hosts = newHosts.toArray(new String[newHosts.size()]); ContainerRequest newReq = new ContainerRequest(orig.attemptID, orig.capability, hosts, orig.racks, orig.priority, orig.nodeLabelExpression); return newReq; }
@Override public void runOnNextHeartbeat(Runnable callback) { ((RMCommunicator) containerAllocator).runOnNextHeartbeat(callback); } }
public void sendRequests(List<ContainerRequestEvent> reqs) { for (ContainerRequestEvent req : reqs) { super.handleEvent(req); } }
@Override protected AllocateResponse makeRemoteRequest() throws IOException, YarnException { allocateResponse = super.makeRemoteRequest(); return allocateResponse; } }
protected void decContainerReq(ContainerRequest req) { // Update resource requests for (String hostName : req.hosts) { decResourceRequest(req.priority, hostName, req.capability); } for (String rack : req.racks) { decResourceRequest(req.priority, rack, req.capability); } decResourceRequest(req.priority, ResourceRequest.ANY, req.capability); }
protected void addOpportunisticResourceRequest(Priority priority, Resource capability) { addResourceRequest(priority, ResourceRequest.ANY, capability, null, ExecutionType.OPPORTUNISTIC); }
@Override protected ResourceScheduler createScheduler() { return new ExcessReduceContainerAllocateScheduler(this.getRMContext()); } }
@Override protected ResourceScheduler createScheduler() { return new MyFifoScheduler(this.getRMContext()); }
private MockNM registerNodeManager(int i, MyResourceManager rm) throws Exception { MockNM nm = rm.registerNode("h" + (i + 1) + ":1234", 10240); rm.drainEvents(); return nm; }
protected ContainerAllocator createContainerAllocator( ClientService clientService, AppContext context) { return new MyContainerAllocator(rm, appAttemptId, context); }; };
@Override public Integer answer(InvocationOnMock invocation) throws Throwable { communicator.stop(); return 2; } }).thenThrow(new AssertionError(
public ContainerRequest(ContainerRequestEvent event, Priority priority, long requestTimeMs) { this(event.getAttemptID(), event.getCapability(), event.getHosts(), event.getRacks(), priority, requestTimeMs); }
public static ContainerRequestEvent createContainerRequestEventForFailedContainer( TaskAttemptId attemptID, Resource capability) { //ContainerRequest for failed events does not consider rack / node locality? return new ContainerRequestEvent(attemptID, capability); }
@Override public void runOnNextHeartbeat(Runnable callback) { ((RMCommunicator) containerAllocator).runOnNextHeartbeat(callback); } }
protected void decContainerReq(ContainerRequest req) { // Update resource requests for (String hostName : req.hosts) { decResourceRequest(req.priority, hostName, req.capability); } for (String rack : req.racks) { decResourceRequest(req.priority, rack, req.capability); } decResourceRequest(req.priority, ResourceRequest.ANY, req.capability); }
protected ContainerAllocator createContainerAllocator( ClientService clientService, AppContext context) { return new MyContainerAllocator(rm, appAttemptId, context); }; };
@Override public void runOnNextHeartbeat(Runnable callback) { ((RMCommunicator) containerAllocator).runOnNextHeartbeat(callback); } }