tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjf...@apache.org
Subject tez git commit: Revert part of change of TEZ-2221 (zjffdu)
Date Wed, 06 May 2015 01:04:57 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.6 4b6537699 -> 6702d928b


Revert part of change of TEZ-2221 (zjffdu)

(cherry picked from commit 406bba9ac86b8c0e265c2b1850928de477ce0250)


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

Branch: refs/heads/branch-0.6
Commit: 6702d928b7651049b8cec39f558e7891fafe769b
Parents: 4b65376
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Wed May 6 09:00:33 2015 +0800
Committer: Jeff Zhang <zjffdu@apache.org>
Committed: Wed May 6 09:04:40 2015 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/tez/dag/api/DAG.java | 15 ---------------
 .../test/java/org/apache/tez/dag/api/TestDAG.java | 18 ++++--------------
 2 files changed, 4 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/6702d928/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java b/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
index e79ef43..db2cb39 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
@@ -85,8 +85,6 @@ public class DAG {
   final Collection<URI> urisForCredentials = new HashSet<URI>();
   Credentials credentials = new Credentials();
   Set<VertexGroup> vertexGroups = Sets.newHashSet();
-  // to verify the vertex Group memberSet should be unique
-  private Set<Set<String>> vertexGroupMemberSets = Sets.newHashSet();
 
   Set<GroupInputEdge> groupInputEdges = Sets.newHashSet();
   private Map<String, String> dagConf = new HashMap<String, String>();
@@ -181,19 +179,6 @@ public class DAG {
    * @return {@link DAG}
    */
   public synchronized VertexGroup createVertexGroup(String name, Vertex... members) {
-    // vertex group member set should be unique
-    Collection<String> memberNames =
-        Collections2.transform(Lists.newArrayList(members), new Function<Vertex, String>()
{
-      @Override
-      public String apply(Vertex v) {
-        return v.getName();
-      }
-    });
-    if (!vertexGroupMemberSets.add(Sets.newHashSet(memberNames))){
-      throw new IllegalStateException(
-          "VertexGroup " + memberNames + " already defined as another group!");
-    }
-
     // vertex group name should be unique.
     VertexGroup uv = new VertexGroup(name, members);
     if (!vertexGroups.add(uv)) {

http://git-wip-us.apache.org/repos/asf/tez/blob/6702d928/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java
----------------------------------------------------------------------
diff --git a/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java b/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java
index ccd0d62..31ced71 100644
--- a/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java
+++ b/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java
@@ -38,13 +38,7 @@ public class TestDAG {
 
     DAG dag = DAG.create("testDAG");
     dag.createVertexGroup("group_1", v1,v2);
-    try {
-      dag.createVertexGroup("group_1", v1,v2);
-      Assert.fail("should fail it due to duplicated VertexGroups");
-    } catch (Exception e) {
-      e.printStackTrace();
-      Assert.assertEquals("VertexGroup [v1, v2] already defined as another group!", e.getMessage());
-    }
+
     try {
       dag.createVertexGroup("group_1", v2, v3);
       Assert.fail("should fail it due to duplicated VertexGroups");
@@ -52,13 +46,9 @@ public class TestDAG {
       e.printStackTrace();
       Assert.assertEquals("VertexGroup group_1 already defined!", e.getMessage());
     }
-    try {
-      dag.createVertexGroup("group_2", v1, v2);
-      Assert.fail("should fail it due to duplicated VertexGroups");
-    } catch (Exception e) {
-      e.printStackTrace();
-      Assert.assertEquals("VertexGroup [v1, v2] already defined as another group!", e.getMessage());
-    }
+    // it is possible to create vertex group with same member but different group name 
+    dag.createVertexGroup("group_2", v1, v2);
+
   }
 
 


Mime
View raw message