ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [24/38] incubator-ignite git commit: # Renaming
Date Fri, 05 Dec 2014 08:44:51 GMT
# Renaming


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

Branch: refs/heads/master
Commit: 5e4cd4d883518be712f44f569fa4e7692e86e913
Parents: 1d26f5f
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Dec 5 11:22:40 2014 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Dec 5 11:22:41 2014 +0300

----------------------------------------------------------------------
 .../examples/ggfs/GgfsMapReduceExample.java     |   2 +-
 .../main/java/org/apache/ignite/IgniteFs.java   |  10 +-
 .../org/gridgain/grid/ggfs/GridGgfsMode.java    |  72 ---
 .../grid/ggfs/GridGgfsOutOfSpaceException.java  |  50 --
 .../grid/ggfs/GridGgfsOutputStream.java         |  27 -
 .../GridGgfsParentNotDirectoryException.java    |  42 --
 .../grid/ggfs/IgniteFsConfiguration.java        |  20 +-
 .../org/gridgain/grid/ggfs/IgniteFsMode.java    |  72 +++
 .../grid/ggfs/IgniteFsOutOfSpaceException.java  |  50 ++
 .../grid/ggfs/IgniteFsOutputStream.java         |  27 +
 .../IgniteFsParentNotDirectoryException.java    |  42 ++
 .../ggfs/common/GridGgfsControlResponse.java    |   4 +-
 .../grid/kernal/ggfs/common/GridGgfsLogger.java |  18 +-
 .../processors/ggfs/GridGgfsAsyncImpl.java      |  10 +-
 .../processors/ggfs/GridGgfsAttributes.java     |  16 +-
 .../processors/ggfs/GridGgfsDataManager.java    |   8 +-
 .../kernal/processors/ggfs/GridGgfsImpl.java    |  72 +--
 .../processors/ggfs/GridGgfsIpcHandler.java     |   4 +-
 .../processors/ggfs/GridGgfsModeResolver.java   |  36 +-
 .../ggfs/GridGgfsOutputStreamAdapter.java       | 255 ----------
 .../ggfs/GridGgfsOutputStreamImpl.java          | 497 -------------------
 .../kernal/processors/ggfs/GridGgfsPaths.java   |  18 +-
 .../processors/ggfs/GridGgfsProcessor.java      |   4 +-
 .../ggfs/IgniteFsOutputStreamAdapter.java       | 255 ++++++++++
 .../ggfs/IgniteFsOutputStreamImpl.java          | 497 +++++++++++++++++++
 .../kernal/processors/job/GridJobWorker.java    |   2 +-
 .../kernal/processors/task/GridTaskWorker.java  |   4 +-
 .../grid/kernal/visor/ggfs/VisorGgfs.java       |   6 +-
 .../kernal/visor/ggfs/VisorGgfsProfiler.java    |   2 +-
 .../visor/ggfs/VisorGgfsProfilerEntry.java      |   6 +-
 .../visor/ggfs/VisorGgfsProfilerTask.java       |  10 +-
 .../visor/node/VisorGgfsConfiguration.java      |  12 +-
 .../ggfs/GridGgfsEventsAbstractSelfTest.java    |   2 +-
 .../grid/ggfs/GridGgfsFragmentizerSelfTest.java |   8 +-
 .../GridGgfsFragmentizerTopologySelfTest.java   |   2 +-
 ...heGgfsPerBlockLruEvictionPolicySelfTest.java |   6 +-
 .../ggfs/GridGgfsAbstractSelfTest.java          |  56 +--
 .../ggfs/GridGgfsAttributesSelfTest.java        |   4 +-
 .../ggfs/GridGgfsDualAbstractSelfTest.java      |   8 +-
 .../ggfs/GridGgfsDualAsyncSelfTest.java         |   2 +-
 .../ggfs/GridGgfsDualSyncSelfTest.java          |   2 +-
 .../ggfs/GridGgfsMetricsSelfTest.java           |  18 +-
 .../ggfs/GridGgfsModeResolverSelfTest.java      |  18 +-
 .../processors/ggfs/GridGgfsModesSelfTest.java  |  16 +-
 .../GridGgfsPrimaryOffheapTieredSelfTest.java   |   2 +-
 .../GridGgfsPrimaryOffheapValuesSelfTest.java   |   2 +-
 .../ggfs/GridGgfsPrimarySelfTest.java           |   2 +-
 .../ggfs/GridGgfsProcessorSelfTest.java         |  12 +-
 .../GridGgfsProcessorValidationSelfTest.java    |   2 +-
 .../processors/ggfs/GridGgfsSizeSelfTest.java   |  10 +-
 .../ggfs/GridGgfsStreamsSelfTest.java           |   8 +-
 .../processors/ggfs/GridGgfsTaskSelfTest.java   |   2 +-
 .../GridGgfsAbstractRecordResolverSelfTest.java |   4 +-
 .../hadoop/v1/GridGgfsHadoopFileSystem.java     |  24 +-
 .../hadoop/v2/GridGgfsHadoopFileSystem.java     |  22 +-
 .../hadoop/GridGgfsHadoopFileSystemWrapper.java |   2 +-
 .../ggfs/hadoop/GridGgfsHadoopInProc.java       |   8 +-
 .../kernal/ggfs/hadoop/GridGgfsHadoopUtils.java |   2 +-
 .../grid/ggfs/GridGgfsEventsTestSuite.java      |   2 +-
 ...dGgfsHadoop20FileSystemAbstractSelfTest.java |   6 +-
 ...doop20FileSystemLoopbackPrimarySelfTest.java |   2 +-
 ...sHadoop20FileSystemShmemPrimarySelfTest.java |   2 +-
 .../GridGgfsHadoopDualAbstractSelfTest.java     |  10 +-
 .../ggfs/GridGgfsHadoopDualAsyncSelfTest.java   |   2 +-
 .../ggfs/GridGgfsHadoopDualSyncSelfTest.java    |   2 +-
 ...ridGgfsHadoopFileSystemAbstractSelfTest.java |   6 +-
 ...idGgfsHadoopFileSystemHandshakeSelfTest.java |   2 +-
 .../GridGgfsHadoopFileSystemLoggerSelfTest.java |   2 +-
 ...GgfsHadoopFileSystemLoggerStateSelfTest.java |   2 +-
 ...adoopFileSystemLoopbackAbstractSelfTest.java |   2 +-
 ...SystemLoopbackEmbeddedDualAsyncSelfTest.java |   2 +-
 ...eSystemLoopbackEmbeddedDualSyncSelfTest.java |   2 +-
 ...leSystemLoopbackEmbeddedPrimarySelfTest.java |   2 +-
 ...SystemLoopbackEmbeddedSecondarySelfTest.java |   2 +-
 ...SystemLoopbackExternalDualAsyncSelfTest.java |   2 +-
 ...eSystemLoopbackExternalDualSyncSelfTest.java |   2 +-
 ...leSystemLoopbackExternalPrimarySelfTest.java |   2 +-
 ...SystemLoopbackExternalSecondarySelfTest.java |   2 +-
 ...fsHadoopFileSystemSecondaryModeSelfTest.java |  10 +-
 ...fsHadoopFileSystemShmemAbstractSelfTest.java |   2 +-
 ...ileSystemShmemEmbeddedDualAsyncSelfTest.java |   2 +-
 ...FileSystemShmemEmbeddedDualSyncSelfTest.java |   2 +-
 ...pFileSystemShmemEmbeddedPrimarySelfTest.java |   2 +-
 ...ileSystemShmemEmbeddedSecondarySelfTest.java |   2 +-
 ...ileSystemShmemExternalDualAsyncSelfTest.java |   2 +-
 ...FileSystemShmemExternalDualSyncSelfTest.java |   2 +-
 ...pFileSystemShmemExternalPrimarySelfTest.java |   2 +-
 ...ileSystemShmemExternalSecondarySelfTest.java |   2 +-
 ...idHadoopDefaultMapReducePlannerSelfTest.java |  10 +-
 ...GridHadoopExternalTaskExecutionSelfTest.java |   2 +-
 90 files changed, 1245 insertions(+), 1245 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/examples/src/main/java/org/gridgain/examples/ggfs/GgfsMapReduceExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/gridgain/examples/ggfs/GgfsMapReduceExample.java b/examples/src/main/java/org/gridgain/examples/ggfs/GgfsMapReduceExample.java
