You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/05/29 11:47:03 UTC

incubator-ignite git commit: # fixed by review results.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-218-hdfs-only 913871d92 -> acb493fdb


# fixed by review results.


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

Branch: refs/heads/ignite-218-hdfs-only
Commit: acb493fdb1ab9a4aefba0fd4e571e8aa8b20aa27
Parents: 913871d
Author: iveselovskiy <iv...@gridgain.com>
Authored: Fri May 29 12:46:37 2015 +0300
Committer: iveselovskiy <iv...@gridgain.com>
Committed: Fri May 29 12:46:37 2015 +0300

----------------------------------------------------------------------
 .../igfs/secondary/IgfsSecondaryFileSystem.java |  7 +++++-
 .../igfs/IgfsSecondaryFileSystemImpl.java       |  5 ++++
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 25 ++++++++++++++++----
 3 files changed, 31 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/acb493fd/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
index b6f8226..cb69352 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java
@@ -199,5 +199,10 @@ public interface IgfsSecondaryFileSystem {
      */
     public Map<String,String> properties();
 
-    // TODO: Add close();
+
+    /**
+     * Closes the secondary file system.
+     * @throws IgniteException in case of an error.
+     */
+    public void close() throws IgniteException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/acb493fd/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
index a68e093..926f13a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemImpl.java
@@ -118,4 +118,9 @@ class IgfsSecondaryFileSystemImpl implements IgfsSecondaryFileSystem {
     @Override public Map<String, String> properties() {
         return Collections.emptyMap();
     }
+
+    /** {@inheritDoc} */
+    @Override public void close() throws IgniteException {
+        igfs.stop(false);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/acb493fd/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
index 81fce96..6a630fb 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
@@ -42,8 +42,7 @@ import static org.apache.ignite.internal.processors.igfs.IgfsEx.*;
  * In fact, this class deals with different FileSystems depending on the user context,
  * see {@link IgfsUserContext#currentUser()}.
  */
-// TODO: Remove auto-closeable.
-public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem, AutoCloseable {
+public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSystem {
     /** Properties of file system, see {@link #properties()}
      *
      * See {@link IgfsEx#SECONDARY_FS_CONFIG_PATH}
@@ -466,10 +465,26 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys
     }
 
     /** {@inheritDoc} */
-    @Override public void close() throws IgniteCheckedException {
-        // TODO: Close default FS.
+    @Override public void close() throws IgniteException {
+        Exception e = null;
 
-        fileSysLazyMap.close();
+        try {
+            dfltFs.close();
+        }
+        catch (Exception e0) {
+            e = e0;
+        }
+
+        try {
+            fileSysLazyMap.close();
+        }
+        catch (IgniteCheckedException ice) {
+            if (e == null)
+                e = ice;
+        }
+
+        if (e != null)
+            throw new IgniteException(e);
     }
 
     /**