public boolean needsScheduling(TopologyDetails topology) {
        int desiredNumWorkers = topology.getNumWorkers();
        int assignedNumWorkers = this.getAssignedNumWorkers(topology);

        if (desiredNumWorkers > assignedNumWorkers) {
            return true;
        }
        return this.getUnassignedExecutors(topology).size() > 0;
    }
public boolean needsScheduling ( TopologyDetails topology ) { int desiredNumWorkers = topology . getNumWorkers ( ) ; int assignedNumWorkers = this . getAssignedNumWorkers ( topology ) ; if ( desiredNumWorkers > assignedNumWorkers ) { return true ; } return this . getUnassignedExecutors ( topology ) . size ( ) > 0 ; }
Does the topology need scheduling?

A topology needs scheduling if one of the following conditions holds:
<ul>
<li>Although the topology is assigned slots, but is squeezed. i.e. the topology is assigned less slots than desired.</li>
<li>There are unassigned executors in this topology</li>
</ul>