tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject tez git commit: TEZ-2948. Stop using dagName in the dagComplete notification to TaskCommunicators. (sseth)
Date Wed, 18 Nov 2015 21:15:35 GMT
Repository: tez
Updated Branches:
  refs/heads/master e5e4fc7a0 -> fd13f51b3


TEZ-2948. Stop using dagName in the dagComplete notification to TaskCommunicators. (sseth)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/fd13f51b
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/fd13f51b
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/fd13f51b

Branch: refs/heads/master
Commit: fd13f51b3f416dfe16da7279f10c3cbab21ff572
Parents: e5e4fc7
Author: Siddharth Seth <sseth@apache.org>
Authored: Wed Nov 18 13:15:06 2015 -0800
Committer: Siddharth Seth <sseth@apache.org>
Committed: Wed Nov 18 13:15:06 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../java/org/apache/tez/dag/api/TaskCommunicator.java   |  5 ++++-
 .../org/apache/tez/dag/api/TaskCommunicatorContext.java | 12 ++++++++++++
 .../apache/tez/dag/app/TaskCommunicatorContextImpl.java | 11 +++++++++++
 .../org/apache/tez/dag/app/TaskCommunicatorManager.java |  2 +-
 .../org/apache/tez/dag/app/TezTaskCommunicatorImpl.java |  2 +-
 .../apache/tez/dag/app/TestTaskCommunicatorManager.java |  2 +-
 .../java/org/apache/tez/runtime/api/impl/TaskSpec.java  |  4 ++++
 8 files changed, 35 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/fd13f51b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ff07cc0..b38fafb 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -5,6 +5,7 @@ Release 0.8.2: Unreleased
 
 INCOMPATIBLE CHANGES
   TEZ-2679. Admin forms of launch env settings
+  TEZ-2948. Stop using dagName in the dagComplete notification to TaskCommunicators.
 
 ALL CHANGES:
   TEZ-2945. TEZ-2740 addendum to update API with currently supported

http://git-wip-us.apache.org/repos/asf/tez/blob/fd13f51b/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicator.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicator.java b/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicator.java
index f1f683b..38742de 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicator.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicator.java
@@ -185,8 +185,11 @@ public abstract class TaskCommunicator implements ServicePluginLifecycle
{
    * <p/>
    * After this, the contents returned from querying the context may change at any point
- due to
    * the next dag being submitted.
+   *
+   * @param dagIdentifier the unique numerical identifier for the DAG in the specified execution
context.
+   *
    */
-  public abstract void dagComplete(String dagName);
+  public abstract void dagComplete(int dagIdentifier);
 
   /**
    * Share meta-information such as host:port information where the Task Communicator may
be

http://git-wip-us.apache.org/repos/asf/tez/blob/fd13f51b/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicatorContext.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicatorContext.java b/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicatorContext.java
index e81ba2b..7c5a648 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicatorContext.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/api/TaskCommunicatorContext.java
@@ -163,6 +163,18 @@ public interface TaskCommunicatorContext {
   String getCurrentDagName();
 
   /**
+   * Get an identifier for the executing context of the DAG.
+   * @return a String identifier for the exeucting context.
+   */
+  String getCurrentAppIdentifier();
+
+  /**
+   * Get the identifier for the currently executing dag.
+   * @return a numerical identifier for the currently running DAG. This is unique within
the currently running application.
+   */
+  int getCurrentDagIdenitifer();
+
+  /**
    * Get the name of the Input vertices for the specified vertex.
    * Root Inputs are not returned.
    *

http://git-wip-us.apache.org/repos/asf/tez/blob/fd13f51b/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorContextImpl.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorContextImpl.java
index 071b008..d344fd3 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorContextImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorContextImpl.java
@@ -150,6 +150,17 @@ public class TaskCommunicatorContextImpl implements TaskCommunicatorContext,
Ver
   }
 
   @Override
+  public String getCurrentAppIdentifier() {
+    return getDag().getID().getApplicationId().toString();
+
+  }
+
+  @Override
+  public int getCurrentDagIdenitifer() {
+    return getDag().getID().getId();
+  }
+
+  @Override
   public Iterable<String> getInputVertexNames(String vertexName) {
     Preconditions.checkNotNull(vertexName, "VertexName cannot be null: " + vertexName);
     Vertex vertex = getDag().getVertex(vertexName);

http://git-wip-us.apache.org/repos/asf/tez/blob/fd13f51b/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorManager.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorManager.java b/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorManager.java
index 8c17c2c..924222a 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorManager.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/TaskCommunicatorManager.java
@@ -350,7 +350,7 @@ public class TaskCommunicatorManager extends AbstractService implements
     // Inform all communicators of the dagCompletion.
     for (int i = 0 ; i < taskCommunicators.length ; i++) {
       ((TaskCommunicatorContextImpl)taskCommunicatorContexts[i]).dagCompleteStart(dag);
-      taskCommunicators[i].dagComplete(dag.getName());
+      taskCommunicators[i].dagComplete(dag.getID().getId());
       ((TaskCommunicatorContextImpl)taskCommunicatorContexts[i]).dagCompleteEnd();
     }
 

http://git-wip-us.apache.org/repos/asf/tez/blob/fd13f51b/tez-dag/src/main/java/org/apache/tez/dag/app/TezTaskCommunicatorImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/TezTaskCommunicatorImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/TezTaskCommunicatorImpl.java
index ee1d553..78e95bd 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/TezTaskCommunicatorImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/TezTaskCommunicatorImpl.java
@@ -278,7 +278,7 @@ public class TezTaskCommunicatorImpl extends TaskCommunicator {
   }
 
   @Override
-  public void dagComplete(String dagName) {
+  public void dagComplete(int dagIdentifier) {
     // Nothing to do at the moment. Some of the TODOs from TaskAttemptListener apply here.
   }
 

http://git-wip-us.apache.org/repos/asf/tez/blob/fd13f51b/tez-dag/src/test/java/org/apache/tez/dag/app/TestTaskCommunicatorManager.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/TestTaskCommunicatorManager.java
b/tez-dag/src/test/java/org/apache/tez/dag/app/TestTaskCommunicatorManager.java
index 1cd8bb1..d1fd4f3 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/TestTaskCommunicatorManager.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/TestTaskCommunicatorManager.java
@@ -358,7 +358,7 @@ public class TestTaskCommunicatorManager {
     }
 
     @Override
-    public void dagComplete(String dagName) {
+    public void dagComplete(int dagIdentifier) {
 
     }
 

http://git-wip-us.apache.org/repos/asf/tez/blob/fd13f51b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TaskSpec.java
----------------------------------------------------------------------
diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TaskSpec.java
b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TaskSpec.java
index 4dc57e2..7fce1d4 100644
--- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TaskSpec.java
+++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/api/impl/TaskSpec.java
@@ -101,6 +101,10 @@ public class TaskSpec implements Writable {
     return dagName;
   }
 
+  public int getDagIdentifier() {
+    return taskAttemptId.getTaskID().getVertexID().getDAGId().getId();
+  }
+
   public int getVertexParallelism() {
     return vertexParallelism;
   }


Mime
View raw message