Procházet zdrojové kódy

AMBARI-20472 MapRed History server start does not create directories in HDFS when WEBHDFS is disabled (dili)

Di Li před 8 roky
rodič
revize
bc37bf748d

binární
ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/files/fast-hdfs-resource.jar


+ 5 - 3
contrib/fast-hdfs-resource/src/main/java/org/apache/ambari/fast_hdfs_resource/Runner.java

@@ -77,12 +77,14 @@ public class Runner {
           pathHadoop = new Path(resource.getSource());
         }
         else {
+          String path = resource.getTarget();
+          pathHadoop = new Path(path);
           if (!resource.isManageIfExists() && dfs.exists(pathHadoop)) {
-            System.out.println("Skipping the operation for not managed DFS directory " + resource.getTarget() +
-                               " since immutable_paths contains it.");
+            System.out.println(
+                String.format("Skipping the operation for not managed DFS directory %s  since immutable_paths contains it.", path)
+            );
             continue;
           }
-          pathHadoop = new Path(resource.getTarget());
         }
 
         if (resource.getAction().equals("create")) {