/** * Driver is idle if, regardless of status, it has no evaluators allocated * and no pending container requests. This method is used in the DriverIdleManager. * If all DriverIdlenessSource components are idle, DriverIdleManager will initiate Driver shutdown. * @return idle, if there are no outstanding requests or allocations. Not idle otherwise. */ @Override public synchronized IdleMessage getIdleStatus() { if (this.isIdle()) { return IDLE_MESSAGE; } final String message = String.format( "There are %d outstanding container requests and %d allocated containers", this.outstandingContainerRequests, this.containerAllocationCount); return new IdleMessage(COMPONENT_NAME, message, false); }
private void onRMRunning(final RuntimeStatusEvent runtimeStatusEvent) { assert runtimeStatusEvent.getState() == State.RUNNING; if (this.isIdle()) { this.driverIdleManager.get().onPotentiallyIdle(IDLE_MESSAGE); } }