diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroup.java b/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroup.java index 75722a494feac..ada803b38c3e8 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroup.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroup.java @@ -47,15 +47,6 @@ public interface TaskGroup> { */ void prepare(); - /** - * Executes the tasks in the group. - *

- * the order of execution of tasks ensure that a task gets selected for execution only after - * the execution of all the tasks it depends on - * @throws Exception the exception - */ - void execute() throws Exception; - /** * Executes the tasks in the group asynchronously. * diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java b/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java index 46fe8d0f179f2..747f0273fa7d6 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java @@ -58,31 +58,8 @@ public void prepare() { } } - @Override - public void execute() throws Exception { - DAGNode nextNode = dag.getNext(); - while (nextNode != null) { - nextNode.data().execute(); - this.dag().reportedCompleted(nextNode); - nextNode = dag.getNext(); - } - } - @Override public Observable executeAsync() { - return executeReadyTasksAsync().last(); - } - - @Override - public T taskResult(String taskId) { - return dag.getNodeData(taskId).result(); - } - - /** - * Executes all runnable tasks, a task is runnable when all the tasks its depends - * on are finished running. - */ - private Observable executeReadyTasksAsync() { DAGNode nextNode = dag.getNext(); final List> observables = new ArrayList<>(); while (nextNode != null) { @@ -95,7 +72,7 @@ public Observable call(T t) { if (dag().isRootNode(thisNode)) { return Observable.just(t); } else { - return executeReadyTasksAsync(); + return executeAsync(); } } })); @@ -103,4 +80,9 @@ public Observable call(T t) { } return Observable.merge(observables); } + + @Override + public T taskResult(String taskId) { + return dag.getNodeData(taskId).result(); + } } diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/TaskItem.java b/azure-client-runtime/src/main/java/com/microsoft/azure/TaskItem.java index df9bf4b04a941..dd24167c89681 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/TaskItem.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/TaskItem.java @@ -20,15 +20,6 @@ public interface TaskItem { */ U result(); - /** - * Executes the task. - *

- * once executed the result will be available through result getter - * - * @throws Exception exception - */ - void execute() throws Exception; - /** * Executes the task asynchronously. *