tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gunt...@apache.org
Subject git commit: TEZ-777. Obtain tokens for LocalResources specified in the DAGPlan (Patch by Gunther Hagleitner, reviewed by Siddharth Seth)
Date Thu, 06 Feb 2014 22:15:09 GMT
Updated Branches:
  refs/heads/master f272fbf0a -> 6480f1bda


TEZ-777. Obtain tokens for LocalResources specified in the DAGPlan (Patch by Gunther Hagleitner,
reviewed by Siddharth Seth)


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

Branch: refs/heads/master
Commit: 6480f1bda362419e6e975072d2e557231911c94a
Parents: f272fbf
Author: Gunther Hagleitner <gunther@apache.org>
Authored: Thu Feb 6 14:10:02 2014 -0800
Committer: Gunther Hagleitner <gunther@apache.org>
Committed: Thu Feb 6 14:10:02 2014 -0800

----------------------------------------------------------------------
 .../org/apache/tez/client/TezClientUtils.java    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/6480f1bd/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 c758458..09c025a 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
@@ -28,9 +28,11 @@ import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.TreeMap;
 import java.util.Vector;
 import java.util.Map.Entry;
@@ -264,9 +266,26 @@ public class TezClientUtils {
           return new Path(input);
         }
       });
+
       Path[] paths = Iterators.toArray(pathIter, Path.class);
       TokenCache.obtainTokensForFileSystems(dagCredentials, paths, conf);
     }
+
+    // Obtain Credentials for the local resources configured on the DAG
+    try {
+      Set<Path> lrPaths = new HashSet<Path>();
+      for (Vertex v: dag.getVertices()) {
+        for (LocalResource lr: v.getTaskLocalResources().values()) {
+          lrPaths.add(ConverterUtils.getPathFromYarnURL(lr.getResource()));
+        }
+      }
+
+      Path[] paths = lrPaths.toArray(new Path[lrPaths.size()]);
+      TokenCache.obtainTokensForFileSystems(dagCredentials, paths, conf);
+
+    } catch (URISyntaxException e) {
+      throw new IOException(e);
+    }
   }
 
   /**


Mime
View raw message