You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/08/08 10:40:26 UTC

[3/4] ignite git commit: TODOs.

TODOs.


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

Branch: refs/heads/ignite-1926
Commit: 2f95ce875d8b8eaf86b4ffc73da9fcef13807161
Parents: 5930806
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Aug 8 13:33:44 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Aug 8 13:33:44 2016 +0300

----------------------------------------------------------------------
 .../hadoop/fs/LocalIgfsSecondaryFileSystem.java | 68 ++++++++++----------
 1 file changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2f95ce87/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java
index a124cb2..aff80c8 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/LocalIgfsSecondaryFileSystem.java
@@ -233,9 +233,39 @@ public class LocalIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, Li
 
     /** {@inheritDoc} */
     @Override public void mkdirs(IgfsPath path, @Nullable Map<String, String> props) {
-        // TODO: Add properties handling.
-        if (!mkdirs0(fileForPath(path)))
-            throw new IgniteException("Failed to make directories [path=" + path + "]");
+        // TODO: IGNITE-3641: Add properties handling.
+        mkdirs(path);
+    }
+
+    /**
+     * Create directories.
+     *
+     * @param dir Directory.
+     * @return Result.
+     */
+    private boolean mkdirs0(@Nullable File dir) {
+        if (dir == null)
+            return true; // Nothing to create.
+
+        if (dir.exists()) {
+            if (dir.isDirectory())
+                return true; // Already exists, so no-op.
+            else
+                return false; // TODO: should we support symlink?
+        }
+        else {
+            File parentDir = dir.getParentFile();
+
+            if (!mkdirs0(parentDir)) // Create parent first.
+                return false;
+
+            boolean res = dir.mkdir();
+
+            if (!res)
+                res = dir.exists(); // Tolerate concurrent creation.
+
+            return res;
+        }
     }
 
     /** {@inheritDoc} */
@@ -478,6 +508,7 @@ public class LocalIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, Li
      * @return Work directory.
      */
     public String getWorkDirectory() {
+        // TODO: Correct work directory support.
         return workDir;
     }
 
@@ -549,37 +580,6 @@ public class LocalIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, Li
     }
 
     /**
-     * Create directories.
-     *
-     * @param dir Directory.
-     * @return Result.
-     */
-    private boolean mkdirs0(File dir) {
-        if (dir == null)
-            return true; // Nothing to create.
-
-        if (dir.exists()) {
-            if (dir.isDirectory())
-                return true; // Already exists, so no-op.
-            else
-                return false; // TODO: should we support symlink?
-        }
-        else {
-            File parentDir = dir.getParentFile();
-
-            if (!mkdirs0(parentDir)) // Create parent first.
-                return false;
-
-            boolean res = dir.mkdir();
-
-            if (!res)
-                res = dir.exists(); // Tolerate concurrent creation.
-
-            return res;
-        }
-    }
-
-    /**
      * Internal create routine.
      *
      * @param path Path.