private Set<Integer> getWorkerIds(Collection<String> hosts){ Set<Integer> workerIds = Sets.newHashSet(); if(hosts.isEmpty()) return workerIds; for (WorkerConnectionInfo worker : stage.getContext().getWorkerMap().values()) { if(hosts.contains(worker.getHost())){ workerIds.add(worker.getId()); } } return workerIds; }
private Set<Integer> getWorkerIds(Collection<String> hosts){ Set<Integer> workerIds = Sets.newHashSet(); if(hosts.isEmpty()) return workerIds; for (WorkerConnectionInfo worker : stage.getContext().getWorkerMap().values()) { if(hosts.contains(worker.getHost())){ workerIds.add(worker.getId()); } } return workerIds; }
@Override public void start() { info(LOG, "Start TaskScheduler"); maximumRequestContainer = Math.min(tajoConf.getIntVar(TajoConf.ConfVars.QUERYMASTER_TASK_SCHEDULER_REQUEST_MAX_NUM) , stage.getContext().getWorkerMap().size()); if (isLeaf) { candidateWorkers.addAll(getWorkerIds(getLeafTaskHosts())); } else { //find assigned hosts for Non-Leaf locality in children executionBlock List<ExecutionBlock> executionBlockList = stage.getMasterPlan().getChilds(stage.getBlock()); for (ExecutionBlock executionBlock : executionBlockList) { Stage childStage = stage.getContext().getStage(executionBlock.getId()); candidateWorkers.addAll(childStage.getAssignedWorkerMap().keySet()); } } this.schedulingThread.start(); super.start(); }
WorkerConnectionInfo connectionInfo = context.getMasterContext().getWorkerMap().get(taskRequest.getWorkerId()); if(connectionInfo == null) continue; int nodes = context.getMasterContext().getWorkerMap().size();
WorkerConnectionInfo connectionInfo = context.getMasterContext().getWorkerMap().get(taskRequest.getWorkerId()); if(connectionInfo == null) continue; int nodes = context.getMasterContext().getWorkerMap().size();
context.getMasterContext().getWorkerMap().get(taskRequest.getWorkerId());
context.getMasterContext().getWorkerMap().get(taskRequest.getWorkerId());
@Override public void start() { info(LOG, "Start TaskScheduler"); maximumRequestContainer = Math.min(tajoConf.getIntVar(TajoConf.ConfVars.QUERYMASTER_TASK_SCHEDULER_REQUEST_MAX_NUM) , stage.getContext().getWorkerMap().size()); if (isLeaf) { candidateWorkers.addAll(getWorkerIds(getLeafTaskHosts())); } else { //find assigned hosts for Non-Leaf locality in children executionBlock List<ExecutionBlock> executionBlockList = stage.getMasterPlan().getChilds(stage.getBlock()); for (ExecutionBlock executionBlock : executionBlockList) { Stage childStage = stage.getContext().getStage(executionBlock.getId()); candidateWorkers.addAll(childStage.getAssignedWorkerMap().keySet()); } } this.schedulingThread.start(); super.start(); }