/** * Constructor. * * @param disp * dispatcher to call for each op encountered */ public TaskGraphWalker(Dispatcher disp) { dispatcher = disp; opStack = new Stack<Node>(); walkerCtx = new TaskGraphWalkerContext(retMap); }
@Override public Object dispatch(Node nd, Stack<Node> stack, Object... nodeOutputs) throws SemanticException { if (nodeOutputs == null || nodeOutputs.length == 0) { throw new SemanticException("No Dispatch Context"); } TaskGraphWalkerContext walkerCtx = (TaskGraphWalkerContext) nodeOutputs[0]; Task<? extends Serializable> currTask = (Task<? extends Serializable>) nd; // not map reduce task or not conditional task, just skip if (currTask.isMapRedTask()) { if (currTask instanceof ConditionalTask) { // get the list of task List<Task<? extends Serializable>> taskList = ((ConditionalTask) currTask).getListTasks(); for (Task<? extends Serializable> tsk : taskList) { if (tsk.isMapRedTask()) { ConditionalTask cndTask = this.processCurrentTask((MapRedTask) tsk, ((ConditionalTask) currTask)); walkerCtx.addToDispatchList(cndTask); } } } else { ConditionalTask cndTask = this.processCurrentTask((MapRedTask) currTask, null); walkerCtx.addToDispatchList(cndTask); } } return null; }
Task<? extends Serializable> newTask = this.processCurrentTask((MapRedTask) tsk, ((ConditionalTask) currTask), physicalContext.getContext()); walkerCtx.addToDispatchList(newTask); Task<? extends Serializable> newTask = this.processCurrentTask((MapRedTask) currTask, null, physicalContext.getContext()); walkerCtx.addToDispatchList(newTask);
/** * Constructor. * * @param disp * dispatcher to call for each op encountered */ public TaskGraphWalker(Dispatcher disp) { dispatcher = disp; opStack = new Stack<Node>(); walkerCtx = new TaskGraphWalkerContext(retMap); }
/** * Constructor. * * @param disp * dispatcher to call for each op encountered */ public TaskGraphWalker(Dispatcher disp) { dispatcher = disp; opStack = new Stack<Node>(); walkerCtx = new TaskGraphWalkerContext(retMap); }
Task<? extends Serializable> newTask = this.processCurrentTask((MapRedTask) tsk, ((ConditionalTask) currTask), physicalContext.getContext()); walkerCtx.addToDispatchList(newTask); Task<? extends Serializable> newTask = this.processCurrentTask((MapRedTask) currTask, null, physicalContext.getContext()); walkerCtx.addToDispatchList(newTask);
Task<? extends Serializable> newTask = this.processCurrentTask((MapRedTask) tsk, ((ConditionalTask) currTask), physicalContext.getContext()); walkerCtx.addToDispatchList(newTask); Task<? extends Serializable> newTask = this.processCurrentTask((MapRedTask) currTask, null, physicalContext.getContext()); walkerCtx.addToDispatchList(newTask);
/** * Constructor. * * @param disp * dispatcher to call for each op encountered */ public TaskGraphWalker(Dispatcher disp) { dispatcher = disp; opStack = new Stack<Node>(); walkerCtx = new TaskGraphWalkerContext(retMap); }