public boolean isTotallyFree() { return getUsedSlots().isEmpty(); }
public int totalSlotsUsed() { return getUsedSlots().size(); }
public int totalSlotsUsed(String topId) { return getUsedSlots(topId).size(); }
private static Map<WorkerSlot, RAS_Node> workerToNodes(Cluster cluster) { Map<WorkerSlot, RAS_Node> workerToNodes = new HashMap<>(); for (RAS_Node node : RAS_Nodes.getAllNodesFrom(cluster).values()) { for (WorkerSlot s : node.getUsedSlots()) { workerToNodes.put(s, node); } } return workerToNodes; }
/** * Free everything on the given slots. * * @param workerSlots the slots to free */ public void freeSlots(Collection<WorkerSlot> workerSlots) { for (RAS_Node node : nodeMap.values()) { for (WorkerSlot ws : node.getUsedSlots()) { if (workerSlots.contains(ws)) { LOG.debug("freeing ws {} on node {}", ws, node); node.free(ws); } } } }
public boolean isTotallyFree() { return getUsedSlots().isEmpty(); }
public int totalSlotsUsed(String topId) { return getUsedSlots(topId).size(); }
public int totalSlotsUsed() { return getUsedSlots().size(); }
/** * * @param workerSlots */ public void freeSlots(Collection<WorkerSlot> workerSlots) { for (RAS_Node node : nodeMap.values()) { for (WorkerSlot ws : node.getUsedSlots()) { if (workerSlots.contains(ws)) { LOG.debug("freeing ws {} on node {}", ws, node); node.free(ws); } } } }