tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject [19/23] git commit: TEZ-1005. AM relocalization adds resources to the wrong classloader. (Sergey Shelukhin via hitesh)
Date Fri, 20 Jun 2014 22:35:57 GMT
TEZ-1005. AM relocalization adds resources to the wrong classloader. (Sergey Shelukhin via
hitesh)


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

Branch: refs/heads/branch-0.4.1-incubating
Commit: c15d3ac4b9f0e6050326f810feee06c1c0ff67fd
Parents: 5a8d8e4
Author: Hitesh Shah <hitesh@apache.org>
Authored: Thu Apr 3 10:35:10 2014 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Fri Jun 20 15:34:45 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/tez/common/RuntimeUtils.java | 19 +++++++++----------
 .../tez/dag/utils/RelocalizationUtils.java       |  4 ++--
 2 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/c15d3ac4/tez-common/src/main/java/org/apache/tez/common/RuntimeUtils.java
----------------------------------------------------------------------
diff --git a/tez-common/src/main/java/org/apache/tez/common/RuntimeUtils.java b/tez-common/src/main/java/org/apache/tez/common/RuntimeUtils.java
index c3d98f7..5782b1c 100644
--- a/tez-common/src/main/java/org/apache/tez/common/RuntimeUtils.java
+++ b/tez-common/src/main/java/org/apache/tez/common/RuntimeUtils.java
@@ -82,21 +82,20 @@ public class RuntimeUtils {
   // Parameters for addResourcesToSystemClassLoader
   private static final Class<?>[] parameters = new Class[]{URL.class};
   private static Method sysClassLoaderMethod = null;
-  
-  
-  @Private  
-  public static synchronized void addResourcesToSystemClassLoader(List<URL> urls) throws
TezException {
+
+
+  @Private
+  public static synchronized void addResourcesToSystemClassLoader(List<URL> urls) {
     URLClassLoader sysLoader = (URLClassLoader)ClassLoader.getSystemClassLoader();
-    
     if (sysClassLoaderMethod == null) {
       Class<?> sysClass = URLClassLoader.class;
       Method method;
       try {
         method = sysClass.getDeclaredMethod("addURL", parameters);
       } catch (SecurityException e) {
-        throw new TezException("Failed to get handle on method addURL", e);
+        throw new TezUncheckedException("Failed to get handle on method addURL", e);
       } catch (NoSuchMethodException e) {
-        throw new TezException("Failed to get handle on method addURL", e);
+        throw new TezUncheckedException("Failed to get handle on method addURL", e);
       }
       method.setAccessible(true);
       sysClassLoaderMethod = method;
@@ -105,11 +104,11 @@ public class RuntimeUtils {
       try {
         sysClassLoaderMethod.invoke(sysLoader, new Object[] { url });
       } catch (IllegalArgumentException e) {
-        throw new TezException("Failed to invoke addURL for rsrc: " + url, e);
+        throw new TezUncheckedException("Failed to invoke addURL for rsrc: " + url, e);
       } catch (IllegalAccessException e) {
-        throw new TezException("Failed to invoke addURL for rsrc: " + url, e);
+        throw new TezUncheckedException("Failed to invoke addURL for rsrc: " + url, e);
       } catch (InvocationTargetException e) {
-        throw new TezException("Failed to invoke addURL for rsrc: " + url, e);
+        throw new TezUncheckedException("Failed to invoke addURL for rsrc: " + url, e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/c15d3ac4/tez-dag/src/main/java/org/apache/tez/dag/utils/RelocalizationUtils.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/utils/RelocalizationUtils.java b/tez-dag/src/main/java/org/apache/tez/dag/utils/RelocalizationUtils.java
index 7a774b2..b3e0bcf 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/utils/RelocalizationUtils.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/utils/RelocalizationUtils.java
@@ -53,9 +53,9 @@ public class RelocalizationUtils {
   }
 
   public static void addUrlsToClassPath(List<URL> urls) {
-    RuntimeUtils.addResourcesToClasspath(urls);
+    RuntimeUtils.addResourcesToSystemClassLoader(urls);
   }
-  
+
   private static Path downloadResource(String destName, URI uri, Configuration conf)
       throws IOException {
     FileSystem fs = FileSystem.get(uri, conf);


Mime
View raw message