index 89dbbe8..c006641 100644
--- a/examples/src/main/java/org/gridgain/examples/ggfs/GgfsMapReduceExample.java
+++ b/examples/src/main/java/org/gridgain/examples/ggfs/GgfsMapReduceExample.java
@@ -92,7 +92,7 @@ public class GgfsMapReduceExample {
         System.out.println("Copying file to GGFS: " + file);
 
         try (
-            GridGgfsOutputStream os = fs.create(fsPath, true);
+            IgniteFsOutputStream os = fs.create(fsPath, true);
             FileInputStream fis = new FileInputStream(file)
         ) {
             byte[] buf = new byte[2048];

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/apache/ignite/IgniteFs.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteFs.java b/modules/core/src/main/java/org/apache/ignite/IgniteFs.java
index cf9f9a6..241ab3e 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteFs.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteFs.java
@@ -121,7 +121,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
      * @return File output stream to write data to.
      * @throws GridException In case of error.
      */
-    @Override public GridGgfsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException;
+    @Override public IgniteFsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException;
 
     /**
      * Creates a file and opens it for writing.
@@ -135,7 +135,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
      * @return File output stream to write data to.
      * @throws GridException In case of error.
      */
-    @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication,
+    @Override public IgniteFsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication,
         long blockSize, @Nullable Map<String, String> props) throws GridException;
 
     /**
@@ -152,7 +152,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
      * @return File output stream to write data to.
      * @throws GridException In case of error.
      */
-    public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite,
+    public IgniteFsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite,
         @Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map<String, String> props)
         throws GridException;
 
@@ -165,7 +165,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
      * @throws GridException In case of error.
      * @throws org.gridgain.grid.ggfs.IgniteFsFileNotFoundException If path doesn't exist and create flag is {@code false}.
      */
-    public GridGgfsOutputStream append(IgniteFsPath path, boolean create) throws GridException;
+    public IgniteFsOutputStream append(IgniteFsPath path, boolean create) throws GridException;
 
     /**
      * Opens an output stream to an existing file for appending data.
@@ -178,7 +178,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
      * @throws GridException In case of error.
      * @throws org.gridgain.grid.ggfs.IgniteFsFileNotFoundException If path doesn't exist and create flag is {@code false}.
      */
