tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeag...@apache.org
Subject [09/50] [abbrv] tez git commit: TEZ-1711. Don't cache outputSpecList in VertexImpl.getOutputSpecList(taskIndex). (zjffdu)
Date Mon, 17 Nov 2014 19:22:18 GMT
TEZ-1711. Don't cache outputSpecList in VertexImpl.getOutputSpecList(taskIndex). (zjffdu)


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

Branch: refs/heads/TEZ-8
Commit: 7f8fc7530b39106e238c67b7bd22d5ed5670d449
Parents: c570a0e
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Fri Oct 31 08:47:18 2014 +0800
Committer: Jeff Zhang <zjffdu@apache.org>
Committed: Fri Oct 31 08:47:18 2014 +0800

----------------------------------------------------------------------
 CHANGES.txt                                       |  1 +
 .../apache/tez/dag/app/dag/impl/VertexImpl.java   | 18 +++++++-----------
 .../apache/tez/dag/app/dag/impl/TestDAGImpl.java  |  5 ++++-
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/7f8fc753/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 68d4838..0b2dc65 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -91,6 +91,7 @@ ALL CHANGES:
   based affinity
   TEZ-1716. Additional ATS data for UI.
   TEZ-1722. DAG should be related to Application Id in ATS data.
+  TEZ-1711. Don't cache outputSpecList in VertexImpl.getOutputSpecList(taskIndex)
 
 Release 0.5.1: 2014-10-02
 

http://git-wip-us.apache.org/repos/asf/tez/blob/7f8fc753/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
index 4edd12b..c182810 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
@@ -224,8 +224,6 @@ public class VertexImpl implements org.apache.tez.dag.app.dag.Vertex,
   @VisibleForTesting
   int numSuccessSourceAttemptCompletions = 0;
 
-  List<InputSpec> inputSpecList;
-  List<OutputSpec> outputSpecList;
   List<GroupInputSpec> groupInputSpecList;
   Set<String> sharedOutputs = Sets.newHashSet();
 
@@ -3931,7 +3929,7 @@ public class VertexImpl implements org.apache.tez.dag.app.dag.Vertex,
   // TODO Eventually remove synchronization.
   @Override
   public synchronized List<InputSpec> getInputSpecList(int taskIndex) throws AMUserCodeException
{
-    inputSpecList = new ArrayList<InputSpec>(this.getInputVerticesCount()
+    List<InputSpec> inputSpecList = new ArrayList<InputSpec>(this.getInputVerticesCount()
         + (rootInputDescriptors == null ? 0 : rootInputDescriptors.size()));
     if (rootInputDescriptors != null) {
       for (Entry<String, RootInputLeafOutput<InputDescriptor, InputInitializerDescriptor>>
@@ -3956,14 +3954,12 @@ public class VertexImpl implements org.apache.tez.dag.app.dag.Vertex,
   // TODO Eventually remove synchronization.
   @Override
   public synchronized List<OutputSpec> getOutputSpecList(int taskIndex) throws AMUserCodeException
{
-    if (this.outputSpecList == null) {
-      outputSpecList = new ArrayList<OutputSpec>(this.getOutputVerticesCount()
-          + this.additionalOutputSpecs.size());
-      outputSpecList.addAll(additionalOutputSpecs);
-      for (Entry<Vertex, Edge> entry : this.getOutputVertices().entrySet()) {
-        OutputSpec outputSpec = entry.getValue().getSourceSpec(taskIndex);
-        outputSpecList.add(outputSpec);
-      }
+    List<OutputSpec> outputSpecList = new ArrayList<OutputSpec>(this.getOutputVerticesCount()
+        + this.additionalOutputSpecs.size());
+    outputSpecList.addAll(additionalOutputSpecs);
+    for (Entry<Vertex, Edge> entry : this.getOutputVertices().entrySet()) {
+      OutputSpec outputSpec = entry.getValue().getSourceSpec(taskIndex);
+      outputSpecList.add(outputSpec);
     }
     return outputSpecList;
   }

http://git-wip-us.apache.org/repos/asf/tez/blob/7f8fc753/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java
index e79eeef..f1961aa 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java
@@ -644,6 +644,7 @@ public class TestDAGImpl {
     return dag;
   }
 
+  // v1 -> v2
   private DAGPlan createDAGWithCustomEdge(ExceptionLocation exLocation) {
     LOG.info("Setting up dag plan");
     DAGPlan dag = DAGPlan.newBuilder()
@@ -920,7 +921,9 @@ public class TestDAGImpl {
     dispatcher.getEventHandler().handle(new DAGEventStartDag(dagWithCustomEdge.getID(),
         null));
     dispatcher.await();
-    Assert.assertEquals(DAGState.RUNNING, dagWithCustomEdge.getState());
+    // After TEZ-1711, all task attempts of v1 fail which result in task fail, and finally
+    // dag failed.
+    Assert.assertEquals(DAGState.FAILED, dagWithCustomEdge.getState());
 
     VertexImpl v1 = (VertexImpl)dagWithCustomEdge.getVertex("vertex1");
     Task t1= v1.getTask(0);


Mime
View raw message