if (!node.wouldFit(worker, exec, state.td)) { LOG.trace("{} would not fit in resources available on {}", exec, worker); return false;
/** * Find a worker to schedule executor exec on. * * @param exec the executor to schedule * @param td the topology that the executor is a part of * @return a worker to assign exec on. Returns null if a worker cannot be successfully found in cluster */ protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RAS_Node node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (node.wouldFit(ws, exec, td)) { return ws; } } } } return null; }