-    @Override public GridGgfsOutputStream append(IgniteFsPath path, int bufSize, boolean create,
+    @Override public IgniteFsOutputStream append(IgniteFsPath path, int bufSize, boolean create,
         @Nullable Map<String, String> props) throws GridException;
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsMode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsMode.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsMode.java
deleted file mode 100644
index 8bca1e5..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsMode.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.ggfs;
-
-import org.jetbrains.annotations.*;
-
-/**
- * {@code GGFS} mode defining interactions with underlying secondary Hadoop file system.
- * Secondary Hadoop file system is provided for pass-through, write-through, and
- * read-through purposes.
- * <p>
- * This mode is configured via {@link IgniteFsConfiguration#getDefaultMode()}
- * configuration property.
- */
-public enum GridGgfsMode {
-    /**
-     * In this mode GGFS will not delegate to secondary Hadoop file system and will
-     * cache all the files in memory only.
-     */
-    PRIMARY,
-
-    /**
-     * In this mode GGFS will not cache any files in memory and will only pass them
-     * through to secondary Hadoop file system. If this mode is enabled, then
-     * secondary Hadoop file system must be configured.
-     *
-     * @see IgniteFsConfiguration#getSecondaryHadoopFileSystemUri()
-     */
-    PROXY,
-
-    /**
-     * In this mode {@code GGFS} will cache files locally and also <i>synchronously</i>
-     * write them through to secondary Hadoop file system.
-     * <p>
-     * If secondary Hadoop file system is not configured, then this mode behaves like
-     * {@link #PRIMARY} mode.
-     *
-     * @see IgniteFsConfiguration#getSecondaryHadoopFileSystemUri()
-     */
-    DUAL_SYNC,
-
-    /**
-     * In this mode {@code GGFS} will cache files locally and also <i>asynchronously</i>
-     * write them through to secondary Hadoop file system.
-     * <p>
-     * If secondary Hadoop file system is not configured, then this mode behaves like
-     * {@link #PRIMARY} mode.
-     *
-     * @see IgniteFsConfiguration#getSecondaryHadoopFileSystemUri()
-     */
-    DUAL_ASYNC;
-
-    /** Enumerated values. */
-    private static final GridGgfsMode[] VALS = values();
-
-    /**
-     * Efficiently gets enumerated value from its ordinal.
-     *
-     * @param ord Ordinal value.
-     * @return Enumerated value or {@code null} if ordinal out of range.
-     */
-    @Nullable public static GridGgfsMode fromOrdinal(int ord) {
-        return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsOutOfSpaceException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsOutOfSpaceException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsOutOfSpaceException.java
deleted file mode 100644
index ce5ef3d..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsOutOfSpaceException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.ggfs;
-
-import org.jetbrains.annotations.*;
-
-/**
- * {@code GGFS} exception that is thrown when it detected out-of-space condition.
- * It is thrown when number of writes written to a {@code GGFS} data nodes exceeds
- * its maximum value (that is configured per-node).
- */
-public class GridGgfsOutOfSpaceException extends IgniteFsException {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * Creates exception with given error message.
-     *
-     * @param msg Error message.
-     */
-    public GridGgfsOutOfSpaceException(String msg) {
-        super(msg);
-    }
-
-    /**
-     * Creates an instance of exception with given exception cause.
-     *
-     * @param cause Exception cause.
-     */
-    public GridGgfsOutOfSpaceException(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Creates an instance of GGFS exception with given error message and given exception cause.
-     *
-     * @param msg Error message.
-     * @param cause Exception cause.
-     */
-    public GridGgfsOutOfSpaceException(String msg, @Nullable Throwable cause) {
-        super(msg, cause);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsOutputStream.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsOutputStream.java
deleted file mode 100644
index 887075c..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsOutputStream.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.ggfs;
-
-import java.io.*;
-
-/**
- * {@code GGFS} output stream to write data into the file system.
- */
-public abstract class GridGgfsOutputStream extends OutputStream {
-    /**
-     * Transfers specified amount of bytes from data input to this output stream.
-     * This method is optimized to avoid unnecessary temporal buffer creation and byte array copy.
-     *
-     * @param in Data input to copy bytes from.
-     * @param len Data length to copy.
-     * @throws IOException If write failed, read from input failed or there is no enough data in data input.
-     */
-    public abstract void transferFrom(DataInput in, int len) throws IOException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java
deleted file mode 100644
index dc71dd2..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.ggfs;
-
-import org.jetbrains.annotations.*;
-
-/**
- * Exception thrown when parent supposed to be a directory is a file.
- */
-public class GridGgfsParentNotDirectoryException extends IgniteFsInvalidPathException {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /**
-     * @param msg Error message.
-     */
-    public GridGgfsParentNotDirectoryException(String msg) {
-        super(msg);
-    }
-
-    /**
-     * @param cause Exception cause.
-     */
-    public GridGgfsParentNotDirectoryException(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * @param msg Error message.
-     * @param cause Exception cause.
-     */
-    public GridGgfsParentNotDirectoryException(String msg, @Nullable Throwable cause) {
-        super(msg, cause);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsConfiguration.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsConfiguration.java
index 8b43058..d86049d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsConfiguration.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsConfiguration.java
@@ -16,7 +16,7 @@ import org.jetbrains.annotations.*;
 import java.util.*;
 import java.util.concurrent.*;
 
-import static org.gridgain.grid.ggfs.GridGgfsMode.*;
+import static org.gridgain.grid.ggfs.IgniteFsMode.*;
 
 /**
  * {@code GGFS} configuration. More than one file system can be configured within grid.
@@ -61,7 +61,7 @@ public class IgniteFsConfiguration {
     public static final int DFLT_PER_NODE_PARALLEL_BATCH_CNT = 8;
 
     /** Default GGFS mode. */
-    public static final GridGgfsMode DFLT_MODE = DUAL_ASYNC;
+    public static final IgniteFsMode DFLT_MODE = DUAL_ASYNC;
 
     /** Default file's data block size (bytes). */
     public static final int DFLT_BLOCK_SIZE = 1 << 16;
@@ -118,7 +118,7 @@ public class IgniteFsConfiguration {
     private IgniteFsFileSystem secondaryFs;
 
     /** GGFS mode. */
-    private GridGgfsMode dfltMode = DFLT_MODE;
+    private IgniteFsMode dfltMode = DFLT_MODE;
 
     /** Fragmentizer throttling block length. */
     private long fragmentizerThrottlingBlockLen = DFLT_FRAGMENTIZER_THROTTLING_BLOCK_LENGTH;
@@ -136,7 +136,7 @@ public class IgniteFsConfiguration {
     private boolean fragmentizerEnabled = DFLT_FRAGMENTIZER_ENABLED;
 
     /** Path modes. */
-    private Map<String, GridGgfsMode> pathModes;
+    private Map<String, IgniteFsMode> pathModes;
 
     /** Maximum space. */
     private long maxSpace;
@@ -485,12 +485,12 @@ public class IgniteFsConfiguration {
      * Secondary Hadoop file system is provided for pass-through, write-through, and read-through
      * purposes.
      * <p>
-     * Default mode is {@link GridGgfsMode#DUAL_ASYNC}. If secondary Hadoop file system is
-     * not configured, this mode will work just like {@link GridGgfsMode#PRIMARY} mode.
+     * Default mode is {@link IgniteFsMode#DUAL_ASYNC}. If secondary Hadoop file system is
+     * not configured, this mode will work just like {@link IgniteFsMode#PRIMARY} mode.
      *
      * @return Mode to specify how GGFS interacts with secondary HDFS file system.
      */
-    public GridGgfsMode getDefaultMode() {
+    public IgniteFsMode getDefaultMode() {
         return dfltMode;
     }
 
@@ -501,7 +501,7 @@ public class IgniteFsConfiguration {
      *
      * @param dfltMode {@code GGFS} mode.
      */
-    public void setDefaultMode(GridGgfsMode dfltMode) {
+    public void setDefaultMode(IgniteFsMode dfltMode) {
         this.dfltMode = dfltMode;
     }
 
@@ -541,7 +541,7 @@ public class IgniteFsConfiguration {
      *
      * @return Map of paths to {@code GGFS} modes.
      */
-    @Nullable public Map<String, GridGgfsMode> getPathModes() {
+    @Nullable public Map<String, IgniteFsMode> getPathModes() {
         return pathModes;
     }
 
@@ -553,7 +553,7 @@ public class IgniteFsConfiguration {
      *
      * @param pathModes Map of paths to {@code GGFS} modes.
      */
-    public void setPathModes(Map<String, GridGgfsMode> pathModes) {
+    public void setPathModes(Map<String, IgniteFsMode> pathModes) {
         this.pathModes = pathModes;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsMode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsMode.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsMode.java
new file mode 100644
index 0000000..67f5eef
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsMode.java
@@ -0,0 +1,72 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.gridgain.grid.ggfs;
+
+import org.jetbrains.annotations.*;
+
+/**
+ * {@code GGFS} mode defining interactions with underlying secondary Hadoop file system.
+ * Secondary Hadoop file system is provided for pass-through, write-through, and
+ * read-through purposes.
+ * <p>
+ * This mode is configured via {@link IgniteFsConfiguration#getDefaultMode()}
+ * configuration property.
+ */
+public enum IgniteFsMode {
+    /**
+     * In this mode GGFS will not delegate to secondary Hadoop file system and will
+     * cache all the files in memory only.
+     */
+    PRIMARY,
+
+    /**
+     * In this mode GGFS will not cache any files in memory and will only pass them
+     * through to secondary Hadoop file system. If this mode is enabled, then
+     * secondary Hadoop file system must be configured.
+     *
+     * @see IgniteFsConfiguration#getSecondaryHadoopFileSystemUri()
+     */
+    PROXY,
+
+    /**
+     * In this mode {@code GGFS} will cache files locally and also <i>synchronously</i>
+     * write them through to secondary Hadoop file system.
+     * <p>
+     * If secondary Hadoop file system is not configured, then this mode behaves like
+     * {@link #PRIMARY} mode.
+     *
+     * @see IgniteFsConfiguration#getSecondaryHadoopFileSystemUri()
+     */
+    DUAL_SYNC,
+
+    /**
+     * In this mode {@code GGFS} will cache files locally and also <i>asynchronously</i>
+     * write them through to secondary Hadoop file system.
+     * <p>
+     * If secondary Hadoop file system is not configured, then this mode behaves like
+     * {@link #PRIMARY} mode.
+     *
+     * @see IgniteFsConfiguration#getSecondaryHadoopFileSystemUri()
+     */
+    DUAL_ASYNC;
+
+    /** Enumerated values. */
+    private static final IgniteFsMode[] VALS = values();
+
+    /**
+     * Efficiently gets enumerated value from its ordinal.
+     *
+     * @param ord Ordinal value.
+     * @return Enumerated value or {@code null} if ordinal out of range.
+     */
+    @Nullable public static IgniteFsMode fromOrdinal(int ord) {
+        return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsOutOfSpaceException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsOutOfSpaceException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsOutOfSpaceException.java
new file mode 100644
index 0000000..cdfee59
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsOutOfSpaceException.java
@@ -0,0 +1,50 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.gridgain.grid.ggfs;
+
+import org.jetbrains.annotations.*;
+
+/**
+ * {@code GGFS} exception that is thrown when it detected out-of-space condition.
+ * It is thrown when number of writes written to a {@code GGFS} data nodes exceeds
+ * its maximum value (that is configured per-node).
+ */
+public class IgniteFsOutOfSpaceException extends IgniteFsException {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Creates exception with given error message.
+     *
+     * @param msg Error message.
+     */
+    public IgniteFsOutOfSpaceException(String msg) {
+        super(msg);
+    }
+
+    /**
+     * Creates an instance of exception with given exception cause.
+     *
+     * @param cause Exception cause.
+     */
+    public IgniteFsOutOfSpaceException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Creates an instance of GGFS exception with given error message and given exception cause.
+     *
+     * @param msg Error message.
+     * @param cause Exception cause.
+     */
+    public IgniteFsOutOfSpaceException(String msg, @Nullable Throwable cause) {
+        super(msg, cause);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsOutputStream.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsOutputStream.java
new file mode 100644
index 0000000..76c6b1f
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsOutputStream.java
@@ -0,0 +1,27 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.gridgain.grid.ggfs;
+
+import java.io.*;
+
+/**
+ * {@code GGFS} output stream to write data into the file system.
+ */
+public abstract class IgniteFsOutputStream extends OutputStream {
+    /**
+     * Transfers specified amount of bytes from data input to this output stream.
+     * This method is optimized to avoid unnecessary temporal buffer creation and byte array copy.
+     *
+     * @param in Data input to copy bytes from.
+     * @param len Data length to copy.
+     * @throws IOException If write failed, read from input failed or there is no enough data in data input.
+     */
+    public abstract void transferFrom(DataInput in, int len) throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsParentNotDirectoryException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsParentNotDirectoryException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsParentNotDirectoryException.java
new file mode 100644
index 0000000..9cc46b7
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsParentNotDirectoryException.java
@@ -0,0 +1,42 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.gridgain.grid.ggfs;
+
+import org.jetbrains.annotations.*;
+
+/**
+ * Exception thrown when parent supposed to be a directory is a file.
+ */
+public class IgniteFsParentNotDirectoryException extends IgniteFsInvalidPathException {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * @param msg Error message.
+     */
+    public IgniteFsParentNotDirectoryException(String msg) {
+        super(msg);
+    }
+
+    /**
+     * @param cause Exception cause.
+     */
+    public IgniteFsParentNotDirectoryException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * @param msg Error message.
+     * @param cause Exception cause.
+     */
+    public IgniteFsParentNotDirectoryException(String msg, @Nullable Throwable cause) {
+        super(msg, cause);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java
index 919a0cd..8beb1df 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java
@@ -259,7 +259,7 @@ public class GridGgfsControlResponse extends GridGgfsMessage {
         else if (errCode == ERR_DIRECTORY_NOT_EMPTY)
             throw new GridGgfsDirectoryNotEmptyException(err);
         else if (errCode == ERR_PARENT_NOT_DIRECTORY)
-            throw new GridGgfsParentNotDirectoryException(err);
+            throw new IgniteFsParentNotDirectoryException(err);
         else if (errCode == ERR_INVALID_HDFS_VERSION)
             throw new IgniteFsInvalidHdfsVersionException(err);
         else if (errCode == ERR_CORRUPTED_FILE)
@@ -330,7 +330,7 @@ public class GridGgfsControlResponse extends GridGgfsMessage {
             return ERR_PATH_ALREADY_EXISTS;
         else if (GridGgfsDirectoryNotEmptyException.class.isInstance(e))
             return ERR_DIRECTORY_NOT_EMPTY;
-        else if (GridGgfsParentNotDirectoryException.class.isInstance(e))
+        else if (IgniteFsParentNotDirectoryException.class.isInstance(e))
             return ERR_PARENT_NOT_DIRECTORY;
         else if (IgniteFsInvalidHdfsVersionException.class.isInstance(e))
             return ERR_INVALID_HDFS_VERSION;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsLogger.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsLogger.java b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsLogger.java
index b1b7d8f..2f0af0b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsLogger.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsLogger.java
@@ -248,7 +248,7 @@ public final class GridGgfsLogger {
      * @param bufSize Buffer size.
      * @param dataLen Data length.
      */
-    public void logOpen(long streamId, IgniteFsPath path, GridGgfsMode mode, int bufSize, long dataLen) {
+    public void logOpen(long streamId, IgniteFsPath path, IgniteFsMode mode, int bufSize, long dataLen) {
         addEntry(new Entry(TYPE_OPEN_IN, path.toString(), mode, streamId, bufSize, dataLen, null, null, null, null,
             null, null, null, null, null, null, null, null, null, null));
     }
@@ -264,7 +264,7 @@ public final class GridGgfsLogger {
      * @param replication Replication factor.
      * @param blockSize Block size.
      */
-    public void logCreate(long streamId, IgniteFsPath path, GridGgfsMode mode, boolean overwrite, int bufSize,
+    public void logCreate(long streamId, IgniteFsPath path, IgniteFsMode mode, boolean overwrite, int bufSize,
         int replication, long blockSize) {
         addEntry(new Entry(TYPE_OPEN_OUT, path.toString(), mode, streamId, bufSize, null, false, overwrite, replication,
             blockSize, null, null, null, null, null, null, null, null, null, null));
@@ -278,7 +278,7 @@ public final class GridGgfsLogger {
      * @param mode Mode.
      * @param bufSize Buffer size.
      */
-    public void logAppend(long streamId, IgniteFsPath path, GridGgfsMode mode, int bufSize) {
+    public void logAppend(long streamId, IgniteFsPath path, IgniteFsMode mode, int bufSize) {
         addEntry(new Entry(TYPE_OPEN_OUT, path.toString(), mode, streamId, bufSize, null, true, null, null, null, null,
             null, null, null, null, null, null, null, null, null));
     }
@@ -370,7 +370,7 @@ public final class GridGgfsLogger {
      * @param path Path.
      * @param mode Mode.
      */
-    public void logMakeDirectory(IgniteFsPath path, GridGgfsMode mode) {
+    public void logMakeDirectory(IgniteFsPath path, IgniteFsMode mode) {
         addEntry(new Entry(TYPE_DIR_MAKE, path.toString(), mode, null, null, null, null, null, null, null, null, null,
             null, null, null, null, null, null, null, null));
     }
@@ -382,7 +382,7 @@ public final class GridGgfsLogger {
      * @param mode Mode.
      * @param files Files.
      */
-    public void logListDirectory(IgniteFsPath path, GridGgfsMode mode, String[] files) {
+    public void logListDirectory(IgniteFsPath path, IgniteFsMode mode, String[] files) {
         addEntry(new Entry(TYPE_DIR_LIST, path.toString(), mode, null, null, null, null, null, null, null, null, null,
             null, null, null, null, null, null, null, files));
     }
@@ -394,7 +394,7 @@ public final class GridGgfsLogger {
      * @param mode Mode.
      * @param destPath Destination path.
      */
-    public void logRename(IgniteFsPath path, GridGgfsMode mode, IgniteFsPath destPath) {
+    public void logRename(IgniteFsPath path, IgniteFsMode mode, IgniteFsPath destPath) {
         addEntry(new Entry(TYPE_RENAME, path.toString(), mode, null, null, null, null, null, null, null, null, null,
             null, null, null, null, null, destPath.toString(), null, null));
     }
@@ -406,7 +406,7 @@ public final class GridGgfsLogger {
      * @param mode Mode.
      * @param recursive Recursive flag.
      */
-    public void logDelete(IgniteFsPath path, GridGgfsMode mode, boolean recursive) {
+    public void logDelete(IgniteFsPath path, IgniteFsMode mode, boolean recursive) {
         addEntry(new Entry(TYPE_DELETE, path.toString(), mode, null, null, null, null, null, null, null, null, null,
             null, null, null, null, null, null, recursive, null));
     }
@@ -491,7 +491,7 @@ public final class GridGgfsLogger {
         private final String path;
 
         /** Path mode. */
-        private GridGgfsMode mode;
+        private IgniteFsMode mode;
 
         /** Stream ID. */
         private final long streamId;
@@ -568,7 +568,7 @@ public final class GridGgfsLogger {
          * @param recursive Recursive flag.
          * @param list Listed directories.
          */
-        Entry(int type, String path, GridGgfsMode mode, Long streamId, Integer bufSize, Long dataLen, Boolean append,
+        Entry(int type, String path, IgniteFsMode mode, Long streamId, Integer bufSize, Long dataLen, Boolean append,
             Boolean overwrite, Integer replication, Long blockSize, Long pos, Integer readLen, Long skipCnt,
             Long readLimit, Long userTime, Long sysTime, Long total, String destPath, Boolean recursive,
             String[] list) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java
index 6b33e17..6e4ad66 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java
@@ -173,30 +173,30 @@ public class GridGgfsAsyncImpl extends IgniteAsyncSupportAdapter implements Grid
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException {
+    @Override public IgniteFsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException {
         return ggfs.create(path, overwrite);
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication,
+    @Override public IgniteFsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication,
         long blockSize, @Nullable Map<String, String> props) throws GridException {
         return ggfs.create(path, bufSize, overwrite, replication, blockSize, props);
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite,
+    @Override public IgniteFsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite,
         @Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map<String, String> props)
         throws GridException {
         return ggfs.create(path, bufSize, overwrite, affKey, replication, blockSize, props);
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream append(IgniteFsPath path, boolean create) throws GridException {
+    @Override public IgniteFsOutputStream append(IgniteFsPath path, boolean create) throws GridException {
         return ggfs.append(path, create);
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream append(IgniteFsPath path, int bufSize, boolean create,
+    @Override public IgniteFsOutputStream append(IgniteFsPath path, int bufSize, boolean create,
         @Nullable Map<String, String> props) throws GridException {
         return ggfs.append(path, bufSize, create, props);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAttributes.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAttributes.java
index 26b80c5..885ca75 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAttributes.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAttributes.java
@@ -40,13 +40,13 @@ public class GridGgfsAttributes implements Externalizable {
     private String dataCacheName;
 
     /** Default mode. */
-    private GridGgfsMode dfltMode;
+    private IgniteFsMode dfltMode;
 
     /** Fragmentizer enabled flag. */
     private boolean fragmentizerEnabled;
 
     /** Path modes. */
-    private Map<String, GridGgfsMode> pathModes;
+    private Map<String, IgniteFsMode> pathModes;
 
     /**
      * @param ggfsName GGFS name.
@@ -58,7 +58,7 @@ public class GridGgfsAttributes implements Externalizable {
      * @param pathModes Path modes.
      */
     public GridGgfsAttributes(String ggfsName, int blockSize, int grpSize, String metaCacheName, String dataCacheName,
-        GridGgfsMode dfltMode, Map<String, GridGgfsMode> pathModes, boolean fragmentizerEnabled) {
+        IgniteFsMode dfltMode, Map<String, IgniteFsMode> pathModes, boolean fragmentizerEnabled) {
         this.blockSize = blockSize;
         this.ggfsName = ggfsName;
         this.grpSize = grpSize;
@@ -114,14 +114,14 @@ public class GridGgfsAttributes implements Externalizable {
     /**
      * @return Default mode.
      */
-    public GridGgfsMode defaultMode() {
+    public IgniteFsMode defaultMode() {
         return dfltMode;
     }
 
     /**
      * @return Path modes.
      */
-    public Map<String, GridGgfsMode> pathModes() {
+    public Map<String, IgniteFsMode> pathModes() {
         return pathModes != null ? Collections.unmodifiableMap(pathModes) : null;
     }
 
@@ -147,7 +147,7 @@ public class GridGgfsAttributes implements Externalizable {
 
             out.writeInt(pathModes.size());
 
-            for (Map.Entry<String, GridGgfsMode> pathMode : pathModes.entrySet()) {
+            for (Map.Entry<String, IgniteFsMode> pathMode : pathModes.entrySet()) {
                 U.writeString(out, pathMode.getKey());
                 U.writeEnum0(out, pathMode.getValue());
             }
@@ -163,7 +163,7 @@ public class GridGgfsAttributes implements Externalizable {
         grpSize = in.readInt();
         metaCacheName = U.readString(in);
         dataCacheName = U.readString(in);
-        dfltMode = GridGgfsMode.fromOrdinal(U.readEnumOrdinal0(in));
+        dfltMode = IgniteFsMode.fromOrdinal(U.readEnumOrdinal0(in));
         fragmentizerEnabled = in.readBoolean();
 
         if (in.readBoolean()) {
@@ -172,7 +172,7 @@ public class GridGgfsAttributes implements Externalizable {
             pathModes = new HashMap<>(size, 1.0f);
 
             for (int i = 0; i < size; i++)
-                pathModes.put(U.readString(in), GridGgfsMode.fromOrdinal(U.readEnumOrdinal0(in)));
+                pathModes.put(U.readString(in), IgniteFsMode.fromOrdinal(U.readEnumOrdinal0(in)));
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java
index 031c15a..0b8fe5f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java
@@ -1090,7 +1090,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
                     return;
                 }
 
-                completionFut.onLocalError(new GridGgfsOutOfSpaceException("Failed to write data block " +
+                completionFut.onLocalError(new IgniteFsOutOfSpaceException("Failed to write data block " +
                     "(GGFS maximum data size exceeded) [used=" + dataCachePrj.ggfsDataSpaceUsed() +
                         ", allowed=" + dataCachePrj.ggfsDataSpaceMax() + ']'));
 
@@ -1253,7 +1253,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
                 // Additional size check.
                 if (dataCachePrj.ggfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax())
                     return new GridFinishedFuture<Object>(ggfsCtx.kernalContext(),
-                        new GridGgfsOutOfSpaceException("Failed to write data block (GGFS maximum data size " +
+                        new IgniteFsOutOfSpaceException("Failed to write data block (GGFS maximum data size " +
                             "exceeded) [used=" + dataCachePrj.ggfsDataSpaceUsed() +
                             ", allowed=" + dataCachePrj.ggfsDataSpaceMax() + ']'));
 
@@ -1833,7 +1833,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
 
             // If waiting for ack from this node.
             if (reqIds != null && !reqIds.isEmpty()) {
-                if (e instanceof GridGgfsOutOfSpaceException)
+                if (e instanceof IgniteFsOutOfSpaceException)
                     onDone(new GridException("Failed to write data (not enough space on node): " + nodeId, e));
                 else
                     onDone(new GridException(
@@ -1845,7 +1845,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
          * @param e Error.
          */
         private void onLocalError(GridException e) {
-            if (e instanceof GridGgfsOutOfSpaceException)
+            if (e instanceof IgniteFsOutOfSpaceException)
                 onDone(new GridException("Failed to write data (not enough space on node): " +
                     ggfsCtx.kernalContext().localNodeId(), e));
             else

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java
index 45a8add..5145abd 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java
@@ -38,7 +38,7 @@ import java.util.*;
 import java.util.concurrent.atomic.*;
 
 import static org.apache.ignite.events.IgniteEventType.*;
-import static org.gridgain.grid.ggfs.GridGgfsMode.*;
+import static org.gridgain.grid.ggfs.IgniteFsMode.*;
 import static org.gridgain.grid.kernal.GridNodeAttributes.*;
 import static org.gridgain.grid.kernal.GridTopic.*;
 import static org.gridgain.grid.kernal.processors.ggfs.GridGgfsFileInfo.*;
@@ -129,7 +129,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
         secondaryFs = cfg.getSecondaryFileSystem();
 
         /* Default GGFS mode. */
-        GridGgfsMode dfltMode;
+        IgniteFsMode dfltMode;
 
         if (secondaryFs == null) {
             if (cfg.getDefaultMode() == PROXY)
@@ -140,8 +140,8 @@ public final class GridGgfsImpl implements GridGgfsEx {
         else
             dfltMode = cfg.getDefaultMode();
 
-        Map<String, GridGgfsMode> cfgModes = new LinkedHashMap<>();
-        Map<String, GridGgfsMode> dfltModes = new LinkedHashMap<>(4, 1.0f);
+        Map<String, IgniteFsMode> cfgModes = new LinkedHashMap<>();
+        Map<String, IgniteFsMode> dfltModes = new LinkedHashMap<>(4, 1.0f);
 
         dfltModes.put("/gridgain/primary", PRIMARY);
 
@@ -154,7 +154,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
         cfgModes.putAll(dfltModes);
 
         if (ggfsCtx.configuration().getPathModes() != null) {
-            for (Map.Entry<String, GridGgfsMode> e : ggfsCtx.configuration().getPathModes().entrySet()) {
+            for (Map.Entry<String, IgniteFsMode> e : ggfsCtx.configuration().getPathModes().entrySet()) {
                 if (!dfltModes.containsKey(e.getKey()))
                     cfgModes.put(e.getKey(), e.getValue());
                 else
@@ -163,13 +163,13 @@ public final class GridGgfsImpl implements GridGgfsEx {
             }
         }
 
-        ArrayList<T2<IgniteFsPath, GridGgfsMode>> modes = null;
+        ArrayList<T2<IgniteFsPath, IgniteFsMode>> modes = null;
 
         if (!cfgModes.isEmpty()) {
             modes = new ArrayList<>(cfgModes.size());
 
-            for (Map.Entry<String, GridGgfsMode> mode : cfgModes.entrySet()) {
-                GridGgfsMode mode0 = secondaryFs == null ? mode.getValue() == PROXY ? PROXY : PRIMARY : mode.getValue();
+            for (Map.Entry<String, IgniteFsMode> mode : cfgModes.entrySet()) {
+                IgniteFsMode mode0 = secondaryFs == null ? mode.getValue() == PROXY ? PROXY : PRIMARY : mode.getValue();
 
                 try {
                     modes.add(new T2<>(new IgniteFsPath(mode.getKey()), mode0));
@@ -467,7 +467,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
         if (log.isDebugEnabled())
             log.debug("Check file exists: " + path);
 
-        GridGgfsMode mode = modeRslvr.resolveMode(path);
+        IgniteFsMode mode = modeRslvr.resolveMode(path);
 
         if (mode == PROXY)
             throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
@@ -505,7 +505,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (log.isDebugEnabled())
                     log.debug("Get file info: " + path);
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
@@ -564,7 +564,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (log.isDebugEnabled())
                     log.debug("Set file properties [path=" + path + ", props=" + props + ']');
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
@@ -619,8 +619,8 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (log.isDebugEnabled())
                     log.debug("Rename file [src=" + src + ", dest=" + dest + ']');
 
-                GridGgfsMode mode = modeRslvr.resolveMode(src);
-                Set<GridGgfsMode> childrenModes = modeRslvr.resolveChildrenModes(src);
+                IgniteFsMode mode = modeRslvr.resolveMode(src);
+                Set<IgniteFsMode> childrenModes = modeRslvr.resolveChildrenModes(src);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + src);
@@ -692,7 +692,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
 
                 // Can move only into directory, but not into file.
                 if (destDesc.isFile)
-                    throw new GridGgfsParentNotDirectoryException("Failed to rename (destination is not a directory): "
+                    throw new IgniteFsParentNotDirectoryException("Failed to rename (destination is not a directory): "
                         + dest);
 
                 meta.move(srcDesc.fileId, srcFileName, srcDesc.parentId, destFileName, destDesc.fileId);
@@ -727,8 +727,8 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (log.isDebugEnabled())
                     log.debug("Deleting file [path=" + path + ", recursive=" + recursive + ']');
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
-                Set<GridGgfsMode> childrenModes = modeRslvr.resolveChildrenModes(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
+                Set<IgniteFsMode> childrenModes = modeRslvr.resolveChildrenModes(path);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
@@ -831,7 +831,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (props == null)
                     props = DFLT_DIR_META;
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
@@ -886,7 +886,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
                                 throw new IgniteFsException(e);
 
                             if (!stored.isDirectory())
-                                throw new GridGgfsParentNotDirectoryException("Failed to create directory (parent " +
+                                throw new IgniteFsParentNotDirectoryException("Failed to create directory (parent " +
                                     "element is not a directory)");
 
                             fileId = stored.id(); // Update node ID.
@@ -915,12 +915,12 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (log.isDebugEnabled())
                     log.debug("List directory: " + path);
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
 
-                Set<GridGgfsMode> childrenModes = modeRslvr.resolveChildrenModes(path);
+                Set<IgniteFsMode> childrenModes = modeRslvr.resolveChildrenModes(path);
 
                 Collection<String> files = new HashSet<>();
 
@@ -967,12 +967,12 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (log.isDebugEnabled())
                     log.debug("List directory details: " + path);
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
 
-                Set<GridGgfsMode> childrenModes = modeRslvr.resolveChildrenModes(path);
+                Set<IgniteFsMode> childrenModes = modeRslvr.resolveChildrenModes(path);
 
                 Collection<IgniteFsFile> files = new HashSet<>();
 
@@ -1060,7 +1060,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (bufSize == 0)
                     bufSize = cfg.getStreamBufferSize();
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
@@ -1107,18 +1107,18 @@ public final class GridGgfsImpl implements GridGgfsEx {
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException {
+    @Override public IgniteFsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException {
         return create0(path, cfg.getStreamBufferSize(), overwrite, null, 0, null, true);
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication,
+    @Override public IgniteFsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication,
         long blockSize, @Nullable Map<String, String> props) throws GridException {
         return create0(path, bufSize, overwrite, null, replication, props, false);
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite,
+    @Override public IgniteFsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite,
         @Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map<String, String> props)
         throws GridException {
         return create0(path, bufSize, overwrite, affKey, replication, props, false);
@@ -1137,7 +1137,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
      * @return Output stream.
      * @throws GridException If file creation failed.
      */
-    private GridGgfsOutputStream create0(
+    private IgniteFsOutputStream create0(
         final IgniteFsPath path,
         final int bufSize,
         final boolean overwrite,
@@ -1155,7 +1155,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
                     log.debug("Open file for writing [path=" + path + ", bufSize=" + bufSize + ", overwrite=" +
                         overwrite + ", props=" + props + ']');
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 GridGgfsFileWorkerBatch batch = null;
 
@@ -1248,12 +1248,12 @@ public final class GridGgfsImpl implements GridGgfsEx {
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream append(IgniteFsPath path, boolean create) throws GridException {
+    @Override public IgniteFsOutputStream append(IgniteFsPath path, boolean create) throws GridException {
         return append(path, cfg.getStreamBufferSize(), create, null);
     }
 
     /** {@inheritDoc} */
-    @Override public GridGgfsOutputStream append(final IgniteFsPath path, final int bufSize, boolean create,
+    @Override public IgniteFsOutputStream append(final IgniteFsPath path, final int bufSize, boolean create,
         @Nullable Map<String, String> props) throws GridException {
         if (enterBusy()) {
             try {
@@ -1264,7 +1264,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
                     log.debug("Open file for appending [path=" + path + ", bufSize=" + bufSize + ", create=" + create +
                         ", props=" + props + ']');
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 GridGgfsFileWorkerBatch batch = null;
 
@@ -1396,7 +1396,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
                 if (log.isDebugEnabled())
                     log.debug("Get affinity for file block [path=" + path + ", start=" + start + ", len=" + len + ']');
 
-                GridGgfsMode mode = modeRslvr.resolveMode(path);
+                IgniteFsMode mode = modeRslvr.resolveMode(path);
 
                 if (mode == PROXY)
                     throw new GridException("PROXY mode cannot be used in GGFS directly: " + path);
@@ -1783,7 +1783,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
      * @return File info or {@code null} in case file is not found.
      * @throws GridException If failed.
      */
-    private GridGgfsFileInfo resolveFileInfo(IgniteFsPath path, GridGgfsMode mode) throws GridException {
+    private GridGgfsFileInfo resolveFileInfo(IgniteFsPath path, IgniteFsMode mode) throws GridException {
         assert path != null;
         assert mode != null;
 
@@ -1899,7 +1899,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
     /**
      * GGFS output stream extension that fires events.
      */
-    private class GgfsEventAwareOutputStream extends GridGgfsOutputStreamImpl {
+    private class GgfsEventAwareOutputStream extends IgniteFsOutputStreamImpl {
         /** Close guard. */
         private final AtomicBoolean closeGuard = new AtomicBoolean(false);
 
@@ -1915,7 +1915,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
          * @throws GridException In case of error.
          */
         GgfsEventAwareOutputStream(IgniteFsPath path, GridGgfsFileInfo fileInfo,
-            IgniteUuid parentId, int bufSize, GridGgfsMode mode, @Nullable GridGgfsFileWorkerBatch batch)
+            IgniteUuid parentId, int bufSize, IgniteFsMode mode, @Nullable GridGgfsFileWorkerBatch batch)
             throws GridException {
             super(ggfsCtx, path, fileInfo, parentId, bufSize, mode, batch, metrics);
 
@@ -2137,7 +2137,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
 
     /** {@inheritDoc} */
     @Override public boolean isProxy(URI path) {
-        GridGgfsMode mode = F.isEmpty(cfg.getPathModes()) ? cfg.getDefaultMode() :
+        IgniteFsMode mode = F.isEmpty(cfg.getPathModes()) ? cfg.getDefaultMode() :
             modeRslvr.resolveMode(new IgniteFsPath(path));
 
         return mode == PROXY;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java
index decad5a..14d05bd 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java
@@ -415,7 +415,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler {
                 }
                 catch (IOException e) {
                     // Unwrap OutOfSpaceException, if has one.
-                    GridGgfsOutOfSpaceException space = X.cause(e, GridGgfsOutOfSpaceException.class);
+                    IgniteFsOutOfSpaceException space = X.cause(e, IgniteFsOutOfSpaceException.class);
 
                     if (space != null)
                         throw space;
@@ -471,7 +471,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler {
             case WRITE_BLOCK: {
                 assert rsrcId != null : "Missing stream ID";
 
-                GridGgfsOutputStream out = (GridGgfsOutputStream)resource(ses, rsrcId);
+                IgniteFsOutputStream out = (IgniteFsOutputStream)resource(ses, rsrcId);
 
                 if (out == null)
                     throw new GridException("Output stream not found (already closed?): " + rsrcId);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java
index 022ca75..c0701ef 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java
@@ -24,33 +24,33 @@ public class GridGgfsModeResolver {
     private static final int MAX_PATH_CACHE = 1000;
 
     /** Default mode. */
-    private final GridGgfsMode dfltMode;
+    private final IgniteFsMode dfltMode;
 
     /** Modes for particular paths. Ordered from longest to shortest. */
-    private ArrayList<T2<IgniteFsPath, GridGgfsMode>> modes;
+    private ArrayList<T2<IgniteFsPath, IgniteFsMode>> modes;
 
     /** Cached modes per path. */
-    private Map<IgniteFsPath, GridGgfsMode> modesCache;
+    private Map<IgniteFsPath, IgniteFsMode> modesCache;
 
     /** Cached children modes per path. */
-    private Map<IgniteFsPath, Set<GridGgfsMode>> childrenModesCache;
+    private Map<IgniteFsPath, Set<IgniteFsMode>> childrenModesCache;
 
     /**
      * @param dfltMode Default GGFS mode.
      * @param modes List of configured modes.
      */
-    public GridGgfsModeResolver(GridGgfsMode dfltMode, @Nullable List<T2<IgniteFsPath, GridGgfsMode>> modes) {
+    public GridGgfsModeResolver(IgniteFsMode dfltMode, @Nullable List<T2<IgniteFsPath, IgniteFsMode>> modes) {
         assert dfltMode != null;
 
         this.dfltMode = dfltMode;
 
         if (modes != null) {
-            ArrayList<T2<IgniteFsPath, GridGgfsMode>> modes0 = new ArrayList<>(modes);
+            ArrayList<T2<IgniteFsPath, IgniteFsMode>> modes0 = new ArrayList<>(modes);
 
             // Sort paths, longest first.
-            Collections.sort(modes0, new Comparator<Map.Entry<IgniteFsPath, GridGgfsMode>>() {
-                @Override public int compare(Map.Entry<IgniteFsPath, GridGgfsMode> o1,
-                    Map.Entry<IgniteFsPath, GridGgfsMode> o2) {
+            Collections.sort(modes0, new Comparator<Map.Entry<IgniteFsPath, IgniteFsMode>>() {
+                @Override public int compare(Map.Entry<IgniteFsPath, IgniteFsMode> o1,
+                    Map.Entry<IgniteFsPath, IgniteFsMode> o2) {
                     return o2.getKey().components().size() - o1.getKey().components().size();
                 }
             });
@@ -68,16 +68,16 @@ public class GridGgfsModeResolver {
      * @param path GGFS path.
      * @return GGFS mode.
      */
-    public GridGgfsMode resolveMode(IgniteFsPath path) {
+    public IgniteFsMode resolveMode(IgniteFsPath path) {
         assert path != null;
 
         if (modes == null)
             return dfltMode;
         else {
-            GridGgfsMode mode = modesCache.get(path);
+            IgniteFsMode mode = modesCache.get(path);
 
             if (mode == null) {
-                for (T2<IgniteFsPath, GridGgfsMode> entry : modes) {
+                for (T2<IgniteFsPath, IgniteFsMode> entry : modes) {
                     if (startsWith(path, entry.getKey())) {
                         // As modes ordered from most specific to least specific first mode found is ours.
                         mode = entry.getValue();
@@ -100,20 +100,20 @@ public class GridGgfsModeResolver {
      * @param path Path.
      * @return Set of all modes that children paths could have.
      */
-    public Set<GridGgfsMode> resolveChildrenModes(IgniteFsPath path) {
+    public Set<IgniteFsMode> resolveChildrenModes(IgniteFsPath path) {
         assert path != null;
 
         if (modes == null)
             return Collections.singleton(dfltMode);
         else {
-            Set<GridGgfsMode> children = childrenModesCache.get(path);
+            Set<IgniteFsMode> children = childrenModesCache.get(path);
 
             if (children == null) {
-                children = new HashSet<>(GridGgfsMode.values().length, 1.0f);
+                children = new HashSet<>(IgniteFsMode.values().length, 1.0f);
 
-                GridGgfsMode pathDefault = dfltMode;
+                IgniteFsMode pathDefault = dfltMode;
 
-                for (T2<IgniteFsPath, GridGgfsMode> child : modes) {
+                for (T2<IgniteFsPath, IgniteFsMode> child : modes) {
                     if (startsWith(path, child.getKey())) {
                         pathDefault = child.getValue();
 
@@ -136,7 +136,7 @@ public class GridGgfsModeResolver {
      * @return Unmodifiable copy of properly ordered modes prefixes
      *  or {@code null} if no modes set.
      */
-    @Nullable public List<T2<IgniteFsPath, GridGgfsMode>> modesOrdered() {
+    @Nullable public List<T2<IgniteFsPath, IgniteFsMode>> modesOrdered() {
         return modes != null ? Collections.unmodifiableList(modes) : null;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e4cd4d8/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java
deleted file mode 100644
index 40334fc..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.kernal.processors.ggfs;
-
-import org.gridgain.grid.*;
-import org.gridgain.grid.ggfs.*;
-import org.gridgain.grid.util.typedef.internal.*;
-import org.jetbrains.annotations.*;
-
-import java.io.*;
-import java.nio.*;
-
-/**
- * Output stream to store data into grid cache with separate blocks.
- */
-@SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
-abstract class GridGgfsOutputStreamAdapter extends GridGgfsOutputStream {
-    /** Path to file. */
-    protected final IgniteFsPath path;
-
-    /** Buffer size. */
-    private final int bufSize;
-
-    /** Flag for this stream open/closed state. */
-    private boolean closed;
-
-    /** Local buffer to store stream data as consistent block. */
-    private ByteBuffer buf;
-
-    /** Bytes written. */
-    @SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized")
-    protected long bytes;
-
-    /** Time consumed by write operations. */
-    protected long time;
-
-    /**
-     * Constructs file output stream.
-     *
-     * @param path Path to stored file.
-     * @param bufSize The size of the buffer to be used.
-     */
-    GridGgfsOutputStreamAdapter(IgniteFsPath path, int bufSize) {
-        assert path != null;
-        assert bufSize > 0;
-
-        this.path = path;
-        this.bufSize = bufSize;
-    }
-
-    /**
-     * Gets number of written bytes.
-     *
-     * @return Written bytes.
-     */
-    public long bytes() {
-        return bytes;
-    }
-
-    /** {@inheritDoc} */
-    @Override public synchronized void write(int b) throws IOException {
-        checkClosed(null, 0);
-
-        long startTime = System.nanoTime();
-
-        b &= 0xFF;
-
-        if (buf == null)
-            buf = ByteBuffer.allocate(bufSize);
-
-        buf.put((byte)b);
-
-        if (buf.position() >= bufSize)
-            sendData(true); // Send data to server.
-
-        time += System.nanoTime() - startTime;
-    }
-
-    /** {@inheritDoc} */
-    @Override public synchronized void write(byte[] b, int off, int len) throws IOException {
-        A.notNull(b, "b");
-
-        if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
-            throw new IndexOutOfBoundsException("Invalid bounds [data.length=" + b.length + ", offset=" + off +
-                ", length=" + len + ']');
-        }
-
-        checkClosed(null, 0);
-
-        if (len == 0)
-            return; // Done.
-
-        long startTime = System.nanoTime();
-
-        if (buf == null) {
-            // Do not allocate and copy byte buffer if will send data immediately.
-            if (len >= bufSize) {
-                buf = ByteBuffer.wrap(b, off, len);
-
-                sendData(false);
-
-                return;
-            }
-
-            buf = ByteBuffer.allocate(Math.max(bufSize, len));
-        }
-
-        if (buf.remaining() < len)
-            // Expand buffer capacity, if remaining size is less then data size.
-            buf = ByteBuffer.allocate(buf.position() + len).put((ByteBuffer)buf.flip());
-
-        assert len <= buf.remaining() : "Expects write data size less or equal then remaining buffer capacity " +
-            "[len=" + len + ", buf.remaining=" + buf.remaining() + ']';
-
-        buf.put(b, off, len);
-
-        if (buf.position() >= bufSize)
-            sendData(true); // Send data to server.
-
-        time += System.nanoTime() - startTime;
-    }
-
-    /** {@inheritDoc} */
-    @Override public synchronized void transferFrom(DataInput in, int len) throws IOException {
-        checkClosed(in, len);
-
-        long startTime = System.nanoTime();
-
-        // Send all IPC data from the local buffer before streaming.
-        if (buf != null && buf.position() > 0)
-            sendData(true);
-
-        try {
-            storeDataBlocks(in, len);
-        }
-        catch (GridException e) {
-            throw new IOException(e.getMessage(), e);
-        }
-
-        time += System.nanoTime() - startTime;
-    }
-
-    /**
-     * Flushes this output stream and forces any buffered output bytes to be written out.
-     *
-     * @exception IOException  if an I/O error occurs.
-     */
-    @Override public synchronized void flush() throws IOException {
-        checkClosed(null, 0);
-
-        // Send all IPC data from the local buffer.
-        if (buf != null && buf.position() > 0)
-            sendData(true);
-    }
-
-    /** {@inheritDoc} */
-    @Override public final synchronized void close() throws IOException {
-        // Do nothing if stream is already closed.
-        if (closed)
-            return;
-
-        try {
-            // Send all IPC data from the local buffer.
-            try {
-                flush();
-            }
-            finally {
-                onClose(); // "onClose()" routine must be invoked anyway!
-            }
-        }
-        finally {
-            // Mark this stream closed AFTER flush.
-            closed = true;
-        }
-    }
-
-    /**
-     * Store data blocks in file.<br/>
-     * Note! If file concurrently deleted we'll get lost blocks.
-     *
-     * @param data Data to store.
-     * @throws GridException If failed.
-     */
-    protected abstract void storeDataBlock(ByteBuffer data) throws GridException, IOException;
-
-    /**
-     * Store data blocks in file reading appropriate number of bytes from given data input.
-     *
-     * @param in Data input to read from.
-     * @param len Data length to store.
-     * @throws GridException If failed.
-     */
-    protected abstract void storeDataBlocks(DataInput in, int len) throws GridException, IOException;
-
-    /**
-     * Close callback. It will be called only once in synchronized section.
-     *
-     * @throws IOException If failed.
-     */
-    protected void onClose() throws IOException {
-        // No-op.
-    }
-
-    /**
-     * Validate this stream is open.
-     *
-     * @throws IOException If this stream is closed.
-     */
-    private void checkClosed(@Nullable DataInput in, int len) throws IOException {
-        assert Thread.holdsLock(this);
-
-        if (closed) {
-            // Must read data from stream before throwing exception.
-            if (in != null)
-                in.skipBytes(len);
-
-            throw new IOException("Stream has been closed: " + this);
-        }
-    }
-
-    /**
-     * Send all local-buffered data to server.
-     *
-     * @param flip Whether to flip buffer on sending data. We do not want to flip it if sending wrapped
-     *      byte array.
-     * @throws IOException In case of IO exception.
-     */
-    private void sendData(boolean flip) throws IOException {
-        assert Thread.holdsLock(this);
-
-        try {
-            if (flip)
-                buf.flip();
-
-            storeDataBlock(buf);
-        }
-        catch (GridException e) {
-            throw new IOException("Failed to store data into file: " + path, e);
-        }
-
-        buf = null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridGgfsOutputStreamAdapter.class, this);
-    }
-}


Mime
View raw message