Explorar el Código

YARN-259. Fix LocalDirsHandlerService to use Path rather than URIs. Contributed by Xuan Gong.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-trunk-win@1426395 13f79535-47bb-0310-9956-ffa450edef68
Arun Murthy hace 12 años
padre
commit
709286ed17

+ 3 - 0
hadoop-yarn-project/CHANGES.branch-trunk-win.txt

@@ -19,3 +19,6 @@ branch-trunk-win changes - unreleased
   YARN-234. Added support for process tree and resource calculator in MS Windows 
   to YARN. (Chris Nauroth via acmurthy)
 
+  YARN-259. Fix LocalDirsHandlerService to use Path rather than URIs. (Xuan
+  Gong via acmurthy) 
+

+ 2 - 3
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LocalDirsHandlerService.java

@@ -20,7 +20,6 @@ package org.apache.hadoop.yarn.server.nodemanager;
 
 import java.io.IOException;
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Timer;
@@ -305,7 +304,7 @@ public class LocalDirsHandlerService extends AbstractService {
     ArrayList<String> validPaths = new ArrayList<String>();
     for (int i = 0; i < paths.length; ++i) {
       try {
-        URI uriPath = new URI(paths[i]);
+        URI uriPath = (new Path(paths[i])).toUri();
         if (uriPath.getScheme() == null
             || uriPath.getScheme().equals(FILE_SCHEME)) {
           validPaths.add(uriPath.getPath());
@@ -316,7 +315,7 @@ public class LocalDirsHandlerService extends AbstractService {
               + " is not a valid path. Path should be with " + FILE_SCHEME
               + " scheme or without scheme");
         }
-      } catch (URISyntaxException e) {
+      } catch (IllegalArgumentException e) {
         LOG.warn(e.getMessage());
         throw new YarnException(paths[i]
             + " is not a valid path. Path should be with " + FILE_SCHEME