ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsetrak...@apache.org
Subject [02/61] [abbrv] incubator-ignite git commit: sprint-1 - Renaming and moving ignitefs classes.
Date Fri, 06 Feb 2015 04:25:15 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemHandshakeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemHandshakeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemHandshakeSelfTest.java
new file mode 100644
index 0000000..dd63a95
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemHandshakeSelfTest.java
@@ -0,0 +1,311 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import org.apache.hadoop.conf.*;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.*;
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.fs.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.*;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheDistributionMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+import static org.apache.ignite.internal.fs.hadoop.GridGgfsHadoopUtils.*;
+import static org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEndpoint.*;
+
+/**
+ * Tests for GGFS file system handshake.
+ */
+public class GridGgfsHadoopFileSystemHandshakeSelfTest extends GridGgfsCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** Grid name. */
+    private static final String GRID_NAME = "grid";
+
+    /** GGFS name. */
+    private static final String GGFS_NAME = "ggfs";
+
+    /** GGFS path. */
+    private static final IgniteFsPath PATH = new IgniteFsPath("/path");
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids(true);
+    }
+
+    /**
+     * Tests for Grid and GGFS having normal names.
+     *
+     * @throws Exception If failed.
+     */
+    public void testHandshake() throws Exception {
+        startUp(false, false);
+
+        checkValid(GGFS_NAME + ":" + GRID_NAME + "@");
+        checkValid(GGFS_NAME + ":" + GRID_NAME + "@127.0.0.1");
+        checkValid(GGFS_NAME + ":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid(GGFS_NAME + "@");
+        checkInvalid(GGFS_NAME + "@127.0.0.1");
+        checkInvalid(GGFS_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid(":" + GRID_NAME + "@");
+        checkInvalid(":" + GRID_NAME + "@127.0.0.1");
+        checkInvalid(":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid("");
+        checkInvalid("127.0.0.1");
+        checkInvalid("127.0.0.1:" + DFLT_IPC_PORT);
+    }
+
+    /**
+     * Tests for Grid having {@code null} name and GGFS having normal name.
+     *
+     * @throws Exception If failed.
+     */
+    public void testHandshakeDefaultGrid() throws Exception {
+        startUp(true, false);
+
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@");
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@127.0.0.1");
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkValid(GGFS_NAME + "@");
+        checkValid(GGFS_NAME + "@127.0.0.1");
+        checkValid(GGFS_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid(":" + GRID_NAME + "@");
+        checkInvalid(":" + GRID_NAME + "@127.0.0.1");
+        checkInvalid(":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid("");
+        checkInvalid("127.0.0.1");
+        checkInvalid("127.0.0.1:" + DFLT_IPC_PORT);
+    }
+
+    /**
+     * Tests for Grid having normal name and GGFS having {@code null} name.
+     *
+     * @throws Exception If failed.
+     */
+    public void testHandshakeDefaultGgfs() throws Exception {
+        startUp(false, true);
+
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@");
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@127.0.0.1");
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid(GGFS_NAME + "@");
+        checkInvalid(GGFS_NAME + "@127.0.0.1");
+        checkInvalid(GGFS_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkValid(":" + GRID_NAME + "@");
+        checkValid(":" + GRID_NAME + "@127.0.0.1");
+        checkValid(":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid("");
+        checkInvalid("127.0.0.1");
+        checkInvalid("127.0.0.1:" + DFLT_IPC_PORT);
+    }
+
+    /**
+     * Tests for Grid having {@code null} name and GGFS having {@code null} name.
+     *
+     * @throws Exception If failed.
+     */
+    public void testHandshakeDefaultGridDefaultGgfs() throws Exception {
+        startUp(true, true);
+
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@");
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@127.0.0.1");
+        checkInvalid(GGFS_NAME + ":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid(GGFS_NAME + "@");
+        checkInvalid(GGFS_NAME + "@127.0.0.1");
+        checkInvalid(GGFS_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkInvalid(":" + GRID_NAME + "@");
+        checkInvalid(":" + GRID_NAME + "@127.0.0.1");
+        checkInvalid(":" + GRID_NAME + "@127.0.0.1:" + DFLT_IPC_PORT);
+
+        checkValid("");
+        checkValid("127.0.0.1");
+        checkValid("127.0.0.1:" + DFLT_IPC_PORT);
+    }
+
+    /**
+     * Perform startup.
+     *
+     * @param dfltGridName Default Grid name.
+     * @param dfltGgfsName Default GGFS name.
+     * @throws Exception If failed.
+     */
+    private void startUp(boolean dfltGridName, boolean dfltGgfsName) throws Exception {
+        Ignite ignite = G.start(gridConfiguration(dfltGridName, dfltGgfsName));
+
+        IgniteFs ggfs = ignite.fileSystem(dfltGgfsName ? null : GGFS_NAME);
+
+        ggfs.mkdirs(PATH);
+    }
+
+    /**
+     * Create Grid configuration.
+     *
+     * @param dfltGridName Default Grid name.
+     * @param dfltGgfsName Default GGFS name.
+     * @return Grid configuration.
+     * @throws Exception If failed.
+     */
+    private IgniteConfiguration gridConfiguration(boolean dfltGridName, boolean dfltGgfsName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(dfltGridName ? null : GRID_NAME);
+
+        cfg.setLocalHost("127.0.0.1");
+        cfg.setRestEnabled(false);
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(discoSpi);
+
+        TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+
+        commSpi.setSharedMemoryPort(-1);
+
+        cfg.setCommunicationSpi(commSpi);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setName("replicated");
+        metaCacheCfg.setCacheMode(REPLICATED);
+        metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+        metaCacheCfg.setQueryIndexEnabled(false);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
+
+        dataCacheCfg.setName("partitioned");
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setDistributionMode(PARTITIONED_ONLY);
+        dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+        dataCacheCfg.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(128));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setQueryIndexEnabled(false);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        cfg.setCacheConfiguration(metaCacheCfg, dataCacheCfg);
+
+        IgniteFsConfiguration ggfsCfg = new IgniteFsConfiguration();
+
+        ggfsCfg.setDataCacheName("partitioned");
+        ggfsCfg.setMetaCacheName("replicated");
+        ggfsCfg.setName(dfltGgfsName ? null : GGFS_NAME);
+        ggfsCfg.setPrefetchBlocks(1);
+        ggfsCfg.setDefaultMode(PRIMARY);
+        ggfsCfg.setIpcEndpointConfiguration(new HashMap<String, String>() {{
+            put("type", "tcp");
+            put("port", String.valueOf(DFLT_IPC_PORT));
+        }});
+
+        ggfsCfg.setManagementPort(-1);
+        ggfsCfg.setBlockSize(512 * 1024);
+
+        cfg.setGgfsConfiguration(ggfsCfg);
+
+        return cfg;
+    }
+
+    /**
+     * Check valid file system endpoint.
+     *
+     * @param authority Authority.
+     * @throws Exception If failed.
+     */
+    private void checkValid(String authority) throws Exception {
+        FileSystem fs = fileSystem(authority);
+
+        assert fs.exists(new Path(PATH.toString()));
+    }
+
+    /**
+     * Check invalid file system endpoint.
+     *
+     * @param authority Authority.
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+    private void checkInvalid(final String authority) throws Exception {
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                fileSystem(authority);
+
+                return null;
+            }
+        }, IOException.class, null);
+    }
+
+    /**
+     *
+     *
+     * @param authority Authority.
+     * @return File system.
+     * @throws Exception If failed.
+     */
+    private static FileSystem fileSystem(String authority) throws Exception {
+        return FileSystem.get(new URI("ggfs://" + authority + "/"), configuration(authority));
+    }
+
+    /**
+     * Create configuration for test.
+     *
+     * @param authority Authority.
+     * @return Configuration.
+     */
+    private static Configuration configuration(String authority) {
+        Configuration cfg = new Configuration();
+
+        cfg.set("fs.defaultFS", "ggfs://" + authority + "/");
+        cfg.set("fs.ggfs.impl", org.apache.ignite.ignitefs.hadoop.v1.GridGgfsHadoopFileSystem.class.getName());
+        cfg.set("fs.AbstractFileSystem.ggfs.impl",
+            org.apache.ignite.ignitefs.hadoop.v2.GridGgfsHadoopFileSystem.class.getName());
+
+        cfg.setBoolean("fs.ggfs.impl.disable.cache", true);
+
+        cfg.setBoolean(String.format(PARAM_GGFS_ENDPOINT_NO_EMBED, authority), true);
+        cfg.setBoolean(String.format(PARAM_GGFS_ENDPOINT_NO_LOCAL_SHMEM, authority), true);
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemIpcCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemIpcCacheSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemIpcCacheSelfTest.java
new file mode 100644
index 0000000..0f401f3
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemIpcCacheSelfTest.java
@@ -0,0 +1,207 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import org.apache.hadoop.conf.*;
+import org.apache.hadoop.fs.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.fs.hadoop.*;
+import org.apache.ignite.internal.processors.fs.*;
+import org.apache.ignite.internal.util.ipc.shmem.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import java.lang.reflect.*;
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.atomic.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.events.IgniteEventType.*;
+
+/**
+ * IPC cache test.
+ */
+public class GridGgfsHadoopFileSystemIpcCacheSelfTest extends GridGgfsCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** Path to test hadoop configuration. */
+    private static final String HADOOP_FS_CFG = "modules/core/src/test/config/hadoop/core-site.xml";
+
+    /** Group size. */
+    public static final int GRP_SIZE = 128;
+
+    /** Started grid counter. */
+    private static int cnt;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+        discoSpi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(discoSpi);
+
+        IgniteFsConfiguration ggfsCfg = new IgniteFsConfiguration();
+
+        ggfsCfg.setDataCacheName("partitioned");
+        ggfsCfg.setMetaCacheName("replicated");
+        ggfsCfg.setName("ggfs");
+        ggfsCfg.setManagementPort(IgniteFsConfiguration.DFLT_MGMT_PORT + cnt);
+
+        ggfsCfg.setIpcEndpointConfiguration(new HashMap<String, String>() {{
+            put("type", "shmem");
+            put("port", String.valueOf(IpcSharedMemoryServerEndpoint.DFLT_IPC_PORT + cnt));
+        }});
+
+        ggfsCfg.setBlockSize(512 * 1024); // Together with group blocks mapper will yield 64M per node groups.
+
+        cfg.setGgfsConfiguration(ggfsCfg);
+
+        cfg.setCacheConfiguration(cacheConfiguration());
+
+        cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
+
+        TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+
+        commSpi.setSharedMemoryPort(-1);
+
+        cfg.setCommunicationSpi(commSpi);
+
+        cnt++;
+
+        return cfg;
+    }
+
+    /**
+     * Gets cache configuration.
+     *
+     * @return Cache configuration.
+     */
+    private CacheConfiguration[] cacheConfiguration() {
+        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+        cacheCfg.setName("partitioned");
+        cacheCfg.setCacheMode(PARTITIONED);
+        cacheCfg.setDistributionMode(CacheDistributionMode.PARTITIONED_ONLY);
+        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cacheCfg.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(GRP_SIZE));
+        cacheCfg.setBackups(0);
+        cacheCfg.setQueryIndexEnabled(false);
+        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setName("replicated");
+        metaCacheCfg.setCacheMode(REPLICATED);
+        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        metaCacheCfg.setQueryIndexEnabled(false);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        return new CacheConfiguration[] {metaCacheCfg, cacheCfg};
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        startGrids(4);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        G.stopAll(true);
+    }
+
+    /**
+     * Test how IPC cache map works.
+     *
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("unchecked")
+    public void testIpcCache() throws Exception {
+        Field cacheField = GridGgfsHadoopIpcIo.class.getDeclaredField("ipcCache");
+
+        cacheField.setAccessible(true);
+
+        Field activeCntField = GridGgfsHadoopIpcIo.class.getDeclaredField("activeCnt");
+
+        activeCntField.setAccessible(true);
+
+        Map<String, GridGgfsHadoopIpcIo> cache = (Map<String, GridGgfsHadoopIpcIo>)cacheField.get(null);
+
+        String name = "ggfs:" + getTestGridName(0) + "@";
+
+        Configuration cfg = new Configuration();
+
+        cfg.addResource(U.resolveGridGainUrl(HADOOP_FS_CFG));
+        cfg.setBoolean("fs.ggfs.impl.disable.cache", true);
+        cfg.setBoolean(String.format(GridGgfsHadoopUtils.PARAM_GGFS_ENDPOINT_NO_EMBED, name), true);
+
+        // Ensure that existing IO is reused.
+        FileSystem fs1 = FileSystem.get(new URI("ggfs://" + name + "/"), cfg);
+
+        assertEquals(1, cache.size());
+
+        GridGgfsHadoopIpcIo io = null;
+
+        System.out.println("CACHE: " + cache);
+
+        for (String key : cache.keySet()) {
+            if (key.contains("10500")) {
+                io = cache.get(key);
+
+                break;
+            }
+        }
+
+        assert io != null;
+
+        assertEquals(1, ((AtomicInteger)activeCntField.get(io)).get());
+
+        // Ensure that when IO is used by multiple file systems and one of them is closed, IO is not stopped.
+        FileSystem fs2 = FileSystem.get(new URI("ggfs://" + name + "/abc"), cfg);
+
+        assertEquals(1, cache.size());
+        assertEquals(2, ((AtomicInteger)activeCntField.get(io)).get());
+
+        fs2.close();
+
+        assertEquals(1, cache.size());
+        assertEquals(1, ((AtomicInteger)activeCntField.get(io)).get());
+
+        Field stopField = GridGgfsHadoopIpcIo.class.getDeclaredField("stopping");
+
+        stopField.setAccessible(true);
+
+        assert !(Boolean)stopField.get(io);
+
+        // Ensure that IO is stopped when nobody else is need it.
+        fs1.close();
+
+        assert cache.isEmpty();
+
+        assert (Boolean)stopField.get(io);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoggerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoggerSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoggerSelfTest.java
new file mode 100644
index 0000000..b17f976
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoggerSelfTest.java
@@ -0,0 +1,287 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import org.apache.ignite.internal.fs.common.*;
+import org.apache.ignite.internal.processors.fs.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+
+import java.io.*;
+import java.util.*;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+import static org.apache.ignite.internal.fs.common.GridGgfsLogger.*;
+
+/**
+ * Grid GGFS client logger test.
+ */
+public class GridGgfsHadoopFileSystemLoggerSelfTest extends GridGgfsCommonAbstractTest {
+    /** Path string. */
+    private static final String PATH_STR = "/dir1/dir2/file;test";
+
+    /** Path string with escaped semicolons. */
+    private static final String PATH_STR_ESCAPED = PATH_STR.replace(';', '~');
+
+    /** Path. */
+    private static final IgniteFsPath PATH = new IgniteFsPath(PATH_STR);
+
+    /** GGFS name. */
+    private static final String GGFS_NAME = "ggfs";
+
+    /** Log file path. */
+    private static final String LOG_DIR = U.getGridGainHome();
+
+    /** Endpoint address. */
+    private static final String ENDPOINT = "localhost:10500";
+
+    /** Log file name. */
+    private static final String LOG_FILE = LOG_DIR + File.separator + "ggfs-log-" + GGFS_NAME + "-" + U.jvmPid() +
+        ".csv";
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        removeLogs();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        removeLogs();
+    }
+
+    /**
+     * Remove existing logs.
+     *
+     * @throws Exception If failed.
+     */
+    private void removeLogs() throws Exception {
+        File dir = new File(LOG_DIR);
+
+        File[] logs = dir.listFiles(new FilenameFilter() {
+            @Override public boolean accept(File dir, String name) {
+                return name.startsWith("ggfs-log-");
+            }
+        });
+
+        for (File log : logs)
+            log.delete();
+    }
+
+    /**
+     * Ensure correct static loggers creation/removal as well as file creation.
+     *
+     * @throws Exception If failed.
+     */
+    public void testCreateDelete() throws Exception {
+        GridGgfsLogger log = GridGgfsLogger.logger(ENDPOINT, GGFS_NAME, LOG_DIR, 10);
+
+        GridGgfsLogger sameLog0 = GridGgfsLogger.logger(ENDPOINT, GGFS_NAME, LOG_DIR, 10);
+
+        // Loggers for the same endpoint must be the same object.
+        assert log == sameLog0;
+
+        GridGgfsLogger otherLog = GridGgfsLogger.logger("other" + ENDPOINT, GGFS_NAME, LOG_DIR, 10);
+
+        // Logger for another endpoint must be different.
+        assert log != otherLog;
+
+        otherLog.close();
+
+        log.logDelete(PATH, PRIMARY, false);
+
+        log.close();
+
+        File logFile = new File(LOG_FILE);
+
+        // When there are multiple loggers, closing one must not force flushing.
+        assert !logFile.exists();
+
+        GridGgfsLogger sameLog1 = GridGgfsLogger.logger(ENDPOINT, GGFS_NAME, LOG_DIR, 10);
+
+        assert sameLog0 == sameLog1;
+
+        sameLog0.close();
+
+        assert !logFile.exists();
+
+        sameLog1.close();
+
+        // When we cloe the last logger, it must flush data to disk.
+        assert logFile.exists();
+
+        logFile.delete();
+
+        GridGgfsLogger sameLog2 = GridGgfsLogger.logger(ENDPOINT, GGFS_NAME, LOG_DIR, 10);
+
+        // This time we expect new logger instance to be created.
+        assert sameLog0 != sameLog2;
+
+        sameLog2.close();
+
+        // As we do not add any records to the logger, we do not expect flushing.
+        assert !logFile.exists();
+    }
+
+    /**
+     * Test read operations logging.
+     *
+     * @throws Exception If failed.
+     */
+    public void testLogRead() throws Exception {
+        GridGgfsLogger log = GridGgfsLogger.logger(ENDPOINT, GGFS_NAME, LOG_DIR, 10);
+
+        log.logOpen(1, PATH, PRIMARY, 2, 3L);
+        log.logRandomRead(1, 4L, 5);
+        log.logSeek(1, 6L);
+        log.logSkip(1, 7L);
+        log.logMark(1, 8L);
+        log.logReset(1);
+        log.logCloseIn(1, 9L, 10L, 11);
+
+        log.close();
+
+        checkLog(
+            new SB().a(U.jvmPid() + d() + TYPE_OPEN_IN + d() + PATH_STR_ESCAPED + d() + PRIMARY + d() + 1 + d() + 2 +
+                d() + 3 + d(14)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_RANDOM_READ + d(3) + 1 + d(7) + 4 + d() + 5 + d(8)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_SEEK + d(3) + 1 + d(7) + 6 + d(9)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_SKIP + d(3) + 1 + d(9) + 7 + d(7)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_MARK + d(3) + 1 + d(10) + 8 + d(6)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_RESET + d(3) + 1 + d(16)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_CLOSE_IN + d(3) + 1 + d(11) + 9 + d() + 10 + d() + 11 + d(3)).toString()
+        );
+    }
+
+    /**
+     * Test write operations logging.
+     *
+     * @throws Exception If failed.
+     */
+    public void testLogWrite() throws Exception {
+        GridGgfsLogger log = GridGgfsLogger.logger(ENDPOINT, GGFS_NAME, LOG_DIR, 10);
+
+        log.logCreate(1, PATH, PRIMARY, true, 2, new Integer(3).shortValue(), 4L);
+        log.logAppend(2, PATH, PRIMARY, 8);
+        log.logCloseOut(2, 9L, 10L, 11);
+
+        log.close();
+
+        checkLog(
+            new SB().a(U.jvmPid() + d() + TYPE_OPEN_OUT + d() + PATH_STR_ESCAPED + d() + PRIMARY + d() + 1 + d() +
+                2 + d(2) + 0 + d() + 1 + d() + 3 + d() + 4 + d(10)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_OPEN_OUT + d() + PATH_STR_ESCAPED + d() + PRIMARY + d() + 2 + d() +
+                8 + d(2) + 1 + d(13)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_CLOSE_OUT + d(3) + 2 + d(11) + 9 + d() + 10 + d() + 11 + d(3))
+                .toString()
+        );
+    }
+
+    /**
+     * Test miscellaneous operations logging.
+     *
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("TooBroadScope")
+    public void testLogMisc() throws Exception {
+        GridGgfsLogger log = GridGgfsLogger.logger(ENDPOINT, GGFS_NAME, LOG_DIR, 10);
+
+        String newFile = "/dir3/file.test";
+        String file1 = "/dir3/file1.test";
+        String file2 = "/dir3/file1.test";
+
+        log.logMakeDirectory(PATH, PRIMARY);
+        log.logRename(PATH, PRIMARY, new IgniteFsPath(newFile));
+        log.logListDirectory(PATH, PRIMARY, new String[] { file1, file2 });
+        log.logDelete(PATH, PRIMARY, false);
+
+        log.close();
+
+        checkLog(
+            new SB().a(U.jvmPid() + d() + TYPE_DIR_MAKE + d() + PATH_STR_ESCAPED + d() + PRIMARY + d(17)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_RENAME + d() + PATH_STR_ESCAPED + d() + PRIMARY + d(15) + newFile +
+                d(2)).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_DIR_LIST + d() + PATH_STR_ESCAPED + d() + PRIMARY + d(17) + file1 +
+                DELIM_FIELD_VAL + file2).toString(),
+            new SB().a(U.jvmPid() + d() + TYPE_DELETE + d(1) + PATH_STR_ESCAPED + d() + PRIMARY + d(16) + 0 +
+                d()).toString()
+        );
+    }
+
+    /**
+     * Create GGFS file with the given path.
+     *
+     * @param path File path.
+     * @return GGFS file instance.
+     */
+    private IgniteFsFile file(String path) {
+        return new IgniteFsFileImpl(new IgniteFsPath(path), new GridGgfsFileInfo(), 64 * 1024 * 1024);
+    }
+
+    /**
+     * Ensure that log file has only the following lines.
+     *
+     * @param lines Expected lines.
+     */
+    private void checkLog(String... lines) throws Exception {
+        BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(LOG_FILE)));
+
+        List<String> logLines = new ArrayList<>(lines.length);
+
+        String nextLogLine;
+
+        while ((nextLogLine = br.readLine()) != null)
+            logLines.add(nextLogLine);
+
+        U.closeQuiet(br);
+
+        assertEquals(lines.length + 1, logLines.size());
+
+        assertEquals(logLines.get(0), HDR);
+
+        for (int i = 0; i < lines.length; i++) {
+            String logLine = logLines.get(i + 1);
+
+            logLine = logLine.substring(logLine.indexOf(DELIM_FIELD, logLine.indexOf(DELIM_FIELD) + 1) + 1);
+
+            assertEquals(lines[i], logLine);
+        }
+    }
+
+    /**
+     * Return single field delimiter.
+     *
+     * @return Single field delimiter.
+     */
+    private String d() {
+        return d(1);
+    }
+
+    /**
+     * Return a bunch of field delimiters.
+     *
+     * @param cnt Amount of field delimiters.
+     * @return Field delimiters.
+     */
+    private String d(int cnt) {
+        SB buf = new SB();
+
+        for (int i = 0; i < cnt; i++)
+            buf.a(DELIM_FIELD);
+
+        return buf.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoggerStateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoggerStateSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoggerStateSelfTest.java
new file mode 100644
index 0000000..033ee42
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoggerStateSelfTest.java
@@ -0,0 +1,325 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import org.apache.hadoop.conf.*;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.ignitefs.hadoop.v1.*;
+import org.apache.ignite.internal.fs.common.*;
+import org.apache.ignite.internal.processors.fs.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import java.lang.reflect.*;
+import java.net.*;
+import java.nio.file.*;
+import java.util.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+import static org.apache.ignite.ignitefs.hadoop.GridGgfsHadoopParameters.*;
+
+/**
+ * Ensures that sampling is really turned on/off.
+ */
+public class GridGgfsHadoopFileSystemLoggerStateSelfTest extends GridGgfsCommonAbstractTest {
+    /** GGFS. */
+    private GridGgfsEx ggfs;
+
+    /** File system. */
+    private FileSystem fs;
+
+    /** Whether logging is enabled in FS configuration. */
+    private boolean logging;
+
+    /** whether sampling is enabled. */
+    private Boolean sampling;
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        U.closeQuiet(fs);
+
+        ggfs = null;
+        fs = null;
+
+        G.stopAll(true);
+
+        logging = false;
+        sampling = null;
+    }
+
+    /**
+     * Startup the grid and instantiate the file system.
+     *
+     * @throws Exception If failed.
+     */
+    private void startUp() throws Exception {
+        IgniteFsConfiguration ggfsCfg = new IgniteFsConfiguration();
+
+        ggfsCfg.setDataCacheName("partitioned");
+        ggfsCfg.setMetaCacheName("replicated");
+        ggfsCfg.setName("ggfs");
+        ggfsCfg.setBlockSize(512 * 1024);
+        ggfsCfg.setDefaultMode(PRIMARY);
+        ggfsCfg.setIpcEndpointConfiguration(new HashMap<String, String>() {{
+            put("type", "tcp");
+            put("port", "10500");
+        }});
+
+        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+        cacheCfg.setName("partitioned");
+        cacheCfg.setCacheMode(PARTITIONED);
+        cacheCfg.setDistributionMode(CacheDistributionMode.PARTITIONED_ONLY);
+        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cacheCfg.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(128));
+        cacheCfg.setBackups(0);
+        cacheCfg.setQueryIndexEnabled(false);
+        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setName("replicated");
+        metaCacheCfg.setCacheMode(REPLICATED);
+        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        metaCacheCfg.setQueryIndexEnabled(false);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setGridName("ggfs-grid");
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+        cfg.setDiscoverySpi(discoSpi);
+        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
+        cfg.setGgfsConfiguration(ggfsCfg);
+
+        cfg.setLocalHost("127.0.0.1");
+        cfg.setRestEnabled(false);
+
+        Ignite g = G.start(cfg);
+
+        ggfs = (GridGgfsEx)g.fileSystem("ggfs");
+
+        ggfs.globalSampling(sampling);
+
+        fs = fileSystem();
+    }
+
+    /**
+     * When logging is disabled and sampling is not set no-op logger must be used.
+     *
+     * @throws Exception If failed.
+     */
+    public void testLoggingDisabledSamplingNotSet() throws Exception {
+        startUp();
+
+        assert !logEnabled();
+    }
+
+    /**
+     * When logging is enabled and sampling is not set file logger must be used.
+     *
+     * @throws Exception If failed.
+     */
+    public void testLoggingEnabledSamplingNotSet() throws Exception {
+        logging = true;
+
+        startUp();
+
+        assert logEnabled();
+    }
+
+    /**
+     * When logging is disabled and sampling is disabled no-op logger must be used.
+     *
+     * @throws Exception If failed.
+     */
+    public void testLoggingDisabledSamplingDisabled() throws Exception {
+        sampling = false;
+
+        startUp();
+
+        assert !logEnabled();
+    }
+
+    /**
+     * When logging is enabled and sampling is disabled no-op logger must be used.
+     *
+     * @throws Exception If failed.
+     */
+    public void testLoggingEnabledSamplingDisabled() throws Exception {
+        logging = true;
+        sampling = false;
+
+        startUp();
+
+        assert !logEnabled();
+    }
+
+    /**
+     * When logging is disabled and sampling is enabled file logger must be used.
+     *
+     * @throws Exception If failed.
+     */
+    public void testLoggingDisabledSamplingEnabled() throws Exception {
+        sampling = true;
+
+        startUp();
+
+        assert logEnabled();
+    }
+
+    /**
+     * When logging is enabled and sampling is enabled file logger must be used.
+     *
+     * @throws Exception If failed.
+     */
+    public void testLoggingEnabledSamplingEnabled() throws Exception {
+        logging = true;
+        sampling = true;
+
+        startUp();
+
+        assert logEnabled();
+    }
+
+    /**
+     * Ensure sampling change through API causes changes in logging on subsequent client connections.
+     *
+     * @throws Exception If failed.
+     */
+    public void testSamplingChange() throws Exception {
+        // Start with sampling not set.
+        startUp();
+
+        assert !logEnabled();
+
+        fs.close();
+
+        // "Not set" => true transition.
+        ggfs.globalSampling(true);
+
+        fs = fileSystem();
+
+        assert logEnabled();
+
+        fs.close();
+
+        // True => "not set" transition.
+        ggfs.globalSampling(null);
+
+        fs = fileSystem();
+
+        assert !logEnabled();
+
+        // "Not-set" => false transition.
+        ggfs.globalSampling(false);
+
+        fs = fileSystem();
+
+        assert !logEnabled();
+
+        fs.close();
+
+        // False => "not=set" transition.
+        ggfs.globalSampling(null);
+
+        fs = fileSystem();
+
+        assert !logEnabled();
+
+        fs.close();
+
+        // True => false transition.
+        ggfs.globalSampling(true);
+        ggfs.globalSampling(false);
+
+        fs = fileSystem();
+
+        assert !logEnabled();
+
+        fs.close();
+
+        // False => true transition.
+        ggfs.globalSampling(true);
+
+        fs = fileSystem();
+
+        assert logEnabled();
+    }
+
+    /**
+     * Ensure that log directory is set to GGFS when client FS connects.
+     *
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("ConstantConditions")
+    public void testLogDirectory() throws Exception {
+        startUp();
+
+        assertEquals(Paths.get(U.getGridGainHome()).normalize().toString(),
+            ggfs.clientLogDirectory());
+    }
+
+    /**
+     * Instantiate new file system.
+     *
+     * @return New file system.
+     * @throws Exception If failed.
+     */
+    private GridGgfsHadoopFileSystem fileSystem() throws Exception {
+        Configuration fsCfg = new Configuration();
+
+        fsCfg.addResource(U.resolveGridGainUrl("modules/core/src/test/config/hadoop/core-site-loopback.xml"));
+
+        fsCfg.setBoolean("fs.ggfs.impl.disable.cache", true);
+
+        if (logging)
+            fsCfg.setBoolean(String.format(PARAM_GGFS_LOG_ENABLED, "ggfs:ggfs-grid@"), logging);
+
+        fsCfg.setStrings(String.format(PARAM_GGFS_LOG_DIR, "ggfs:ggfs-grid@"), U.getGridGainHome());
+
+        return (GridGgfsHadoopFileSystem)FileSystem.get(new URI("ggfs://ggfs:ggfs-grid@/"), fsCfg);
+    }
+
+    /**
+     * Ensure that real logger is used by the file system.
+     *
+     * @return {@code True} in case path is secondary.
+     * @throws Exception If failed.
+     */
+    private boolean logEnabled() throws Exception {
+        assert fs != null;
+
+        Field field = fs.getClass().getDeclaredField("clientLog");
+
+        field.setAccessible(true);
+
+        return ((GridGgfsLogger)field.get(fs)).isLogEnabled();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackAbstractSelfTest.java
new file mode 100644
index 0000000..0ee8211
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackAbstractSelfTest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import java.util.*;
+
+import static org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEndpoint.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test.
+ */
+public abstract class GridGgfsHadoopFileSystemLoopbackAbstractSelfTest extends
+    GridGgfsHadoopFileSystemAbstractSelfTest {
+    /**
+     * Constructor.
+     *
+     * @param mode GGFS mode.
+     * @param skipEmbed Skip embedded mode flag.
+     */
+    protected GridGgfsHadoopFileSystemLoopbackAbstractSelfTest(IgniteFsMode mode, boolean skipEmbed) {
+        super(mode, skipEmbed, true);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Map<String, String> primaryIpcEndpointConfiguration(final String gridName) {
+        return new HashMap<String, String>() {{
+            put("type", "tcp");
+            put("port", String.valueOf(DFLT_IPC_PORT + getTestGridIndex(gridName)));
+        }};
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedDualAsyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedDualAsyncSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedDualAsyncSelfTest.java
new file mode 100644
index 0000000..8c7099e
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedDualAsyncSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test in DUAL_ASYNC mode.
+ */
+public class GridGgfsHadoopFileSystemLoopbackEmbeddedDualAsyncSelfTest extends
+    GridGgfsHadoopFileSystemLoopbackAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemLoopbackEmbeddedDualAsyncSelfTest() {
+        super(DUAL_ASYNC, false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedDualSyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedDualSyncSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedDualSyncSelfTest.java
new file mode 100644
index 0000000..eb2adae
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedDualSyncSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test in DUAL_SYNC mode.
+ */
+public class GridGgfsHadoopFileSystemLoopbackEmbeddedDualSyncSelfTest
+    extends GridGgfsHadoopFileSystemLoopbackAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemLoopbackEmbeddedDualSyncSelfTest() {
+        super(DUAL_SYNC, false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedPrimarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedPrimarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedPrimarySelfTest.java
new file mode 100644
index 0000000..f5c5a73
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedPrimarySelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test in PRIMARY mode.
+ */
+public class GridGgfsHadoopFileSystemLoopbackEmbeddedPrimarySelfTest
+    extends GridGgfsHadoopFileSystemLoopbackAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemLoopbackEmbeddedPrimarySelfTest() {
+        super(PRIMARY, false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedSecondarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedSecondarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedSecondarySelfTest.java
new file mode 100644
index 0000000..666f17a
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackEmbeddedSecondarySelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test in SECONDARY mode.
+ */
+public class GridGgfsHadoopFileSystemLoopbackEmbeddedSecondarySelfTest extends
+    GridGgfsHadoopFileSystemLoopbackAbstractSelfTest {
+
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemLoopbackEmbeddedSecondarySelfTest() {
+        super(PROXY, false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalDualAsyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalDualAsyncSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalDualAsyncSelfTest.java
new file mode 100644
index 0000000..e77e067
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalDualAsyncSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test in DUAL_ASYNC mode.
+ */
+public class GridGgfsHadoopFileSystemLoopbackExternalDualAsyncSelfTest extends
+    GridGgfsHadoopFileSystemLoopbackAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemLoopbackExternalDualAsyncSelfTest() {
+        super(DUAL_ASYNC, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalDualSyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalDualSyncSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalDualSyncSelfTest.java
new file mode 100644
index 0000000..80ef446
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalDualSyncSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test in DUAL_SYNC mode.
+ */
+public class GridGgfsHadoopFileSystemLoopbackExternalDualSyncSelfTest
+    extends GridGgfsHadoopFileSystemLoopbackAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemLoopbackExternalDualSyncSelfTest() {
+        super(DUAL_SYNC, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalPrimarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalPrimarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalPrimarySelfTest.java
new file mode 100644
index 0000000..d9aa070
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalPrimarySelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test in PRIMARY mode.
+ */
+public class GridGgfsHadoopFileSystemLoopbackExternalPrimarySelfTest
+    extends GridGgfsHadoopFileSystemLoopbackAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemLoopbackExternalPrimarySelfTest() {
+        super(PRIMARY, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalSecondarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalSecondarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalSecondarySelfTest.java
new file mode 100644
index 0000000..cd30ba7
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemLoopbackExternalSecondarySelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC loopback self test in SECONDARY mode.
+ */
+public class GridGgfsHadoopFileSystemLoopbackExternalSecondarySelfTest extends
+    GridGgfsHadoopFileSystemLoopbackAbstractSelfTest {
+
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemLoopbackExternalSecondarySelfTest() {
+        super(PROXY, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemSecondaryModeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemSecondaryModeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemSecondaryModeSelfTest.java
new file mode 100644
index 0000000..6cad6ab
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemSecondaryModeSelfTest.java
@@ -0,0 +1,319 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import org.apache.hadoop.conf.*;
+import org.apache.hadoop.fs.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.ignitefs.hadoop.v1.*;
+import org.apache.ignite.internal.fs.hadoop.*;
+import org.apache.ignite.internal.processors.fs.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import java.net.*;
+import java.util.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * Ensures correct modes resolution for SECONDARY paths.
+ */
+public class GridGgfsHadoopFileSystemSecondaryModeSelfTest extends GridGgfsCommonAbstractTest {
+    /** Path to check. */
+    private static final Path PATH = new Path("/dir");
+
+    /** Pattern matching the path. */
+    private static final String PATTERN_MATCHES = "/dir";
+
+    /** Pattern doesn't matching the path. */
+    private static final String PATTERN_NOT_MATCHES = "/files";
+
+    /** Default GGFS mode. */
+    private IgniteFsMode mode;
+
+    /** Path modes. */
+    private Map<String, IgniteFsMode> pathModes;
+
+    /** File system. */
+    private GridGgfsHadoopFileSystem fs;
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        mode = null;
+        pathModes = null;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        U.closeQuiet(fs);
+
+        fs = null;
+
+        G.stopAll(true);
+    }
+
+    /**
+     * Perform initial startup.
+     *
+     * @throws Exception If failed.
+     */
+    @SuppressWarnings("NullableProblems")
+    private void startUp() throws Exception {
+        startUpSecondary();
+
+        IgniteFsConfiguration ggfsCfg = new IgniteFsConfiguration();
+
+        ggfsCfg.setDataCacheName("partitioned");
+        ggfsCfg.setMetaCacheName("replicated");
+        ggfsCfg.setName("ggfs");
+        ggfsCfg.setBlockSize(512 * 1024);
+        ggfsCfg.setDefaultMode(mode);
+        ggfsCfg.setPathModes(pathModes);
+        ggfsCfg.setIpcEndpointConfiguration(new HashMap<String, String>() {{
+            put("type", "tcp");
+            put("port", "10500");
+        }});
+
+        ggfsCfg.setManagementPort(-1);
+        ggfsCfg.setSecondaryFileSystem(new GridGgfsHadoopFileSystemWrapper(
+            "ggfs://ggfs-secondary:ggfs-grid-secondary@127.0.0.1:11500/",
+            "modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml"));
+
+        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+        cacheCfg.setName("partitioned");
+        cacheCfg.setCacheMode(PARTITIONED);
+        cacheCfg.setDistributionMode(CacheDistributionMode.PARTITIONED_ONLY);
+        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cacheCfg.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(128));
+        cacheCfg.setBackups(0);
+        cacheCfg.setQueryIndexEnabled(false);
+        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setName("replicated");
+        metaCacheCfg.setCacheMode(REPLICATED);
+        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        metaCacheCfg.setQueryIndexEnabled(false);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setGridName("ggfs-grid");
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+        cfg.setDiscoverySpi(discoSpi);
+        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
+        cfg.setGgfsConfiguration(ggfsCfg);
+
+        cfg.setLocalHost("127.0.0.1");
+
+        G.start(cfg);
+
+        Configuration fsCfg = new Configuration();
+
+        fsCfg.addResource(U.resolveGridGainUrl("modules/core/src/test/config/hadoop/core-site-loopback.xml"));
+
+        fsCfg.setBoolean("fs.ggfs.impl.disable.cache", true);
+
+        fs = (GridGgfsHadoopFileSystem)FileSystem.get(new URI("ggfs://ggfs:ggfs-grid@/"), fsCfg);
+    }
+
+    /**
+     * Startup secondary file system.
+     *
+     * @throws Exception If failed.
+     */
+    private void startUpSecondary() throws Exception {
+        IgniteFsConfiguration ggfsCfg = new IgniteFsConfiguration();
+
+        ggfsCfg.setDataCacheName("partitioned");
+        ggfsCfg.setMetaCacheName("replicated");
+        ggfsCfg.setName("ggfs-secondary");
+        ggfsCfg.setBlockSize(512 * 1024);
+        ggfsCfg.setDefaultMode(PRIMARY);
+        ggfsCfg.setIpcEndpointConfiguration(new HashMap<String, String>() {{
+            put("type", "tcp");
+            put("port", "11500");
+        }});
+
+        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+
+        cacheCfg.setName("partitioned");
+        cacheCfg.setCacheMode(PARTITIONED);
+        cacheCfg.setDistributionMode(CacheDistributionMode.PARTITIONED_ONLY);
+        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cacheCfg.setAffinityMapper(new IgniteFsGroupDataBlocksKeyMapper(128));
+        cacheCfg.setBackups(0);
+        cacheCfg.setQueryIndexEnabled(false);
+        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setName("replicated");
+        metaCacheCfg.setCacheMode(REPLICATED);
+        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        metaCacheCfg.setQueryIndexEnabled(false);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setGridName("ggfs-grid-secondary");
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
+
+        cfg.setDiscoverySpi(discoSpi);
+        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
+        cfg.setGgfsConfiguration(ggfsCfg);
+
+        cfg.setLocalHost("127.0.0.1");
+
+        G.start(cfg);
+    }
+
+    /**
+     * Check path resolution when secondary mode is not default and there are no other exclusion paths.
+     *
+     * @throws Exception If failed.
+     */
+    public void testSecondaryNotDefaultNoExclusions() throws Exception {
+        mode = PRIMARY;
+
+        startUp();
+
+        assert !secondary(PATH);
+        assert !secondary(PATH);
+    }
+
+    /**
+     * Check path resolution when secondary mode is not default and there is no matching exclusion paths.
+     *
+     * @throws Exception If failed.
+     */
+    public void testSecondaryNotDefaultNonMatchingExclusion() throws Exception {
+        mode = PRIMARY;
+
+        pathModes(F.t(PATTERN_NOT_MATCHES, PROXY));
+
+        startUp();
+
+        assert !secondary(PATH);
+        assert !secondary(PATH);
+    }
+
+    /**
+     * Check path resolution when secondary mode is not default and there is matching exclusion path.
+     *
+     * @throws Exception If failed.
+     */
+    public void testSecondaryNotDefaultMatchingExclusion() throws Exception {
+        mode = PRIMARY;
+
+        pathModes(F.t(PATTERN_NOT_MATCHES, PROXY), F.t(PATTERN_MATCHES, PROXY));
+
+        startUp();
+
+        assert secondary(PATH);
+        assert secondary(PATH);
+    }
+
+    /**
+     * Check path resolution when secondary mode is default and there is no exclusion paths.
+     *
+     * @throws Exception If failed.
+     */
+    public void testSecondaryDefaultNoExclusions() throws Exception {
+        mode = PROXY;
+
+        startUp();
+
+        assert secondary(PATH);
+        assert secondary(PATH);
+    }
+
+    /**
+     * Check path resolution when secondary mode is default and there is no matching exclusion paths.
+     *
+     * @throws Exception If failed.
+     */
+    public void testSecondaryDefaultNonMatchingExclusion() throws Exception {
+        mode = PROXY;
+
+        pathModes(F.t(PATTERN_NOT_MATCHES, PRIMARY));
+
+        startUp();
+
+        assert secondary(PATH);
+        assert secondary(PATH);
+    }
+
+    /**
+     * Check path resolution when secondary mode is default and there is no matching exclusion paths.
+     *
+     * @throws Exception If failed.
+     */
+    public void testSecondaryDefaultMatchingExclusion() throws Exception {
+        mode = PROXY;
+
+        pathModes(F.t(PATTERN_NOT_MATCHES, PRIMARY), F.t(PATTERN_MATCHES, PRIMARY));
+
+        startUp();
+
+        assert !secondary(PATH);
+        assert !secondary(PATH);
+    }
+
+    /**
+     * Set GGFS modes for particular paths.
+     *
+     * @param modes Modes.
+     */
+    @SafeVarargs
+    final void pathModes(IgniteBiTuple<String, IgniteFsMode>... modes) {
+        assert modes != null;
+
+        pathModes = new LinkedHashMap<>(modes.length, 1.0f);
+
+        for (IgniteBiTuple<String, IgniteFsMode> mode : modes)
+            pathModes.put(mode.getKey(), mode.getValue());
+    }
+
+    /**
+     * Check whether the given path is threaten as SECONDARY in the file system.
+     *
+     * @param path Path to check.
+     * @return {@code True} in case path is secondary.
+     * @throws Exception If failed.
+     */
+    private boolean secondary(Path path) throws Exception {
+        return fs.mode(path) == PROXY;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemAbstractSelfTest.java
new file mode 100644
index 0000000..89853bb
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemAbstractSelfTest.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.util.ipc.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEndpoint.*;
+
+/**
+ * GGFS Hadoop file system IPC self test.
+ */
+public abstract class GridGgfsHadoopFileSystemShmemAbstractSelfTest extends GridGgfsHadoopFileSystemAbstractSelfTest {
+    /**
+     * Constructor.
+     *
+     * @param mode GGFS mode.
+     * @param skipEmbed Skip embedded mode flag.
+     */
+    protected GridGgfsHadoopFileSystemShmemAbstractSelfTest(IgniteFsMode mode, boolean skipEmbed) {
+        super(mode, skipEmbed, false);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Map<String, String> primaryIpcEndpointConfiguration(final String gridName) {
+        return new HashMap<String, String>() {{
+            put("type", "shmem");
+            put("port", String.valueOf(DFLT_IPC_PORT + getTestGridIndex(gridName)));
+        }};
+    }
+
+    /**
+     * Checks correct behaviour in case when we run out of system
+     * resources.
+     *
+     * @throws Exception If error occurred.
+     */
+    @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+    public void testOutOfResources() throws Exception {
+        final Collection<IpcEndpoint> eps = new LinkedList<>();
+
+        try {
+            IgniteCheckedException e = (IgniteCheckedException)GridTestUtils.assertThrows(log, new Callable<Object>() {
+                @SuppressWarnings("InfiniteLoopStatement")
+                @Override public Object call() throws Exception {
+                    while (true) {
+                        IpcEndpoint ep = IpcEndpointFactory.connectEndpoint("shmem:10500", log);
+
+                        eps.add(ep);
+                    }
+                }
+            }, IgniteCheckedException.class, null);
+
+            assertNotNull(e);
+
+            String msg = e.getMessage();
+
+            assertTrue("Invalid exception: " + X.getFullStackTrace(e),
+                msg.contains("(error code: 28)") ||
+                msg.contains("(error code: 24)") ||
+                msg.contains("(error code: 12)"));
+        }
+        finally {
+            for (IpcEndpoint ep : eps)
+                ep.close();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedDualAsyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedDualAsyncSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedDualAsyncSelfTest.java
new file mode 100644
index 0000000..4e4b70d
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedDualAsyncSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC shmem self test in DUAL_ASYNC mode.
+ */
+public class GridGgfsHadoopFileSystemShmemEmbeddedDualAsyncSelfTest
+    extends GridGgfsHadoopFileSystemShmemAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemShmemEmbeddedDualAsyncSelfTest() {
+        super(DUAL_ASYNC, false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedDualSyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedDualSyncSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedDualSyncSelfTest.java
new file mode 100644
index 0000000..e38c85f
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedDualSyncSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC shmem self test in DUAL_SYNC mode.
+ */
+public class GridGgfsHadoopFileSystemShmemEmbeddedDualSyncSelfTest
+    extends GridGgfsHadoopFileSystemShmemAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemShmemEmbeddedDualSyncSelfTest() {
+        super(DUAL_SYNC, false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedPrimarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedPrimarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedPrimarySelfTest.java
new file mode 100644
index 0000000..000da3b
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedPrimarySelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC shmem self test in PRIMARY mode.
+ */
+public class GridGgfsHadoopFileSystemShmemEmbeddedPrimarySelfTest
+    extends GridGgfsHadoopFileSystemShmemAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemShmemEmbeddedPrimarySelfTest() {
+        super(PRIMARY, false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedSecondarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedSecondarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedSecondarySelfTest.java
new file mode 100644
index 0000000..2a29f3d
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemEmbeddedSecondarySelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC shmem self test in SECONDARY mode.
+ */
+public class GridGgfsHadoopFileSystemShmemEmbeddedSecondarySelfTest
+    extends GridGgfsHadoopFileSystemShmemAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemShmemEmbeddedSecondarySelfTest() {
+        super(PROXY, false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalDualAsyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalDualAsyncSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalDualAsyncSelfTest.java
new file mode 100644
index 0000000..1866bd1
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalDualAsyncSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC shmem self test in DUAL_ASYNC mode.
+ */
+public class GridGgfsHadoopFileSystemShmemExternalDualAsyncSelfTest
+    extends GridGgfsHadoopFileSystemShmemAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemShmemExternalDualAsyncSelfTest() {
+        super(DUAL_ASYNC, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalDualSyncSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalDualSyncSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalDualSyncSelfTest.java
new file mode 100644
index 0000000..4033b6d
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalDualSyncSelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC shmem self test in DUAL_SYNC mode.
+ */
+public class GridGgfsHadoopFileSystemShmemExternalDualSyncSelfTest
+    extends GridGgfsHadoopFileSystemShmemAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemShmemExternalDualSyncSelfTest() {
+        super(DUAL_SYNC, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalPrimarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalPrimarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalPrimarySelfTest.java
new file mode 100644
index 0000000..66a0d48
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalPrimarySelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC shmem self test in PRIMARY mode.
+ */
+public class GridGgfsHadoopFileSystemShmemExternalPrimarySelfTest
+    extends GridGgfsHadoopFileSystemShmemAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemShmemExternalPrimarySelfTest() {
+        super(PRIMARY, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afa29526/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalSecondarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalSecondarySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalSecondarySelfTest.java
new file mode 100644
index 0000000..63aaac0
--- /dev/null
+++ b/modules/hadoop/src/test/java/org/apache/ignite/ignitefs/GridGgfsHadoopFileSystemShmemExternalSecondarySelfTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ignitefs;
+
+import static org.apache.ignite.ignitefs.IgniteFsMode.*;
+
+/**
+ * GGFS Hadoop file system IPC shmem self test in SECONDARY mode.
+ */
+public class GridGgfsHadoopFileSystemShmemExternalSecondarySelfTest
+    extends GridGgfsHadoopFileSystemShmemAbstractSelfTest {
+    /**
+     * Constructor.
+     */
+    public GridGgfsHadoopFileSystemShmemExternalSecondarySelfTest() {
+        super(PROXY, true);
+    }
+}


Mime
View raw message