new ContainerPreemptEvent(appAttemptId, container, SchedulerEventType.MARK_CONTAINER_FOR_KILLABLE)); preemptionCandidates.remove(container); new ContainerPreemptEvent(appAttemptId, container, SchedulerEventType.MARK_CONTAINER_FOR_PREEMPTION)); preemptionCandidates.put(container, currentTime);
@Override public String toString() { StringBuilder sb = new StringBuilder(super.toString()); sb.append(" ").append(getAppId()); sb.append(" ").append(getContainer().getContainerId()); return sb.toString(); }
@Override public boolean matches(Object o) { ContainerPreemptEvent cpe = (ContainerPreemptEvent)o; return appAttId.equals(cpe.getAppId()) && queueName.equals(cpe.getContainer().getQueueName()) && nodeId.equals(cpe.getContainer().getAllocatedNode()); } @Override
.handle(new ContainerPreemptEvent(appId, c, SchedulerEventType.KILL_RESERVED_CONTAINER));
RMContainer container = killReservedContainerEvent.getContainer(); killReservedContainer(container); ApplicationAttemptId aid = preemptContainerEvent.getAppId(); RMContainer containerToBePreempted = preemptContainerEvent.getContainer(); markContainerForPreemption(aid, containerToBePreempted); RMContainer killableContainer = containerKillableEvent.getContainer(); markContainerForKillable(killableContainer); ContainerPreemptEvent cancelKillContainerEvent = (ContainerPreemptEvent) event; markContainerForNonKillable(cancelKillContainerEvent.getContainer());
ApplicationAttemptId appAttemptId = mock(ApplicationAttemptId.class); RMContainer container = mock(RMContainer.class); ContainerPreemptEvent event1 = new ContainerPreemptEvent( appAttemptId, container, SchedulerEventType.KILL_RESERVED_CONTAINER); rmDispatcher.getEventHandler().handle(event1); ContainerPreemptEvent event2 = new ContainerPreemptEvent(appAttemptId, container, SchedulerEventType.MARK_CONTAINER_FOR_KILLABLE); rmDispatcher.getEventHandler().handle(event2); ContainerPreemptEvent event3 = new ContainerPreemptEvent(appAttemptId, container, SchedulerEventType.MARK_CONTAINER_FOR_PREEMPTION); rmDispatcher.getEventHandler().handle(event3);