@Override
    public void shutdown() {
        if (state.get() == NodeState.Shutdown) {
            return;
        }
        balancingPolicy.shutdown();
        if (autoRebalanceFuture != null) {
            autoRebalanceFuture.cancel(true);
        }
        LOG.info("Shutdown initiated; beginning drain...");
        setState(NodeState.Draining);
        balancingPolicy.drainToCount(0, true);
    }
@ Override public void shutdown ( ) { if ( state . get ( ) == NodeState . Shutdown ) { return ; } balancingPolicy . shutdown ( ) ; if ( autoRebalanceFuture != null ) { autoRebalanceFuture . cancel ( true ) ; } LOG . info ( "Shutdown initiated; beginning drain..." ) ; setState ( NodeState . Draining ) ; balancingPolicy . drainToCount ( 0 , true ) ; }
Drains all work claimed by this node over the time period provided in the config
(default: 60 seconds), prevents it from claiming new work, and exits the cluster.