/** * Free all slots on this node. This will update the Cluster too. */ public void freeAllSlots() { if (!isAlive) { LOG.warn("Freeing all slots on a dead node {} ", nodeId); } cluster.freeSlots(slots.values()); //clearing assignments topIdToUsedSlots.clear(); }
/** * Free all slots on this node. This will update the Cluster too. * @param cluster the cluster to be updated */ public void freeAllSlots(Cluster cluster) { if (!_isAlive) { LOG.warn("Freeing all slots on a dead node {} ", _nodeId); } for (Entry<String, Set<WorkerSlot>> entry : _topIdToUsedSlots.entrySet()) { cluster.freeSlots(entry.getValue()); if (_isAlive) { _freeSlots.addAll(entry.getValue()); } } _topIdToUsedSlots = new HashMap<>(); }
/** * Unassign everything for the given topology id. * * @param topoId the is of the topology to unassign */ public void unassign(String topoId) { assertValidTopologyForModification(topoId); freeSlots(getUsedSlotsByTopologyId(topoId)); }
public static void defaultSchedule(Topologies topologies, Cluster cluster) { for (TopologyDetails topology : cluster.needsSchedulingTopologies()) { List<WorkerSlot> availableSlots = cluster.getAvailableSlots(); Set<ExecutorDetails> allExecutors = topology.getExecutors(); Map<WorkerSlot, List<ExecutorDetails>> aliveAssigned = EvenScheduler.getAliveAssignedWorkerSlotExecutors(cluster, topology.getId()); Set<ExecutorDetails> aliveExecutors = new HashSet<ExecutorDetails>(); for (List<ExecutorDetails> list : aliveAssigned.values()) { aliveExecutors.addAll(list); } Set<WorkerSlot> canReassignSlots = slotsCanReassign(cluster, aliveAssigned.keySet()); int totalSlotsToUse = Math.min(topology.getNumWorkers(), canReassignSlots.size() + availableSlots.size()); Set<WorkerSlot> badSlots = null; if (totalSlotsToUse > aliveAssigned.size() || !allExecutors.equals(aliveExecutors)) { badSlots = badSlots(aliveAssigned, allExecutors.size(), totalSlotsToUse); } if (badSlots != null) { cluster.freeSlots(badSlots); } EvenScheduler.scheduleTopologiesEvenly(new Topologies(topology), cluster); } }
cluster.freeSlots(hostUsedSlots.get(hostSlots.getHostName())); for (WorkerSlot tmpSlot : slot.subList(0, num)) { Set<ExecutorDetails> executor = removeElemFromExecutorsSet(executorSet); for (Map.Entry<String, Set<WorkerSlot>> entry : entries) { if (!cluster.isBlacklistedHost(entry.getKey())) { cluster.freeSlots(entry.getValue());
/** * Free all slots on this node. This will update the Cluster too. * @param cluster the cluster to be updated */ public void freeAllSlots(Cluster cluster) { if (!_isAlive) { LOG.warn("Freeing all slots on a dead node {} ",_nodeId); } for (Entry<String, Set<WorkerSlot>> entry : _topIdToUsedSlots.entrySet()) { cluster.freeSlots(entry.getValue()); if (_isAlive) { _freeSlots.addAll(entry.getValue()); } } _topIdToUsedSlots = new HashMap<>(); }
/** * Free all slots on this node. This will update the Cluster too. */ public void freeAllSlots() { if (!_isAlive) { LOG.warn("Freeing all slots on a dead node {} ", _nodeId); } _cluster.freeSlots(_slots.values()); _availCPU = getTotalCpuResources(); _availMemory = getAvailableMemoryResources(); //clearing assignments _topIdToUsedSlots.clear(); }
cluster.freeSlots(schedulerAssignment.getSlots()); log.info("executorsPerWorkerList: for {}, slotsAvailable: {}, slotsAssigned: {}, slotsFreed: {}", topologyId, slotsAvailable, slotsAssigned, slotsFreed);