@Override public boolean needsSchedulingRas(TopologyDetails topology) { return getUnassignedExecutors(topology).size() > 0; }
@Override public boolean needsScheduling(TopologyDetails topology) { int desiredNumWorkers = topology.getNumWorkers(); int assignedNumWorkers = this.getAssignedNumWorkers(topology); return desiredNumWorkers > assignedNumWorkers || getUnassignedExecutors(topology).size() > 0; }
new HashSet<>(this.cluster.getUnassignedExecutors(td)); LOG.debug("Num ExecutorsNeedScheduling: {}", unassignedExecutors.size()); Collection<ExecutorDetails> scheduledTasks = new ArrayList<>();
new HashSet<>(this.cluster.getUnassignedExecutors(td)); LOG.debug("ExecutorsNeedScheduling: {}", unassignedExecutors); Collection<ExecutorDetails> scheduledTasks = new ArrayList<>();
Set<ExecutorDetails> unassignedExecutors = new HashSet<>(cluster.getUnassignedExecutors(td)); List<ExecutorDetails> sortedExecs = getSortedExecs(spreadComps, constraintMatrix, compToExecs).stream() .filter(unassignedExecutors::contains)
int executorsNotRunning = _cluster.getUnassignedExecutors(td).size(); LOG.debug("Slots... requested {} used {} free {} available {} to be used {}, executors not running {}", slotsRequested, slotsUsed, slotsFree, slotsAvailable, slotsToUse, executorsNotRunning);
Assert.assertEquals("topo all executors scheduled? " + cluster.getUnassignedExecutors(topo), 0, cluster.getUnassignedExecutors(topo).size()); Assert.assertTrue("Valid Scheduling?", ConstraintSolverStrategy.validateSolution(cluster, topo)); LOG.info("Slots Used {}", cluster.getAssignmentById(topo.getId()).getSlots()); Assert.assertEquals("topo all executors scheduled?", 0, cluster.getUnassignedExecutors(topo).size()); Assert.assertTrue("Valid Scheduling?", ConstraintSolverStrategy.validateSolution(cluster, topo));
Assert.assertEquals("All executors in topo-1 scheduled", 0, cluster.getUnassignedExecutors(topo1).size()); Assert.assertEquals("All executors in topo-2 scheduled", 0, cluster.getUnassignedExecutors(topo1).size());
t1UnfavoredHostIds.contains(hostName)); Assert.assertEquals("All executors in topo-1 scheduled", 0, cluster.getUnassignedExecutors(topo1).size()); Assert.assertEquals("All executors in topo-2 scheduled", 0, cluster.getUnassignedExecutors(topo1).size());
assert status.startsWith("Not enough resources to schedule") : status; assert status.endsWith("5 executors not scheduled") : status; assertEquals(5, cluster.getUnassignedExecutors(topology2).size());
/** * 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> */ public boolean needsScheduling(TopologyDetails topology) { int desiredNumWorkers = topology.getNumWorkers(); int assignedNumWorkers = this.getAssignedNumWorkers(topology); return desiredNumWorkers > assignedNumWorkers || this.getUnassignedExecutors(topology).size() > 0; }
List<List<ExecutorDetails>> executorsPerWorkerList(Cluster cluster, TopologyDetails topologyDetails, int slotsRequested, int slotsAssigned, int slotsAvailable) { Collection<ExecutorDetails> executors = cluster.getUnassignedExecutors(topologyDetails); String topologyId = topologyDetails.getId(); log.info("executorsPerWorkerList: for {}, slotsAvailable: {}, slotsAssigned: {}, slotsFreed: {}", topologyId, slotsAvailable, slotsAssigned, slotsFreed); executors = cluster.getUnassignedExecutors(topologyDetails); slotsToUse = slotsAvailable; } else {
return SchedulingResult.failure(SchedulingStatus.FAIL_NOT_ENOUGH_RESOURCES, "No available nodes to schedule tasks on!"); Collection<ExecutorDetails> unassignedExecutors = new HashSet<>(_cluster.getUnassignedExecutors(td)); Map<WorkerSlot, Collection<ExecutorDetails>> schedulerAssignmentMap = new HashMap<>(); LOG.debug("ExecutorsNeedScheduling: {}", unassignedExecutors);
userMap.put(topologySubmitter, new User(topologySubmitter, userResourcePools.get(topologySubmitter))); if (cluster.getUnassignedExecutors(td).size() > 0) { LOG.debug("adding td: {} to pending queue", td.getName()); userMap.get(topologySubmitter).addTopologyToPendingQueue(td);
int executorsNotRunning = _cluster.getUnassignedExecutors(td).size(); LOG.debug("Slots... requested {} used {} free {} available {} to be used {}, executors not running {}", slotsRequested, slotsUsed, slotsFree, slotsAvailable, slotsToUse, executorsNotRunning);
public void scheduleTopology(TopologyDetails td) { User topologySubmitter = this.schedulingState.userMap.get(td.getTopologySubmitter()); if (this.schedulingState.cluster.getUnassignedExecutors(td).size() > 0) { LOG.debug("/********Scheduling topology {} from User {}************/", td.getName(), topologySubmitter);