tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject git commit: TEZ-798. Change DAG.addURIsForCredentials to accept a Collection instead of a List. (Gunther Hagleitner via sseth)
Date Wed, 05 Feb 2014 18:48:58 GMT
Updated Branches:
  refs/heads/master 2e93f1763 -> 2eb37a774


TEZ-798. Change DAG.addURIsForCredentials to accept a Collection instead
of a List. (Gunther Hagleitner via sseth)


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

Branch: refs/heads/master
Commit: 2eb37a7749fa6cb1529d22e322694c2217a400e7
Parents: 2e93f17
Author: Siddharth Seth <sseth@apache.org>
Authored: Wed Feb 5 10:48:07 2014 -0800
Committer: Siddharth Seth <sseth@apache.org>
Committed: Wed Feb 5 10:48:07 2014 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/tez/client/TezClientUtils.java | 3 ++-
 tez-api/src/main/java/org/apache/tez/dag/api/DAG.java       | 9 +++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2eb37a77/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java b/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java
index 2a8c848..c758458 100644
--- a/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java
+++ b/tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java
@@ -26,6 +26,7 @@ import java.net.URISyntaxException;
 import java.nio.ByteBuffer;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -255,7 +256,7 @@ public class TezClientUtils {
     // Add additional credentials based on any URIs that the user may have specified.
     
     // Obtain Credentials for any paths that the user may have configured.
-    List<URI> uris = dag.getURIsForCredentials();
+    Collection<URI> uris = dag.getURIsForCredentials();
     if (uris != null && !uris.isEmpty()) {
       Iterator<Path> pathIter = Iterators.transform(uris.iterator(), new Function<URI,
Path>() {
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2eb37a77/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 6d503f4..20da950 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
@@ -19,6 +19,7 @@ package org.apache.tez.dag.api;
 
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -64,7 +65,7 @@ public class DAG { // FIXME rename to Topology
       new DualLinkedHashBidiMap<String, Vertex>();
   final Set<Edge> edges = Sets.newHashSet();
   final String name;
-  final List<URI> urisForCredentials = new LinkedList<URI>();
+  final Collection<URI> urisForCredentials = new HashSet<URI>();
   Credentials credentials;
   Set<VertexGroup> vertexGroups = Sets.newHashSet();
   Set<GroupInputEdge> groupInputEdges = Sets.newHashSet();
@@ -134,7 +135,7 @@ public class DAG { // FIXME rename to Topology
    *          a list of {@link URI}s
    * @return the DAG instance being used
    */
-  public synchronized DAG addURIsForCredentials(List<URI> uris) {
+  public synchronized DAG addURIsForCredentials(Collection<URI> uris) {
     Preconditions.checkNotNull(uris, "URIs cannot be null");
     urisForCredentials.addAll(uris);
     return this;
@@ -146,8 +147,8 @@ public class DAG { // FIXME rename to Topology
    *         are required.
    */
   @Private
-  public synchronized List<URI> getURIsForCredentials() {
-    return Collections.unmodifiableList(urisForCredentials);
+  public synchronized Collection<URI> getURIsForCredentials() {
+    return Collections.unmodifiableCollection(urisForCredentials);
   }
   
   @Private


Mime
View raw message