You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/02/21 10:55:53 UTC

[1/3] ignite git commit: IGNITE-3625: IGFS: "meta" and "data" caches are now configured inside IGFS bean. This closes #923. This closes #972.

Repository: ignite
Updated Branches:
  refs/heads/ignite-2.0 f55370b4f -> 3ca46d1a1


http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/config/igfs-cli-config-dual-async.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/config/igfs-cli-config-dual-async.xml b/modules/hadoop/src/test/config/igfs-cli-config-dual-async.xml
index 6fc38cd..bd2ae87 100644
--- a/modules/hadoop/src/test/config/igfs-cli-config-dual-async.xml
+++ b/modules/hadoop/src/test/config/igfs-cli-config-dual-async.xml
@@ -60,39 +60,6 @@
         </property>
 
         <!--
-            Configure caches where IGFS will store data.
-        -->
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Configure metadata cache where file system structure will be stored. It must be TRANSACTIONAL,
-                    and must have backups to maintain file system consistency in case of node crash.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="replicated"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <!--
-                    Configure data cache where file's data will be stored.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="partitioned"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <property name="groupSize" value="128"/>
-                        </bean>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!--
             This port will be used by Apache Hadoop client to connect to Ignite node as if it was a job tracker.
         -->
         <property name="connectorConfiguration">
@@ -110,9 +77,27 @@
                     <!-- IGFS name you will use to access IGFS through Hadoop API. -->
                     <property name="name" value="igfs"/>
 
-                    <!-- Caches with these names must be configured. -->
-                    <property name="metaCacheName" value="replicated"/>
-                    <property name="dataCacheName" value="partitioned"/>
+                    <!-- IGFS Caches. -->
+                    <property name="metaCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="cacheMode" value="REPLICATED"/>
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                        </bean>
+                    </property>
+                    <property name="dataCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                            <property name="cacheMode" value="PARTITIONED"/>
+                            <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+
+                            <property name="affinityMapper">
+                                <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
+                                    <property name="groupSize" value="128"/>
+                                </bean>
+                            </property>
+                        </bean>
+                    </property>
+
                     <property name="blockSize" value="524288"/>
                     <property name="defaultMode" value="DUAL_ASYNC"/>
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/config/igfs-cli-config-dual-sync.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/config/igfs-cli-config-dual-sync.xml b/modules/hadoop/src/test/config/igfs-cli-config-dual-sync.xml
index fcd8d82..9b76344 100644
--- a/modules/hadoop/src/test/config/igfs-cli-config-dual-sync.xml
+++ b/modules/hadoop/src/test/config/igfs-cli-config-dual-sync.xml
@@ -58,39 +58,6 @@
         </property>
 
         <!--
-            Configure caches where IGFS will store data.
-        -->
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Configure metadata cache where file system structure will be stored. It must be TRANSACTIONAL,
-                    and must have backups to maintain file system consistency in case of node crash.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="replicated"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <!--
-                    Configure data cache where file's data will be stored.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="partitioned"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <property name="groupSize" value="128"/>
-                        </bean>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!--
             This port will be used by Apache Hadoop client to connect to Ignite node as if it was a job tracker.
         -->
         <property name="connectorConfiguration">
@@ -108,9 +75,27 @@
                     <!-- IGFS name you will use to access IGFS through Hadoop API. -->
                     <property name="name" value="igfs"/>
 
-                    <!-- Caches with these names must be configured. -->
-                    <property name="metaCacheName" value="replicated"/>
-                    <property name="dataCacheName" value="partitioned"/>
+                    <!-- IGFS Caches. -->
+                    <property name="metaCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="cacheMode" value="REPLICATED"/>
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                        </bean>
+                    </property>
+                    <property name="dataCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                            <property name="cacheMode" value="PARTITIONED"/>
+                            <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+
+                            <property name="affinityMapper">
+                                <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
+                                    <property name="groupSize" value="128"/>
+                                </bean>
+                            </property>
+                        </bean>
+                    </property>
+
                     <property name="blockSize" value="524288"/>
                     <property name="defaultMode" value="DUAL_SYNC"/>
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/config/igfs-cli-config-primary.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/config/igfs-cli-config-primary.xml b/modules/hadoop/src/test/config/igfs-cli-config-primary.xml
index cc066b2..0268cff 100644
--- a/modules/hadoop/src/test/config/igfs-cli-config-primary.xml
+++ b/modules/hadoop/src/test/config/igfs-cli-config-primary.xml
@@ -60,39 +60,6 @@
         </property>
 
         <!--
-            Configure caches where IGFS will store data.
-        -->
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Configure metadata cache where file system structure will be stored. It must be TRANSACTIONAL,
-                    and must have backups to maintain file system consistency in case of node crash.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="replicated"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <!--
-                    Configure data cache where file's data will be stored.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="partitioned"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <property name="groupSize" value="128"/>
-                        </bean>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!--
             This port will be used by Apache Hadoop client to connect to Ignite node as if it was a job tracker.
         -->
         <property name="connectorConfiguration">
@@ -110,9 +77,27 @@
                     <!-- IGFS name you will use to access IGFS through Hadoop API. -->
                     <property name="name" value="igfs"/>
 
-                    <!-- Caches with these names must be configured. -->
-                    <property name="metaCacheName" value="replicated"/>
-                    <property name="dataCacheName" value="partitioned"/>
+                    <!-- IGFS Caches. -->
+                    <property name="metaCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="cacheMode" value="REPLICATED"/>
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                        </bean>
+                    </property>
+                    <property name="dataCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                            <property name="cacheMode" value="PARTITIONED"/>
+                            <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+
+                            <property name="affinityMapper">
+                                <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
+                                    <property name="groupSize" value="128"/>
+                                </bean>
+                            </property>
+                        </bean>
+                    </property>
+
                     <property name="blockSize" value="524288"/>
                     <property name="defaultMode" value="PRIMARY"/>
                     <property name="ipcEndpointEnabled" value="false"/>

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/config/igfs-cli-config-proxy.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/config/igfs-cli-config-proxy.xml b/modules/hadoop/src/test/config/igfs-cli-config-proxy.xml
index f25fd50..f4f794f 100644
--- a/modules/hadoop/src/test/config/igfs-cli-config-proxy.xml
+++ b/modules/hadoop/src/test/config/igfs-cli-config-proxy.xml
@@ -58,39 +58,6 @@
         </property>
 
         <!--
-            Configure caches where IGFS will store data.
-        -->
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Configure metadata cache where file system structure will be stored. It must be TRANSACTIONAL,
-                    and must have backups to maintain file system consistency in case of node crash.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="replicated"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <!--
-                    Configure data cache where file's data will be stored.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="partitioned"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <property name="groupSize" value="128"/>
-                        </bean>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!--
             This port will be used by Apache Hadoop client to connect to Ignite node as if it was a job tracker.
         -->
         <property name="connectorConfiguration">
@@ -108,9 +75,27 @@
                     <!-- IGFS name you will use to access IGFS through Hadoop API. -->
                     <property name="name" value="igfs"/>
 
-                    <!-- Caches with these names must be configured. -->
-                    <property name="metaCacheName" value="replicated"/>
-                    <property name="dataCacheName" value="partitioned"/>
+                    <!-- IGFS Caches. -->
+                    <property name="metaCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="cacheMode" value="REPLICATED"/>
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                        </bean>
+                    </property>
+                    <property name="dataCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                            <property name="cacheMode" value="PARTITIONED"/>
+                            <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+
+                            <property name="affinityMapper">
+                                <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
+                                    <property name="groupSize" value="128"/>
+                                </bean>
+                            </property>
+                        </bean>
+                    </property>
+
                     <property name="blockSize" value="524288"/>
                     <property name="defaultMode" value="PROXY"/>
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java
index d3ce124..619149c 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractMapReduceTest.java
@@ -359,8 +359,6 @@ public class HadoopAbstractMapReduceTest extends HadoopAbstractWordCountTest {
         @Nullable IgfsSecondaryFileSystem secondaryFs, @Nullable IgfsIpcEndpointConfiguration restCfg) throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(igfsName);
         igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
         igfsCfg.setDefaultMode(mode);
@@ -387,6 +385,9 @@ public class HadoopAbstractMapReduceTest extends HadoopAbstractWordCountTest {
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName(gridName);
@@ -396,7 +397,6 @@ public class HadoopAbstractMapReduceTest extends HadoopAbstractWordCountTest {
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java
index e2e8295..4a810e2 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopAbstractSelfTest.java
@@ -53,12 +53,6 @@ public abstract class HadoopAbstractSelfTest extends GridCommonAbstractTest {
     /** IGFS name. */
     protected static final String igfsName = null;
 
-    /** IGFS name. */
-    protected static final String igfsMetaCacheName = "meta";
-
-    /** IGFS name. */
-    protected static final String igfsDataCacheName = "data";
-
     /** IGFS block size. */
     protected static final int igfsBlockSize = 1024;
 
@@ -133,11 +127,8 @@ public abstract class HadoopAbstractSelfTest extends GridCommonAbstractTest {
 
         discoSpi.setIpFinder(IP_FINDER);
 
-        if (igfsEnabled()) {
-            cfg.setCacheConfiguration(metaCacheConfiguration(), dataCacheConfiguration());
-
+        if (igfsEnabled())
             cfg.setFileSystemConfiguration(igfsConfiguration());
-        }
 
         if (restEnabled()) {
             ConnectorConfiguration clnCfg = new ConnectorConfiguration();
@@ -167,14 +158,15 @@ public abstract class HadoopAbstractSelfTest extends GridCommonAbstractTest {
 
     /**
      * @return IGFS configuration.
+     * @throws Exception If failed.
      */
     public FileSystemConfiguration igfsConfiguration() throws Exception {
         FileSystemConfiguration cfg = new FileSystemConfiguration();
 
         cfg.setName(igfsName);
         cfg.setBlockSize(igfsBlockSize);
-        cfg.setDataCacheName(igfsDataCacheName);
-        cfg.setMetaCacheName(igfsMetaCacheName);
+        cfg.setDataCacheConfiguration(dataCacheConfiguration());
+        cfg.setMetaCacheConfiguration(metaCacheConfiguration());
         cfg.setFragmentizerEnabled(false);
 
         return cfg;
@@ -186,7 +178,6 @@ public abstract class HadoopAbstractSelfTest extends GridCommonAbstractTest {
     public CacheConfiguration metaCacheConfiguration() {
         CacheConfiguration cfg = new CacheConfiguration();
 
-        cfg.setName(igfsMetaCacheName);
         cfg.setCacheMode(REPLICATED);
         cfg.setAtomicityMode(TRANSACTIONAL);
         cfg.setWriteSynchronizationMode(FULL_SYNC);
@@ -200,7 +191,6 @@ public abstract class HadoopAbstractSelfTest extends GridCommonAbstractTest {
     protected CacheConfiguration dataCacheConfiguration() {
         CacheConfiguration cfg = new CacheConfiguration();
 
-        cfg.setName(igfsDataCacheName);
         cfg.setCacheMode(PARTITIONED);
         cfg.setAtomicityMode(TRANSACTIONAL);
         cfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(igfsBlockGroupSize));

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java
index 5f64845..ac8f815 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopFIleSystemFactorySelfTest.java
@@ -222,8 +222,6 @@ public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(name);
         igfsCfg.setDefaultMode(dfltMode);
         igfsCfg.setIpcEndpointConfiguration(endpointCfg);
@@ -232,7 +230,6 @@ public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(2));
@@ -242,11 +239,13 @@ public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName(name);
@@ -256,7 +255,6 @@ public class HadoopFIleSystemFactorySelfTest extends IgfsCommonAbstractTest {
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
index a297aef..201309e 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
@@ -188,23 +188,21 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
             // Start secondary IGFS.
             FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-            igfsCfg.setDataCacheName("partitioned");
-            igfsCfg.setMetaCacheName("replicated");
             igfsCfg.setName("igfs_secondary");
             igfsCfg.setIpcEndpointConfiguration(secondaryIpcEndpointConfiguration());
             igfsCfg.setManagementPort(-1);
             igfsCfg.setBlockSize(512 * 1024);
             igfsCfg.setPrefetchBlocks(1);
 
-            CacheConfiguration cacheCfg = defaultCacheConfiguration();
+            CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-            cacheCfg.setName("partitioned");
-            cacheCfg.setCacheMode(PARTITIONED);
-            cacheCfg.setNearConfiguration(null);
-            cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-            cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
-            cacheCfg.setBackups(0);
-            cacheCfg.setAtomicityMode(TRANSACTIONAL);
+            dataCacheCfg.setName("partitioned");
+            dataCacheCfg.setCacheMode(PARTITIONED);
+            dataCacheCfg.setNearConfiguration(null);
+            dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+            dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
+            dataCacheCfg.setBackups(0);
+            dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
             CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
@@ -213,6 +211,9 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
             metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
             metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+            igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+            igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
             IgniteConfiguration cfg = new IgniteConfiguration();
 
             cfg.setGridName("grid_secondary");
@@ -222,7 +223,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
             discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
             cfg.setDiscoverySpi(discoSpi);
-            cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
+            cfg.setCacheConfiguration(metaCacheCfg, dataCacheCfg);
             cfg.setFileSystemConfiguration(igfsCfg);
             cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
             cfg.setLocalHost(U.getLocalHost().getHostAddress());
@@ -250,7 +251,6 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
         discoSpi.setIpFinder(IP_FINDER);
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(cacheConfiguration(gridName));
         cfg.setFileSystemConfiguration(igfsConfiguration(gridName));
         cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
         cfg.setLocalHost("127.0.0.1");
@@ -265,10 +265,9 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
      * @param gridName Grid name.
      * @return Cache configuration.
      */
-    protected CacheConfiguration[] cacheConfiguration(String gridName) {
+    protected CacheConfiguration dataCacheConfiguration(String gridName) {
         CacheConfiguration cacheCfg = defaultCacheConfiguration();
 
-        cacheCfg.setName("partitioned");
         cacheCfg.setCacheMode(PARTITIONED);
         cacheCfg.setNearConfiguration(null);
         cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
@@ -276,14 +275,23 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
         cacheCfg.setBackups(0);
         cacheCfg.setAtomicityMode(TRANSACTIONAL);
 
-        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+        return cacheCfg;
+    }
+
+    /**
+     * Gets cache configuration.
+     *
+     * @param gridName Grid name.
+     * @return Cache configuration.
+     */
+    protected CacheConfiguration metaCacheConfiguration(String gridName) {
+        CacheConfiguration ccfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
-        metaCacheCfg.setCacheMode(REPLICATED);
-        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+        ccfg.setCacheMode(REPLICATED);
+        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
 
-        return new CacheConfiguration[] {metaCacheCfg, cacheCfg};
+        return ccfg;
     }
 
     /**
@@ -295,12 +303,12 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
     protected FileSystemConfiguration igfsConfiguration(String gridName) throws IgniteCheckedException {
         FileSystemConfiguration cfg = new FileSystemConfiguration();
 
-        cfg.setDataCacheName("partitioned");
-        cfg.setMetaCacheName("replicated");
         cfg.setName("igfs");
         cfg.setPrefetchBlocks(1);
         cfg.setMaxSpaceSize(64 * 1024 * 1024);
         cfg.setDefaultMode(mode);
+        cfg.setMetaCacheConfiguration(metaCacheConfiguration(gridName));
+        cfg.setDataCacheConfiguration(dataCacheConfiguration(gridName));
 
         if (mode != PRIMARY)
             cfg.setSecondaryFileSystem(new IgniteHadoopIgfsSecondaryFileSystem(secondaryFileSystemUriPath(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java
index cf1ccda..74df5dc 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsDualAbstractSelfTest.java
@@ -152,8 +152,6 @@ public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractT
         @Nullable IgfsSecondaryFileSystem secondaryFs, @Nullable IgfsIpcEndpointConfiguration restCfg) throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(igfsName);
         igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
         igfsCfg.setDefaultMode(mode);
@@ -180,6 +178,9 @@ public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractT
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName(gridName);
@@ -189,7 +190,6 @@ public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractT
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");
@@ -292,7 +292,7 @@ public abstract class HadoopIgfsDualAbstractSelfTest extends IgfsCommonAbstractT
         IgfsBlockKey key = new IgfsBlockKey(info.id(), info.affinityKey(), info.evictExclude(), 2);
 
         IgniteCache<IgfsBlockKey, byte[]> dataCache = igfs.context().kernalContext().cache().jcache(
-            igfs.configuration().getDataCacheName());
+            igfs.configuration().getDataCacheConfiguration().getName());
 
         for (int i = 0; i < 10; i++) {
             if (dataCache.containsKey(key))

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java
index 9d49537..8c438d7 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java
@@ -267,30 +267,29 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
     private void startSecondary() {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName("igfs_secondary");
         igfsCfg.setIpcEndpointConfiguration(SECONDARY_ENDPOINT_CFG);
         igfsCfg.setBlockSize(512 * 1024);
         igfsCfg.setPrefetchBlocks(1);
 
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setNearConfiguration(null);
+        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("grid_secondary");
@@ -300,7 +299,6 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
         cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
 
@@ -338,7 +336,6 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
         discoSpi.setIpFinder(IP_FINDER);
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(cacheConfiguration());
         cfg.setFileSystemConfiguration(fsConfiguration(gridName));
         cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
         cfg.setCommunicationSpi(communicationSpi());
@@ -349,27 +346,36 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
     /**
      * Gets cache configuration.
      *
-     * @return Cache configuration.
+     * @return Meta cache configuration.
      */
-    protected CacheConfiguration[] cacheConfiguration() {
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+    protected CacheConfiguration metaCacheConfiguration() {
 
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        CacheConfiguration ccfg = defaultCacheConfiguration();
 
-        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+        ccfg.setName("replicated");
+        ccfg.setCacheMode(REPLICATED);
+        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
 
-        metaCacheCfg.setName("replicated");
-        metaCacheCfg.setCacheMode(REPLICATED);
-        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+        return ccfg;
+    }
 
-        return new CacheConfiguration[] {metaCacheCfg, cacheCfg};
+    /**
+     * @return Data cache configuration.
+     */
+    protected CacheConfiguration dataCacheConfiguration() {
+        CacheConfiguration ccfg = defaultCacheConfiguration();
+
+        ccfg.setName("partitioned");
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setNearConfiguration(null);
+        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        ccfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
+        ccfg.setBackups(0);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
+
+
+        return ccfg;
     }
 
     /**
@@ -381,8 +387,6 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
     protected FileSystemConfiguration fsConfiguration(String gridName) throws IgniteCheckedException {
         FileSystemConfiguration cfg = new FileSystemConfiguration();
 
-        cfg.setDataCacheName("partitioned");
-        cfg.setMetaCacheName("replicated");
         cfg.setName("igfs");
         cfg.setPrefetchBlocks(1);
         cfg.setDefaultMode(mode);
@@ -396,6 +400,9 @@ public class HadoopSecondaryFileSystemConfigurationTest extends IgfsCommonAbstra
         cfg.setManagementPort(-1);
         cfg.setBlockSize(512 * 1024); // Together with group blocks mapper will yield 64M per node groups.
 
+        cfg.setDataCacheConfiguration(dataCacheConfiguration());
+        cfg.setMetaCacheConfiguration(metaCacheConfiguration());
+
         return cfg;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java
index 51048c6..2e03718 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgfsNearOnlyMultiNodeSelfTest.java
@@ -88,9 +88,9 @@ public class IgfsNearOnlyMultiNodeSelfTest extends GridCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("data");
-        igfsCfg.setMetaCacheName("meta");
         igfsCfg.setName("igfs");
+        igfsCfg.setDataCacheConfiguration(cacheConfiguration(gridName, "data"));
+        igfsCfg.setMetaCacheConfiguration(cacheConfiguration(gridName, "meta"));
 
         IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
 
@@ -103,8 +103,6 @@ public class IgfsNearOnlyMultiNodeSelfTest extends GridCommonAbstractTest {
 
         cfg.setFileSystemConfiguration(igfsCfg);
 
-        cfg.setCacheConfiguration(cacheConfiguration(gridName, "data"), cacheConfiguration(gridName, "meta"));
-
         cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
 
         if (cnt == 0)

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
index 4d4f68b..2d58d2d 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
@@ -246,22 +246,20 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
             // Start secondary IGFS.
             FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-            igfsCfg.setDataCacheName("partitioned");
-            igfsCfg.setMetaCacheName("replicated");
             igfsCfg.setName("igfs_secondary");
             igfsCfg.setIpcEndpointConfiguration(SECONDARY_ENDPOINT_CFG);
             igfsCfg.setBlockSize(512 * 1024);
             igfsCfg.setPrefetchBlocks(1);
 
-            CacheConfiguration cacheCfg = defaultCacheConfiguration();
+            CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-            cacheCfg.setName("partitioned");
-            cacheCfg.setCacheMode(PARTITIONED);
-            cacheCfg.setNearConfiguration(null);
-            cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-            cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
-            cacheCfg.setBackups(0);
-            cacheCfg.setAtomicityMode(TRANSACTIONAL);
+            dataCacheCfg.setName("partitioned");
+            dataCacheCfg.setCacheMode(PARTITIONED);
+            dataCacheCfg.setNearConfiguration(null);
+            dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+            dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
+            dataCacheCfg.setBackups(0);
+            dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
             CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
@@ -270,6 +268,9 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
             metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
             metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+            igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+            igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
             IgniteConfiguration cfg = new IgniteConfiguration();
 
             cfg.setGridName("grid_secondary");
@@ -281,7 +282,6 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
             discoSpi.setIpFinder(finder);
 
             cfg.setDiscoverySpi(discoSpi);
-            cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
             cfg.setFileSystemConfiguration(igfsCfg);
             cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
 
@@ -360,7 +360,6 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
         cfg.setGridName(gridName);
         cfg.setMarshaller(new OptimizedMarshaller());
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(cacheConfiguration(gridName));
         cfg.setFileSystemConfiguration(igfsConfiguration(gridName));
         cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
 
@@ -373,25 +372,35 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
      * @param gridName Grid name.
      * @return Cache configuration.
      */
-    protected CacheConfiguration[] cacheConfiguration(String gridName) {
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+    protected CacheConfiguration dataCacheConfiguration(String gridName) {
+        CacheConfiguration ccfg = defaultCacheConfiguration();
+
+        ccfg.setName("partitioned");
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setNearConfiguration(null);
+        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        ccfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
+        ccfg.setBackups(0);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
 
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        return ccfg;
+    }
 
-        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+    /**
+     * Gets cache configuration.
+     *
+     * @param gridName Grid name.
+     * @return Cache configuration.
+     */
+    protected CacheConfiguration metaCacheConfiguration(String gridName) {
+        CacheConfiguration ccfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
-        metaCacheCfg.setCacheMode(REPLICATED);
-        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+        ccfg.setName("replicated");
+        ccfg.setCacheMode(REPLICATED);
+        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
 
-        return new CacheConfiguration[] {metaCacheCfg, cacheCfg};
+        return ccfg;
     }
 
     /**
@@ -403,8 +412,8 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
     protected FileSystemConfiguration igfsConfiguration(String gridName) throws IgniteCheckedException {
         FileSystemConfiguration cfg = new FileSystemConfiguration();
 
-        cfg.setDataCacheName("partitioned");
-        cfg.setMetaCacheName("replicated");
+        cfg.setDataCacheConfiguration(dataCacheConfiguration(gridName));
+        cfg.setMetaCacheConfiguration(metaCacheConfiguration(gridName));
         cfg.setName("igfs");
         cfg.setPrefetchBlocks(1);
         cfg.setDefaultMode(mode);

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java
index 6091dca..657ee6e 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientBasedOpenTest.java
@@ -223,7 +223,8 @@ public class IgniteHadoopFileSystemClientBasedOpenTest extends GridCommonAbstrac
                 assert false : "Exception must be thrown";
             }
             catch (Exception e) {
-                assertTrue(e.getMessage().contains("Cannot find IGFS 'igfs-wrong-name' at the node"));
+                assertTrue(e.getMessage().contains(
+                    "Ignite client node doesn't have IGFS with the given name: igfs-wrong-name"));
             }
         } finally {
             stopAllGrids();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java
index 209e634..16c8fe1 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemClientSelfTest.java
@@ -80,8 +80,8 @@ public class IgniteHadoopFileSystemClientSelfTest extends IgfsCommonAbstractTest
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
+        igfsCfg.setDataCacheConfiguration(dataCacheConfiguration());
+        igfsCfg.setMetaCacheConfiguration(metaCacheConfiguration());
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(512 * 1024);
 
@@ -92,7 +92,6 @@ public class IgniteHadoopFileSystemClientSelfTest extends IgfsCommonAbstractTest
 
         igfsCfg.setIpcEndpointConfiguration(endpointCfg);
 
-        cfg.setCacheConfiguration(cacheConfiguration());
         cfg.setFileSystemConfiguration(igfsCfg);
 
         return cfg;
@@ -103,27 +102,36 @@ public class IgniteHadoopFileSystemClientSelfTest extends IgfsCommonAbstractTest
      *
      * @return Cache configuration.
      */
-    protected CacheConfiguration[] cacheConfiguration() {
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
-        cacheCfg.setEvictionPolicy(null);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
-
-        metaCacheCfg.setName("replicated");
-        metaCacheCfg.setCacheMode(REPLICATED);
-        metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
-        metaCacheCfg.setEvictionPolicy(null);
-        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        return new CacheConfiguration[] {metaCacheCfg, cacheCfg};
+    protected CacheConfiguration dataCacheConfiguration() {
+        CacheConfiguration ccfg = defaultCacheConfiguration();
+
+        ccfg.setName("partitioned");
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setNearConfiguration(null);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setEvictionPolicy(null);
+        ccfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        ccfg.setBackups(0);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
+
+        return ccfg;
+    }
+
+    /**
+     * Gets cache configuration.
+     *
+     * @return Cache configuration.
+     */
+    protected CacheConfiguration metaCacheConfiguration() {
+        CacheConfiguration ccfg = defaultCacheConfiguration();
+
+        ccfg.setName("replicated");
+        ccfg.setCacheMode(REPLICATED);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setEvictionPolicy(null);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
+
+        return ccfg;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
index a01c015..3457c45 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemHandshakeSelfTest.java
@@ -285,14 +285,12 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
         CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("partitioned");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setNearConfiguration(null);
         dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
@@ -300,15 +298,13 @@ public class IgniteHadoopFileSystemHandshakeSelfTest extends IgfsCommonAbstractT
         dataCacheCfg.setBackups(0);
         dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
-        cfg.setCacheConfiguration(metaCacheCfg, dataCacheCfg);
-
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName(dfltIgfsName ? null : IGFS_NAME);
         igfsCfg.setPrefetchBlocks(1);
         igfsCfg.setDefaultMode(PRIMARY);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
 
         IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java
index 35f1ceb..ac2ae68 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemIpcCacheSelfTest.java
@@ -73,10 +73,10 @@ public class IgniteHadoopFileSystemIpcCacheSelfTest extends IgfsCommonAbstractTe
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName("igfs");
         igfsCfg.setManagementPort(FileSystemConfiguration.DFLT_MGMT_PORT + cnt);
+        igfsCfg.setDataCacheConfiguration(dataCacheConfiguration());
+        igfsCfg.setMetaCacheConfiguration(metaCacheConfiguration());
 
         IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
 
@@ -89,7 +89,7 @@ public class IgniteHadoopFileSystemIpcCacheSelfTest extends IgfsCommonAbstractTe
 
         cfg.setFileSystemConfiguration(igfsCfg);
 
-        cfg.setCacheConfiguration(cacheConfiguration());
+        cfg.setCacheConfiguration(dataCacheConfiguration());
 
         cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
 
@@ -109,25 +109,34 @@ public class IgniteHadoopFileSystemIpcCacheSelfTest extends IgfsCommonAbstractTe
      *
      * @return Cache configuration.
      */
-    private CacheConfiguration[] cacheConfiguration() {
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+    private CacheConfiguration dataCacheConfiguration() {
+        CacheConfiguration ccfg = defaultCacheConfiguration();
+
+        ccfg.setName("partitioned");
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setNearConfiguration(null);
+        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        ccfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE));
+        ccfg.setBackups(0);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
+
+        return ccfg;
+    }
 
-        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+    /**
+     * Gets cache configuration.
+     *
+     * @return Cache configuration.
+     */
+    private CacheConfiguration metaCacheConfiguration() {
+        CacheConfiguration ccfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
-        metaCacheCfg.setCacheMode(REPLICATED);
-        metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+        ccfg.setName("replicated");
+        ccfg.setCacheMode(REPLICATED);
+        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        ccfg.setAtomicityMode(TRANSACTIONAL);
 
-        return new CacheConfiguration[] {metaCacheCfg, cacheCfg};
+        return ccfg;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java
index 8b6635e..fbf9eda 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemLoggerStateSelfTest.java
@@ -83,8 +83,6 @@ public class IgniteHadoopFileSystemLoggerStateSelfTest extends IgfsCommonAbstrac
     private void startUp() throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(512 * 1024);
         igfsCfg.setDefaultMode(PRIMARY);
@@ -96,15 +94,15 @@ public class IgniteHadoopFileSystemLoggerStateSelfTest extends IgfsCommonAbstrac
 
         igfsCfg.setIpcEndpointConfiguration(endpointCfg);
 
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        dataCacheCfg.setName("partitioned");
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setNearConfiguration(null);
+        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
@@ -113,6 +111,9 @@ public class IgniteHadoopFileSystemLoggerStateSelfTest extends IgfsCommonAbstrac
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("igfs-grid");
@@ -122,7 +123,6 @@ public class IgniteHadoopFileSystemLoggerStateSelfTest extends IgfsCommonAbstrac
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
index fd56137..52bb6cf 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest.java
@@ -69,8 +69,6 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(512 * 1024);
         igfsCfg.setInitializeDefaultPathModes(initDfltPathModes);
@@ -87,23 +85,24 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
             "igfs://igfs-secondary@127.0.0.1:11500/",
             "modules/core/src/test/config/hadoop/core-site-loopback-secondary.xml"));
 
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setNearConfiguration(null);
+        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("igfs-grid");
@@ -113,7 +112,6 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");
@@ -138,8 +136,6 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
     private void startUpSecondary() throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName("igfs-secondary");
         igfsCfg.setBlockSize(512 * 1024);
         igfsCfg.setDefaultMode(PRIMARY);
@@ -153,7 +149,6 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
 
         CacheConfiguration cacheCfg = defaultCacheConfiguration();
 
-        cacheCfg.setName("partitioned");
         cacheCfg.setCacheMode(PARTITIONED);
         cacheCfg.setNearConfiguration(null);
         cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
@@ -163,11 +158,13 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setDataCacheConfiguration(cacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("igfs-grid-secondary");
@@ -177,7 +174,6 @@ public class IgniteHadoopFileSystemSecondaryFileSystemInitializationSelfTest ext
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml b/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml
index e6bf426..091b6ff 100644
--- a/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml
+++ b/modules/spring/src/test/java/org/apache/ignite/spring/sprint-exclude.xml
@@ -33,8 +33,6 @@
             <list>
                 <bean class="org.apache.ignite.configuration.FileSystemConfiguration">
                     <property name="name" value="test"/>
-                    <property name="metaCacheName" value="meta"/>
-                    <property name="dataCacheName" value="data"/>
 
                     <property name="maxSpaceSize" value="#{100L * 1024 * 1024}"/>
 


[2/3] ignite git commit: IGNITE-3625: IGFS: "meta" and "data" caches are now configured inside IGFS bean. This closes #923. This closes #972.

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
index a98c3a1..9636c7d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDataManagerSelfTest.java
@@ -57,12 +57,6 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
     /** Test IP finder. */
     private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
 
-    /** Meta-information cache name. */
-    private static final String META_CACHE_NAME = "meta";
-
-    /** Data cache name. */
-    private static final String DATA_CACHE_NAME = "partitioned";
-
     /** Groups count for data blocks. */
     private static final int DATA_BLOCK_GROUP_CNT = 2;
 
@@ -95,8 +89,6 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME));
-
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
 
         discoSpi.setIpFinder(IP_FINDER);
@@ -105,8 +97,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
+        igfsCfg.setMetaCacheConfiguration(cacheConfiguration("meta"));
+        igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
         igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(BLOCK_SIZE);
@@ -122,7 +114,7 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
 
         cacheCfg.setName(cacheName);
 
-        if (META_CACHE_NAME.equals(cacheName))
+        if ("meta".equals(cacheName))
             cacheCfg.setCacheMode(REPLICATED);
         else {
             cacheCfg.setCacheMode(PARTITIONED);
@@ -141,9 +133,9 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         for (int i = 0; i < NODES_CNT; i++) {
-            grid(i).cachex(META_CACHE_NAME).clear();
+            grid(i).cachex(grid(i).igfsx("igfs").configuration().getMetaCacheConfiguration().getName()).clear();
 
-            grid(i).cachex(DATA_CACHE_NAME).clear();
+            grid(i).cachex(grid(i).igfsx("igfs").configuration().getDataCacheConfiguration().getName()).clear();
         }
     }
 
@@ -200,7 +192,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
             fut.get(3000);
 
             for (int j = 0; j < NODES_CNT; j++) {
-                GridCacheContext<Object, Object> ctx = GridTestUtils.getFieldValue(grid(j).cachex(DATA_CACHE_NAME),
+                GridCacheContext<Object, Object> ctx = GridTestUtils.getFieldValue(
+                    grid(j).cachex(grid(j).igfsx("igfs").configuration().getDataCacheConfiguration().getName()),
                     "ctx");
                 Collection<IgniteInternalTx> txs = ctx.tm().txs();
 
@@ -292,7 +285,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
             fut.get(3000);
 
             for (int j = 0; j < NODES_CNT; j++) {
-                GridCacheContext<Object, Object> ctx = GridTestUtils.getFieldValue(grid(j).cachex(DATA_CACHE_NAME),
+                GridCacheContext<Object, Object> ctx = GridTestUtils.getFieldValue(grid(j).cachex(
+                    grid(j).igfsx("igfs").configuration().getDataCacheConfiguration().getName()),
                     "ctx");
                 Collection<IgniteInternalTx> txs = ctx.tm().txs();
 
@@ -376,7 +370,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
             fut.get(3000);
 
             for (int j = 0; j < NODES_CNT; j++) {
-                GridCacheContext<Object, Object> ctx = GridTestUtils.getFieldValue(grid(j).cachex(DATA_CACHE_NAME),
+                GridCacheContext<Object, Object> ctx = GridTestUtils.getFieldValue(
+                    grid(j).cachex(grid(j).igfsx("igfs").configuration().getDataCacheConfiguration().getName()),
                     "ctx");
                 Collection<IgniteInternalTx> txs = ctx.tm().txs();
 
@@ -482,7 +477,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
             do {
                 IgfsBlockKey key = new IgfsBlockKey(info.id(), null, false, block);
 
-                ClusterNode affNode = grid(0).affinity(DATA_CACHE_NAME).mapKeyToNode(key);
+                ClusterNode affNode = grid(0).affinity(grid(0).igfsx("igfs").configuration()
+                    .getDataCacheConfiguration().getName()).mapKeyToNode(key);
 
                 assertTrue("Failed to find node in affinity [dataMgr=" + loc.nodeIds() +
                     ", nodeId=" + affNode.id() + ", block=" + block + ']', loc.nodeIds().contains(affNode.id()));
@@ -557,7 +553,8 @@ public class IgfsDataManagerSelfTest extends IgfsCommonAbstractTest {
                 IgfsBlockKey key = new IgfsBlockKey(info.id(),
                     info.fileMap().affinityKey(block * blockSize, false), false, block);
 
-                ClusterNode affNode = grid(0).affinity(DATA_CACHE_NAME).mapKeyToNode(key);
+                ClusterNode affNode = grid(0).affinity(grid(0).igfsx("igfs").configuration()
+                    .getDataCacheConfiguration().getName()).mapKeyToNode(key);
 
                 assertTrue("Failed to find node in affinity [dataMgr=" + loc.nodeIds() +
                     ", nodeId=" + affNode.id() + ", block=" + block + ']', loc.nodeIds().contains(affNode.id()));

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java
index c376c52..f3b777c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMaxSizeSelfTest.java
@@ -41,8 +41,6 @@ public class IgfsMaxSizeSelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName("test");
 
         if (maxSize > 0)
@@ -67,7 +65,9 @@ public class IgfsMaxSizeSelfTest extends IgfsCommonAbstractTest {
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
 
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         cfg.setFileSystemConfiguration(igfsCfg);
         cfg.setGridName(gridName);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
index 01e1a2e..e8f66ad 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
@@ -76,8 +76,6 @@ public class IgfsMetaManagerSelfTest extends IgfsCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME));
-
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
 
         discoSpi.setIpFinder(IP_FINDER);
@@ -86,8 +84,8 @@ public class IgfsMetaManagerSelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
+        igfsCfg.setMetaCacheConfiguration(cacheConfiguration(META_CACHE_NAME));
+        igfsCfg.setDataCacheConfiguration(cacheConfiguration(DATA_CACHE_NAME));
         igfsCfg.setName("igfs");
 
         cfg.setFileSystemConfiguration(igfsCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java
index 8d742fb..b3061c8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java
@@ -120,8 +120,6 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
     private IgniteConfiguration primaryConfiguration(int idx) throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(IGFS_PRIMARY);
         igfsCfg.setBlockSize(PRIMARY_BLOCK_SIZE);
         igfsCfg.setDefaultMode(DUAL_SYNC);
@@ -135,7 +133,6 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setNearConfiguration(null);
         dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
@@ -145,12 +142,14 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setNearConfiguration(null);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("grid-" + idx);
@@ -160,7 +159,6 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
         discoSpi.setIpFinder(IP_FINDER);
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");
@@ -177,8 +175,6 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
     private void startSecondary() throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(IGFS_SECONDARY);
         igfsCfg.setBlockSize(SECONDARY_BLOCK_SIZE);
         igfsCfg.setDefaultMode(PRIMARY);
@@ -186,7 +182,6 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setNearConfiguration(null);
         dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
@@ -196,12 +191,14 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setNearConfiguration(null);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("grid-secondary");
@@ -211,7 +208,6 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java
index 5fcd8dd..c4d7835 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsModesSelfTest.java
@@ -98,8 +98,6 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(512 * 1024);
         igfsCfg.setInitializeDefaultPathModes(true);
@@ -114,23 +112,24 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
         if (setSecondaryFs)
             igfsCfg.setSecondaryFileSystem(igfsSecondary.asSecondary());
 
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setNearConfiguration(null);
+        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("igfs-grid");
@@ -140,7 +139,6 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");
@@ -159,8 +157,6 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
     private void startUpSecondary() throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("replicated");
         igfsCfg.setName("igfs-secondary");
         igfsCfg.setBlockSize(512 * 1024);
         igfsCfg.setDefaultMode(PRIMARY);
@@ -170,23 +166,24 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
         endpointCfg.setType(IgfsIpcEndpointType.TCP);
         endpointCfg.setPort(11500);
 
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setNearConfiguration(null);
+        dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("replicated");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("igfs-grid-secondary");
@@ -196,7 +193,6 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCacheCfg, cacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");
@@ -391,7 +387,7 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
             startUp();
         }
         catch (IgniteException e) {
-            errMsg = e.getCause().getCause().getMessage();
+            errMsg = e.getCause().getMessage();
         }
 
         assertTrue(errMsg.startsWith(
@@ -457,7 +453,7 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
             startUp();
         }
         catch (IgniteException e) {
-            errMsg = e.getCause().getCause().getMessage();
+            errMsg = e.getCause().getMessage();
         }
 
         assertTrue(errMsg.startsWith(
@@ -602,7 +598,8 @@ public class IgfsModesSelfTest extends IgfsCommonAbstractTest {
             assert !igfsSecondary.exists(file);
         }
 
-        int cacheSize = grid.cachex("partitioned").size();
+        int cacheSize = grid.cachex(grid.igfsx("igfs").configuration().getDataCacheConfiguration()
+            .getName()).size();
 
         if (primaryNotUsed)
             assert cacheSize == 0;

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
index c5f85bc..0cb797a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsOneClientNodeTest.java
@@ -37,12 +37,6 @@ import static org.apache.ignite.cache.CacheMode.PARTITIONED;
  * Test for igfs with one node in client mode.
  */
 public class IgfsOneClientNodeTest extends GridCommonAbstractTest {
-    /** Meta-information cache name. */
-    private static final String META_CACHE_NAME = "meta";
-
-    /** Data cache name. */
-    private static final String DATA_CACHE_NAME = null;
-
     /** Regular cache name. */
     private static final String CACHE_NAME = "cache";
 
@@ -50,8 +44,7 @@ public class IgfsOneClientNodeTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME),
-            cacheConfiguration(CACHE_NAME));
+        cfg.setCacheConfiguration(cacheConfiguration(CACHE_NAME));
 
         cfg.setClientMode(true);
 
@@ -61,9 +54,9 @@ public class IgfsOneClientNodeTest extends GridCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
         igfsCfg.setName("igfs");
+        igfsCfg.setMetaCacheConfiguration(cacheConfiguration(null));
+        igfsCfg.setDataCacheConfiguration(cacheConfiguration(null));
 
         cfg.setFileSystemConfiguration(igfsCfg);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
index c854970..3a735ae 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
@@ -70,12 +70,6 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
     /** Test IP finder. */
     private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
 
-    /** Meta-information cache name. */
-    private static final String META_CACHE_NAME = "replicated";
-
-    /** Data cache name. */
-    public static final String DATA_CACHE_NAME = "data";
-
     /** Random numbers generator. */
     protected final SecureRandom rnd = new SecureRandom();
 
@@ -98,7 +92,7 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
 
         assert cfgs.length == 1;
 
-        metaCacheName = cfgs[0].getMetaCacheName();
+        metaCacheName = cfgs[0].getMetaCacheConfiguration().getName();
 
         metaCache = ((IgniteKernal)grid).internalCache(metaCacheName);
     }
@@ -124,7 +118,6 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME));
 
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
 
@@ -134,8 +127,8 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
+        igfsCfg.setMetaCacheConfiguration(cacheConfiguration("meta"));
+        igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
         igfsCfg.setName("igfs");
 
         cfg.setFileSystemConfiguration(igfsCfg);
@@ -149,7 +142,7 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
 
         cacheCfg.setName(cacheName);
 
-        if (META_CACHE_NAME.equals(cacheName))
+        if ("meta".equals(cacheName))
             cacheCfg.setCacheMode(REPLICATED);
         else {
             cacheCfg.setCacheMode(PARTITIONED);
@@ -690,14 +683,17 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
     public void testDeleteCacheConsistency() throws Exception {
         IgfsPath path = new IgfsPath("/someFile");
 
+        String metaCacheName = grid(0).igfsx("igfs").configuration().getMetaCacheConfiguration().getName();
+        String dataCacheName = grid(0).igfsx("igfs").configuration().getDataCacheConfiguration().getName();
+
         try (IgfsOutputStream out = igfs.create(path, true)) {
             out.write(new byte[10 * 1024 * 1024]);
         }
 
         IgniteUuid fileId = U.field(igfs.info(path), "fileId");
 
-        GridCacheAdapter<IgniteUuid, IgfsEntryInfo> metaCache = ((IgniteKernal)grid(0)).internalCache(META_CACHE_NAME);
-        GridCacheAdapter<IgfsBlockKey, byte[]> dataCache = ((IgniteKernal)grid(0)).internalCache(DATA_CACHE_NAME);
+        GridCacheAdapter<IgniteUuid, IgfsEntryInfo> metaCache = ((IgniteKernal)grid(0)).internalCache(metaCacheName);
+        GridCacheAdapter<IgfsBlockKey, byte[]> dataCache = ((IgniteKernal)grid(0)).internalCache(dataCacheName);
 
         IgfsEntryInfo info = metaCache.get(fileId);
 
@@ -785,7 +781,8 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
             @Override public boolean apply() {
                 int metaSize = 0;
 
-                for (Object metaId : grid(0).cachex(igfs.configuration().getMetaCacheName()).keySet()) {
+                for (Object metaId : grid(0).cachex(igfs.configuration().getMetaCacheConfiguration().getName())
+                    .keySet()) {
                     if (!IgfsUtils.isRootOrTrashId((IgniteUuid)metaId))
                         metaSize++;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
index 28ec1da..a31a81a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorValidationSelfTest.java
@@ -24,8 +24,8 @@ import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
 import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
+import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper;
-import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
@@ -46,7 +46,7 @@ import static org.apache.ignite.igfs.IgfsMode.PROXY;
  * Tests for node validation logic in {@link IgfsProcessor}.
  * <p>
  * Tests starting with "testLocal" are checking
- * {@link IgfsProcessor#validateLocalIgfsConfigurations(org.apache.ignite.configuration.FileSystemConfiguration[])}.
+ * {@link IgfsUtils#validateLocalIgfsConfigurations(org.apache.ignite.configuration.IgniteConfiguration)}.
  * <p>
  * Tests starting with "testRemote" are checking {@link IgfsProcessor#checkIgfsOnRemoteNode(org.apache.ignite.cluster.ClusterNode)}.
  */
@@ -57,18 +57,6 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
     /** Grid #1 config. */
     private IgniteConfiguration g1Cfg;
 
-    /** Data cache 1 name. */
-    private static final String dataCache1Name = "dataCache1";
-
-    /** Data cache 2 name. */
-    private static final String dataCache2Name = "dataCache2";
-
-    /** Meta cache 1 name. */
-    private static final String metaCache1Name = "metaCache1";
-
-    /** Meta cache 2 name. */
-    private static final String metaCache2Name = "metaCache2";
-
     /** First IGFS config in grid #1. */
     private FileSystemConfiguration g1IgfsCfg1 = new FileSystemConfiguration();
 
@@ -91,12 +79,8 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
         cfg.setDiscoverySpi(discoSpi);
 
         g1IgfsCfg1.setName("g1IgfsCfg1");
-        g1IgfsCfg1.setDataCacheName(dataCache1Name);
-        g1IgfsCfg1.setMetaCacheName(metaCache1Name);
 
         g1IgfsCfg2.setName("g1IgfsCfg2");
-        g1IgfsCfg2.setDataCacheName(dataCache2Name);
-        g1IgfsCfg2.setMetaCacheName(metaCache2Name);
 
         cfg.setFileSystemConfiguration(g1IgfsCfg1, g1IgfsCfg2);
 
@@ -115,7 +99,7 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
      *
      * @param first the first array of elements to concatenate.
      * @param second the second array of elements to concatenate.
-     * @param cls
+     * @param cls Class of elements.
      * @return Concatenated array.
      */
     private <T> T[] concat(T[] first, T[] second, Class<?> cls) {
@@ -127,48 +111,18 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
         return res.toArray((T[]) Array.newInstance(cls, res.size()));
     }
 
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfNoCacheIsConfigured() throws Exception {
-        checkGridStartFails(g1Cfg, "Data cache is not configured locally for IGFS", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfNoDataCacheIsConfigured() throws Exception {
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setName("someName");
-
-        g1Cfg.setCacheConfiguration(cc);
-
-        checkGridStartFails(g1Cfg, "Data cache is not configured locally for IGFS", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfNoMetadataCacheIsConfigured() throws Exception {
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setName(dataCache1Name);
-
-        g1Cfg.setCacheConfiguration(cc);
-
-        checkGridStartFails(g1Cfg, "Metadata cache is not configured locally for IGFS", true);
-    }
-
     /**
      * @throws Exception If failed.
      */
     public void testLocalIfAffinityMapperIsWrongClass() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
 
-        for (CacheConfiguration cc : g1Cfg.getCacheConfiguration())
-            cc.setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
+        for (FileSystemConfiguration igfsCfg : g1Cfg.getFileSystemConfiguration()) {
+            igfsCfg.setDataCacheConfiguration(dataCache(1024));
+            igfsCfg.setMetaCacheConfiguration(metaCache());
+
+            igfsCfg.getMetaCacheConfiguration().setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
+            igfsCfg.getDataCacheConfiguration().setAffinityMapper(new GridCacheDefaultAffinityKeyMapper());
+        }
 
         checkGridStartFails(g1Cfg, "Invalid IGFS data cache configuration (key affinity mapper class should be", true);
     }
@@ -176,9 +130,7 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testLocalIfIgfsConfigsHaveDifferentNames() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
+    public void testLocalIfIgfsConfigsHaveDuplicatedNames() throws Exception {
         String igfsCfgName = "igfs-cfg";
 
         g1IgfsCfg1.setName(igfsCfgName);
@@ -191,11 +143,8 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testLocalIfQueryIndexingEnabledForDataCache() throws Exception {
-        CacheConfiguration[] dataCaches = dataCaches(1024);
-
-        dataCaches[0].setIndexedTypes(Integer.class, String.class);
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches, metaCaches(), CacheConfiguration.class));
+        g1IgfsCfg1.setDataCacheConfiguration(dataCache(1024));
+        g1IgfsCfg1.getDataCacheConfiguration().setIndexedTypes(Integer.class, String.class);
 
         checkGridStartFails(g1Cfg, "IGFS data cache cannot start with enabled query indexing", true);
     }
@@ -204,11 +153,9 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testLocalIfQueryIndexingEnabledForMetaCache() throws Exception {
-        CacheConfiguration[] metaCaches = metaCaches();
-
-        metaCaches[0].setIndexedTypes(Integer.class, String.class);
+        g1IgfsCfg1.setMetaCacheConfiguration(metaCache());
 
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches, CacheConfiguration.class));
+        g1IgfsCfg1.getMetaCacheConfiguration().setIndexedTypes(Integer.class, String.class);
 
         checkGridStartFails(g1Cfg, "IGFS metadata cache cannot start with enabled query indexing", true);
     }
@@ -218,8 +165,6 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
      */
     @SuppressWarnings("NullableProblems")
     public void testLocalNullIgfsNameIsSupported() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
         g1IgfsCfg1.setName(null);
 
         assertFalse(G.start(g1Cfg).cluster().nodes().isEmpty());
@@ -229,8 +174,6 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testLocalIfNonPrimaryModeAndHadoopFileSystemUriIsNull() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
         g1IgfsCfg2.setDefaultMode(PROXY);
 
         checkGridStartFails(g1Cfg, "secondaryFileSystem cannot be null when mode is not PRIMARY", true);
@@ -239,42 +182,9 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testLocalIfMetaCacheNameEquals() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        g1IgfsCfg1.setDataCacheName(dataCache1Name);
-        g1IgfsCfg1.setMetaCacheName(metaCache1Name);
-
-        g1IgfsCfg2.setDataCacheName(dataCache2Name);
-        g1IgfsCfg2.setMetaCacheName(metaCache1Name);
-
-        checkGridStartFails(g1Cfg, "Meta cache names should be different for different IGFS instances", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalIfDataCacheNameEquals() throws Exception {
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
-        g1IgfsCfg1.setDataCacheName(dataCache1Name);
-        g1IgfsCfg1.setMetaCacheName(metaCache1Name);
-
-        g1IgfsCfg2.setDataCacheName(dataCache1Name);
-        g1IgfsCfg2.setMetaCacheName(metaCache2Name);
-
-        checkGridStartFails(g1Cfg, "Data cache names should be different for different IGFS instances", true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testRemoteIfDataBlockSizeDiffers() throws Exception {
         IgniteConfiguration g2Cfg = getConfiguration("g2");
 
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
         FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
 
         g2IgfsCfg1.setBlockSize(g2IgfsCfg1.getBlockSize() + 100);
@@ -292,11 +202,11 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
     public void testRemoteIfAffinityMapperGroupSizeDiffers() throws Exception {
         IgniteConfiguration g2Cfg = getConfiguration("g2");
 
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(4021), metaCaches(), CacheConfiguration.class));
-
         G.start(g1Cfg);
 
+        for (FileSystemConfiguration igfsCfg : g2Cfg.getFileSystemConfiguration())
+            igfsCfg.setDataCacheConfiguration(dataCache(1000));
+
         checkGridStartFails(g2Cfg, "Affinity mapper group size should be the same on all nodes in grid for IGFS",
             false);
     }
@@ -304,104 +214,6 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testRemoteIfMetaCacheNameDiffers() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
-        FileSystemConfiguration g2IgfsCfg2 = new FileSystemConfiguration(g1IgfsCfg2);
-
-        g2IgfsCfg1.setMetaCacheName("g2MetaCache1");
-        g2IgfsCfg2.setMetaCacheName("g2MetaCache2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches("g2MetaCache1", "g2MetaCache2"),
-             CacheConfiguration.class));
-
-        g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g2IgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Meta cache name should be the same on all nodes in grid for IGFS", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfMetaCacheNameEquals() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
-        FileSystemConfiguration g2IgfsCfg2 = new FileSystemConfiguration(g1IgfsCfg2);
-
-        g2IgfsCfg1.setName("g2IgfsCfg1");
-        g2IgfsCfg2.setName("g2IgfsCfg2");
-
-        g2IgfsCfg1.setDataCacheName("g2DataCache1");
-        g2IgfsCfg2.setDataCacheName("g2DataCache2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024, "g2DataCache1", "g2DataCache2"), metaCaches(),
-             CacheConfiguration.class));
-
-        g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g2IgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Meta cache names should be different for different IGFS instances", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfDataCacheNameDiffers() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
-        FileSystemConfiguration g2IgfsCfg2 = new FileSystemConfiguration(g1IgfsCfg2);
-
-        g2IgfsCfg1.setDataCacheName("g2DataCache1");
-        g2IgfsCfg2.setDataCacheName("g2DataCache2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024, "g2DataCache1", "g2DataCache2"), metaCaches(),
-             CacheConfiguration.class));
-
-        g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g2IgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Data cache name should be the same on all nodes in grid for IGFS", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoteIfDataCacheNameEquals() throws Exception {
-        IgniteConfiguration g2Cfg = getConfiguration("g2");
-
-        FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
-        FileSystemConfiguration g2IgfsCfg2 = new FileSystemConfiguration(g1IgfsCfg2);
-
-        g2IgfsCfg1.setName("g2IgfsCfg1");
-        g2IgfsCfg2.setName("g2IgfsCfg2");
-
-        g2IgfsCfg1.setMetaCacheName("g2MetaCache1");
-        g2IgfsCfg2.setMetaCacheName("g2MetaCache2");
-
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches("g2MetaCache1", "g2MetaCache2"),
-             CacheConfiguration.class));
-
-        g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g2IgfsCfg2);
-
-        G.start(g1Cfg);
-
-        checkGridStartFails(g2Cfg, "Data cache names should be different for different IGFS instances", false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testRemoteIfDefaultModeDiffers() throws Exception {
         IgniteConfiguration g2Cfg = getConfiguration("g2");
 
@@ -414,9 +226,6 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
         g2IgfsCfg1.setDefaultMode(DUAL_SYNC);
         g2IgfsCfg2.setDefaultMode(DUAL_SYNC);
 
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
         g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g2IgfsCfg2);
 
         G.start(g1Cfg);
@@ -436,9 +245,6 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
         g2IgfsCfg1.setPathModes(Collections.singletonMap("/somePath", DUAL_SYNC));
         g2IgfsCfg2.setPathModes(Collections.singletonMap("/somePath", DUAL_SYNC));
 
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-        g2Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
-
         g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g2IgfsCfg2);
 
         G.start(g1Cfg);
@@ -450,21 +256,49 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testZeroEndpointTcpPort() throws Exception {
-        checkIvalidPort(0);
+        checkInvalidPort(0);
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testNegativeEndpointTcpPort() throws Exception {
-        checkIvalidPort(-1);
+        checkInvalidPort(-1);
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testTooBigEndpointTcpPort() throws Exception {
-        checkIvalidPort(65536);
+        checkInvalidPort(65536);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPreConfiguredCache() throws Exception {
+        FileSystemConfiguration igfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
+        igfsCfg1.setName("igfs");
+
+        g1Cfg.setFileSystemConfiguration(igfsCfg1);
+
+        CacheConfiguration ccfgData = dataCache(1024);
+        ccfgData.setRebalanceTimeout(10001);
+
+        CacheConfiguration ccfgMeta = metaCache();
+        ccfgMeta.setRebalanceTimeout(10002);
+
+        igfsCfg1.setDataCacheConfiguration(ccfgData);
+        igfsCfg1.setMetaCacheConfiguration(ccfgMeta);
+
+        IgniteEx g = (IgniteEx)G.start(g1Cfg);
+
+        assertEquals(10001,
+            g.cachex(g.igfsx("igfs").configuration().getDataCacheConfiguration().getName())
+                .configuration().getRebalanceTimeout());
+        assertEquals(10002,
+            g.cachex(g.igfsx("igfs").configuration().getMetaCacheConfiguration().getName())
+                .configuration().getRebalanceTimeout());
     }
 
     /**
@@ -473,9 +307,8 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
      * @param port Port.
      * @throws Exception If failed.
      */
-    private void checkIvalidPort(int port) throws Exception {
+    private void checkInvalidPort(int port) throws Exception {
         final String failMsg = "IGFS endpoint TCP port is out of range";
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
 
         final String igfsCfgName = "igfs-cfg";
         final IgfsIpcEndpointConfiguration igfsEndpointCfg = new IgfsIpcEndpointConfiguration();
@@ -491,7 +324,6 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
      */
     public void testInvalidEndpointThreadCount() throws Exception {
         final String failMsg = "IGFS endpoint thread count must be positive";
-        g1Cfg.setCacheConfiguration(concat(dataCaches(1024), metaCaches(), CacheConfiguration.class));
 
         final String igfsCfgName = "igfs-cfg";
         final IgfsIpcEndpointConfiguration igfsEndpointCfg = new IgfsIpcEndpointConfiguration();
@@ -520,9 +352,10 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
         }
         catch (IgniteException e) {
             if (testLoc) {
-                if ("Failed to start processor: GridProcessorAdapter []".equals(e.getMessage()) &&
+                if (e.getMessage().contains(excMsgSnippet)
+                    || ("Failed to start processor: GridProcessorAdapter []".equals(e.getMessage()) &&
                     (e.getCause().getMessage().contains(excMsgSnippet) ||
-                     e.getCause().getCause().getMessage().contains(excMsgSnippet)))
+                     e.getCause().getCause().getMessage().contains(excMsgSnippet))))
                     return; // Expected exception.
             }
             else if (e.getMessage().contains(excMsgSnippet))
@@ -536,51 +369,26 @@ public class IgfsProcessorValidationSelfTest extends IgfsCommonAbstractTest {
 
     /**
      * @param grpSize Group size to use in {@link org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper}.
-     * @param cacheNames 2 Optional caches names.
-     * @return 2 preconfigured data caches.
+     * @return 2 preconfigured data cache.
      */
-    private CacheConfiguration[] dataCaches(int grpSize, String... cacheNames) {
-        assertTrue(F.isEmpty(cacheNames) || cacheNames.length == 2);
-
-        if (F.isEmpty(cacheNames))
-            cacheNames = new String[] {dataCache1Name, dataCache2Name};
+    private CacheConfiguration dataCache(int grpSize) {
 
-        CacheConfiguration[] res = new CacheConfiguration[cacheNames.length];
+        CacheConfiguration dataCache = defaultCacheConfiguration();
 
-        for (int i = 0; i < cacheNames.length; i++) {
-            CacheConfiguration dataCache = defaultCacheConfiguration();
+        dataCache.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(grpSize));
+        dataCache.setAtomicityMode(TRANSACTIONAL);
 
-            dataCache.setName(cacheNames[i]);
-            dataCache.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(grpSize));
-            dataCache.setAtomicityMode(TRANSACTIONAL);
-
-            res[i] = dataCache;
-        }
-
-        return res;
+        return dataCache;
     }
 
     /**
-     * @param cacheNames 2 Optional caches names.
-     * @return 2 preconfigured meta caches.
+     * @return preconfigured meta cache.
      */
-    private CacheConfiguration[] metaCaches(String... cacheNames) {
-        assertTrue(F.isEmpty(cacheNames) || cacheNames.length == 2);
-
-        if (F.isEmpty(cacheNames))
-            cacheNames = new String[] {metaCache1Name, metaCache2Name};
+    private CacheConfiguration metaCache() {
+        CacheConfiguration metaCache = defaultCacheConfiguration();
 
-        CacheConfiguration[] res = new CacheConfiguration[cacheNames.length];
-
-        for (int i = 0; i < cacheNames.length; i++) {
-            CacheConfiguration metaCache = defaultCacheConfiguration();
-
-            metaCache.setName(cacheNames[i]);
-            metaCache.setAtomicityMode(TRANSACTIONAL);
-
-            res[i] = metaCache;
-        }
+        metaCache.setAtomicityMode(TRANSACTIONAL);
 
-        return res;
+        return metaCache;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java
index d4187cb..c5df409 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSecondaryFileSystemInjectionSelfTest.java
@@ -66,28 +66,26 @@ public class IgfsSecondaryFileSystemInjectionSelfTest extends GridCommonAbstract
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(IGFS_NAME);
         igfsCfg.setDefaultMode(IgfsMode.DUAL_SYNC);
         igfsCfg.setSecondaryFileSystem(secondary);
 
         CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         cfg.setFileSystemConfiguration(igfsCfg);
-        cfg.setCacheConfiguration(metaCacheCfg, dataCacheCfg);
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java
index e58d503..1b74909 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest.java
@@ -240,11 +240,24 @@ public abstract class IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest e
 
         FileSystemConfiguration igfsConfiguration = new FileSystemConfiguration();
 
-        igfsConfiguration.setDataCacheName(dataCacheName);
-        igfsConfiguration.setMetaCacheName(metaCacheName);
         igfsConfiguration.setName("igfs" + UUID.randomUUID());
         igfsConfiguration.setManagementPort(mgmtPort.getAndIncrement());
 
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
+
+        dataCacheCfg.setCacheMode(CacheMode.PARTITIONED);
+        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
+
+        metaCacheCfg.setCacheMode(CacheMode.REPLICATED);
+        metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
+
+        igfsConfiguration.setMetaCacheConfiguration(metaCacheCfg);
+        igfsConfiguration.setDataCacheConfiguration(dataCacheCfg);
+
         if (endPntCfg != null)
             igfsConfiguration.setIpcEndpointConfiguration(endPntCfg);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
index 266945f..7a1ccef 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
@@ -72,14 +72,8 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
     /** Block size. */
     private static final int BLOCK_SIZE = 384;
 
-    /** Cache name. */
-    private static final String DATA_CACHE_NAME = "dataCache";
-
-    /** Cache name. */
-    private static final String META_CACHE_NAME = "metaCache";
-
     /** IGFS name. */
-    private static final String IGFS_NAME = "igfs";
+    private static final String IGFS_NAME = "test";
 
     /** IP finder. */
     private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
@@ -120,8 +114,6 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
         igfsCfg.setName(IGFS_NAME);
         igfsCfg.setBlockSize(BLOCK_SIZE);
         igfsCfg.setFragmentizerEnabled(false);
@@ -131,7 +123,6 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration dataCfg = defaultCacheConfiguration();
 
-        dataCfg.setName(DATA_CACHE_NAME);
         dataCfg.setCacheMode(cacheMode);
 
         if (cacheMode == PARTITIONED) {
@@ -148,19 +139,20 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration metaCfg = defaultCacheConfiguration();
 
-        metaCfg.setName(META_CACHE_NAME);
         metaCfg.setCacheMode(REPLICATED);
 
         metaCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCfg.setRebalanceMode(SYNC);
         metaCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setMetaCacheConfiguration(metaCfg);
+        igfsCfg.setDataCacheConfiguration(dataCfg);
+
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
 
         discoSpi.setIpFinder(IP_FINDER);
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(metaCfg, dataCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         return cfg;
@@ -284,7 +276,8 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
         for (int i = 0; i < GRID_CNT; i++) {
             IgniteEx g = grid(i);
 
-            IgniteInternalCache cache = g.cachex(DATA_CACHE_NAME).cache();
+            IgniteInternalCache cache = g.cachex(g.igfsx(IGFS_NAME).configuration().getDataCacheConfiguration()
+                .getName()).cache();
 
             assert cache.isIgfsDataCache();
         }
@@ -547,7 +540,8 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
         Collection<UUID> ids = new HashSet<>();
 
         for (ClusterNode node : grid.cluster().nodes()) {
-            if (grid.affinity(DATA_CACHE_NAME).isPrimaryOrBackup(node, key))
+            if (grid.affinity(grid.igfsx(IGFS_NAME).configuration().getDataCacheConfiguration().getName())
+                .isPrimaryOrBackup(node, key))
                 ids.add(node.id());
         }
 
@@ -572,8 +566,9 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
      * @return Data cache.
      */
     private GridCacheAdapter<IgfsBlockKey, byte[]> cache(UUID nodeId) {
-        return (GridCacheAdapter<IgfsBlockKey, byte[]>)((IgniteEx)G.ignite(nodeId)).cachex(DATA_CACHE_NAME)
-            .<IgfsBlockKey, byte[]>cache();
+        IgniteEx g = (IgniteEx)G.ignite(nodeId);
+        return (GridCacheAdapter<IgfsBlockKey, byte[]>)g.cachex(g.igfsx(IGFS_NAME).configuration()
+            .getDataCacheConfiguration().getName()).<IgfsBlockKey, byte[]>cache();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
index eff44f2..9be3814 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStartCacheTest.java
@@ -24,6 +24,7 @@ import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
 import org.apache.ignite.igfs.IgfsPath;
+import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
 import org.apache.ignite.internal.util.typedef.G;
@@ -67,15 +68,12 @@ public class IgfsStartCacheTest extends IgfsCommonAbstractTest {
         if (igfs) {
             FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-            igfsCfg.setDataCacheName("dataCache");
-            igfsCfg.setMetaCacheName("metaCache");
             igfsCfg.setName("igfs");
             igfsCfg.setDefaultMode(PRIMARY);
             igfsCfg.setFragmentizerEnabled(false);
 
             CacheConfiguration dataCacheCfg = new CacheConfiguration();
 
-            dataCacheCfg.setName("dataCache");
             dataCacheCfg.setCacheMode(PARTITIONED);
             dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
             dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
@@ -83,12 +81,13 @@ public class IgfsStartCacheTest extends IgfsCommonAbstractTest {
 
             CacheConfiguration metaCacheCfg = new CacheConfiguration();
 
-            metaCacheCfg.setName("metaCache");
             metaCacheCfg.setCacheMode(REPLICATED);
             metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
             metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
 
-            cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
+            igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+            igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
             cfg.setFileSystemConfiguration(igfsCfg);
         }
 
@@ -110,11 +109,14 @@ public class IgfsStartCacheTest extends IgfsCommonAbstractTest {
     public void testCacheStart() throws Exception {
         Ignite g0 = G.start(config(true, 0));
 
-        checkIgfsCaches(g0);
+        String dataCacheName = ((IgniteEx)g0).igfsx("igfs").configuration().getDataCacheConfiguration().getName();
+        String metaCacheName = ((IgniteEx)g0).igfsx("igfs").configuration().getMetaCacheConfiguration().getName();
+
+        checkIgfsCaches(g0, dataCacheName, metaCacheName);
 
         Ignite g1 = G.start(config(false, 1));
 
-        checkIgfsCaches(g1);
+        checkIgfsCaches(g1, dataCacheName, metaCacheName);
 
         IgniteFileSystem igfs = g0.fileSystem("igfs");
 
@@ -130,11 +132,13 @@ public class IgfsStartCacheTest extends IgfsCommonAbstractTest {
 
     /**
      * @param ignite Ignite.
+     * @param dataCacheName Data cache name.
+     * @param metaCacheName Meta cache name.
      */
-    private void checkIgfsCaches(final Ignite ignite) {
+    private void checkIgfsCaches(final Ignite ignite, final String dataCacheName, final String metaCacheName) {
         GridTestUtils.assertThrows(log(), new Callable<Object>() {
             @Override public Object call() throws Exception {
-                ignite.cache("dataCache");
+                ignite.cache(dataCacheName);
 
                 return null;
             }
@@ -142,14 +146,14 @@ public class IgfsStartCacheTest extends IgfsCommonAbstractTest {
 
         GridTestUtils.assertThrows(log(), new Callable<Object>() {
             @Override public Object call() throws Exception {
-                ignite.cache("metaCache");
+                ignite.cache(metaCacheName);
 
                 return null;
             }
         }, IllegalStateException.class, null);
 
-        checkCache(((IgniteKernal)ignite).internalCache("dataCache"));
-        checkCache(((IgniteKernal)ignite).internalCache("metaCache"));
+        checkCache(((IgniteKernal)ignite).internalCache(dataCacheName));
+        checkCache(((IgniteKernal)ignite).internalCache(metaCacheName));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java
index 8c6cf57..9c735f5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsStreamsSelfTest.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
-import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteFileSystem;
 import org.apache.ignite.cache.CacheRebalanceMode;
 import org.apache.ignite.cache.CacheWriteSynchronizationMode;
@@ -32,7 +31,6 @@ import org.apache.ignite.igfs.IgfsOutputStream;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
-import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.util.typedef.CAX;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -67,12 +65,6 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
     /** Test IP finder. */
     private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
 
-    /** Meta-information cache name. */
-    private static final String META_CACHE_NAME = "replicated";
-
-    /** Data cache name. */
-    public static final String DATA_CACHE_NAME = "data";
-
     /** Group size. */
     public static final int CFG_GRP_SIZE = 128;
 
@@ -124,7 +116,7 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
         cfg.setLateAffinityAssignment(false);
-        cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME));
+        cfg.setCacheConfiguration();
 
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
 
@@ -134,8 +126,8 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
+        igfsCfg.setMetaCacheConfiguration(cacheConfiguration("meta"));
+        igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(CFG_BLOCK_SIZE);
         igfsCfg.setFragmentizerEnabled(true);
@@ -151,7 +143,7 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
 
         cacheCfg.setName(cacheName);
 
-        if (META_CACHE_NAME.equals(cacheName))
+        if ("meta".equals(cacheName))
             cacheCfg.setCacheMode(REPLICATED);
         else {
             cacheCfg.setCacheMode(PARTITIONED);
@@ -168,24 +160,6 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
     }
 
     /**
-     * Test IGFS construction.
-     *
-     * @throws IgniteCheckedException In case of exception.
-     */
-    public void testConfiguration() throws IgniteCheckedException {
-        IgniteInternalCache metaCache = getFieldValue(fs, "meta", "metaCache");
-        IgniteInternalCache dataCache = getFieldValue(fs, "data", "dataCache");
-
-        assertNotNull(metaCache);
-        assertEquals(META_CACHE_NAME, metaCache.name());
-        assertEquals(REPLICATED, metaCache.configuration().getCacheMode());
-
-        assertNotNull(dataCache);
-        assertEquals(DATA_CACHE_NAME, dataCache.name());
-        assertEquals(PARTITIONED, dataCache.configuration().getCacheMode());
-    }
-
-    /**
      * Test file creation.
      *
      * @throws Exception In case of exception.
@@ -215,7 +189,8 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
         while (true) {
             affKey = new IgniteUuid(uuid, idx);
 
-            if (grid(0).affinity(DATA_CACHE_NAME).mapKeyToNode(affKey).id().equals(grid(0).localNode().id()))
+            if (grid(0).affinity(grid(0).igfsx("igfs").configuration().getDataCacheConfiguration()
+                .getName()).mapKeyToNode(affKey).id().equals(grid(0).localNode().id()))
                 break;
 
             idx++;
@@ -242,6 +217,9 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
     /** @throws Exception If failed. */
     public void testCreateFileFragmented() throws Exception {
         IgfsEx impl = (IgfsEx)grid(0).fileSystem("igfs");
+        String metaCacheName = grid(0).igfsx("igfs").configuration().getMetaCacheConfiguration().getName();
+        final String dataCacheName = grid(0).igfsx("igfs").configuration().getDataCacheConfiguration()
+            .getName();
 
         IgfsFragmentizerManager fragmentizer = impl.context().fragmentizer();
 
@@ -276,7 +254,7 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
             // After this we should have first two block colocated with grid 0 and last block colocated with grid 1.
             IgfsFileImpl fileImpl = (IgfsFileImpl)fs.info(path);
 
-            GridCacheAdapter<Object, Object> metaCache = ((IgniteKernal)grid(0)).internalCache(META_CACHE_NAME);
+            GridCacheAdapter<Object, Object> metaCache = ((IgniteKernal)grid(0)).internalCache(metaCacheName);
 
             IgfsEntryInfo fileInfo = (IgfsEntryInfo)metaCache.get(fileImpl.fileId());
 
@@ -311,7 +289,7 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
             boolean hasData = false;
 
             for (int i = 0; i < NODES_CNT; i++)
-                hasData |= !grid(i).cachex(DATA_CACHE_NAME).isEmpty();
+                hasData |= !grid(i).cachex(dataCacheName).isEmpty();
 
             assertTrue(hasData);
 
@@ -321,7 +299,7 @@ public class IgfsStreamsSelfTest extends IgfsCommonAbstractTest {
         GridTestUtils.retryAssert(log, ASSERT_RETRIES, ASSERT_RETRY_INTERVAL, new CAX() {
             @Override public void applyx() {
                 for (int i = 0; i < NODES_CNT; i++)
-                    assertTrue(grid(i).cachex(DATA_CACHE_NAME).isEmpty());
+                    assertTrue(grid(i).cachex(dataCacheName).isEmpty());
             }
         });
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsTaskSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsTaskSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsTaskSelfTest.java
index 7b972c3..b07c7b8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsTaskSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsTaskSelfTest.java
@@ -112,8 +112,6 @@ public class IgfsTaskSelfTest extends IgfsCommonAbstractTest {
     private IgniteConfiguration config(int idx) {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(BLOCK_SIZE);
         igfsCfg.setDefaultMode(PRIMARY);
@@ -121,7 +119,6 @@ public class IgfsTaskSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration dataCacheCfg = new CacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
         dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
@@ -130,11 +127,13 @@ public class IgfsTaskSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration metaCacheCfg = new CacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
@@ -142,7 +141,6 @@ public class IgfsTaskSelfTest extends IgfsCommonAbstractTest {
         discoSpi.setIpFinder(IP_FINDER);
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setGridName("node-" + idx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/split/IgfsAbstractRecordResolverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/split/IgfsAbstractRecordResolverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/split/IgfsAbstractRecordResolverSelfTest.java
index 77b6f44..f2b14a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/split/IgfsAbstractRecordResolverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/split/IgfsAbstractRecordResolverSelfTest.java
@@ -58,15 +58,12 @@ public class IgfsAbstractRecordResolverSelfTest extends GridCommonAbstractTest {
     @Override protected void beforeTestsStarted() throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(512);
         igfsCfg.setDefaultMode(PRIMARY);
 
         CacheConfiguration dataCacheCfg = new CacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
         dataCacheCfg.setNearConfiguration(new NearCacheConfiguration());
@@ -76,11 +73,13 @@ public class IgfsAbstractRecordResolverSelfTest extends GridCommonAbstractTest {
 
         CacheConfiguration metaCacheCfg = new CacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
         metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("grid");
@@ -90,7 +89,6 @@ public class IgfsAbstractRecordResolverSelfTest extends GridCommonAbstractTest {
         discoSpi.setIpFinder(ipFinder);
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         Ignite g = G.start(cfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java
index 3314d7a..90dd556 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java
@@ -60,22 +60,30 @@ public class IpcSharedMemoryNodeStartup {
 
         igfsCfg.setIpcEndpointConfiguration(endpointCfg);
 
-        igfsCfg.setDataCacheName("partitioned");
-        igfsCfg.setMetaCacheName("partitioned");
         igfsCfg.setName("igfs");
 
-        cfg.setFileSystemConfiguration(igfsCfg);
+        CacheConfiguration metaCacheCfg = new CacheConfiguration();
+
+        metaCacheCfg.setName("partitioned");
+        metaCacheCfg.setCacheMode(PARTITIONED);
+        metaCacheCfg.setNearConfiguration(null);
+        metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+        metaCacheCfg.setEvictionPolicy(null);
+        metaCacheCfg.setBackups(0);
 
-        CacheConfiguration cacheCfg = new CacheConfiguration();
+        CacheConfiguration dataCacheCfg = new CacheConfiguration();
 
-        cacheCfg.setName("partitioned");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
-        cacheCfg.setEvictionPolicy(null);
-        cacheCfg.setBackups(0);
+        dataCacheCfg.setName("partitioned");
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setNearConfiguration(null);
+        dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+        dataCacheCfg.setEvictionPolicy(null);
+        dataCacheCfg.setBackups(0);
 
-        cfg.setCacheConfiguration(cacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
+        cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-0.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-0.xml b/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-0.xml
index 072c6db..dd3da7c 100644
--- a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-0.xml
+++ b/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-0.xml
@@ -59,39 +59,6 @@
         </property>
 
         <!--
-            Configure caches where IGFS will store data.
-        -->
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Configure metadata cache where file system structure will be stored. It must be TRANSACTIONAL,
-                    and must have backups to maintain file system consistency in case of node crash.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="replicated"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <!--
-                    Configure data cache where file's data will be stored.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="partitioned"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <property name="groupSize" value="128"/>
-                        </bean>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!--
             This port will be used by Apache Hadoop client to connect to Ignite node as if it was a job tracker.
         -->
         <property name="connectorConfiguration">
@@ -109,9 +76,27 @@
                     <!-- IGFS name you will use to access IGFS through Hadoop API. -->
                     <property name="name" value="igfs-0"/>
 
-                    <!-- Caches with these names must be configured. -->
-                    <property name="metaCacheName" value="replicated"/>
-                    <property name="dataCacheName" value="partitioned"/>
+                    <!-- IGFS Caches. -->
+                    <property name="metaCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="cacheMode" value="REPLICATED"/>
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                        </bean>
+                    </property>
+                    <property name="dataCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                            <property name="cacheMode" value="PARTITIONED"/>
+                            <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+
+                            <property name="affinityMapper">
+                                <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
+                                    <property name="groupSize" value="128"/>
+                                </bean>
+                            </property>
+                        </bean>
+                    </property>
+
                     <property name="blockSize" value="524288"/>
                     <property name="defaultMode" value="PRIMARY"/>
                     <property name="ipcEndpointEnabled" value="false"/>

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-1.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-1.xml b/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-1.xml
index e52921d..c577d28 100644
--- a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-1.xml
+++ b/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-1.xml
@@ -59,39 +59,6 @@
         </property>
 
         <!--
-            Configure caches where IGFS will store data.
-        -->
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Configure metadata cache where file system structure will be stored. It must be TRANSACTIONAL,
-                    and must have backups to maintain file system consistency in case of node crash.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="replicated"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <!--
-                    Configure data cache where file's data will be stored.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="partitioned"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <property name="groupSize" value="128"/>
-                        </bean>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!--
             This port will be used by Apache Hadoop client to connect to Ignite node as if it was a job tracker.
         -->
         <property name="connectorConfiguration">
@@ -109,9 +76,27 @@
                     <!-- IGFS name you will use to access IGFS through Hadoop API. -->
                     <property name="name" value="igfs-1"/>
 
-                    <!-- Caches with these names must be configured. -->
-                    <property name="metaCacheName" value="replicated"/>
-                    <property name="dataCacheName" value="partitioned"/>
+                    <!-- IGFS Caches. -->
+                    <property name="metaCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="cacheMode" value="REPLICATED"/>
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                        </bean>
+                    </property>
+                    <property name="dataCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                            <property name="cacheMode" value="PARTITIONED"/>
+                            <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+
+                            <property name="affinityMapper">
+                                <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
+                                    <property name="groupSize" value="128"/>
+                                </bean>
+                            </property>
+                        </bean>
+                    </property>
+
                     <property name="blockSize" value="524288"/>
                     <property name="defaultMode" value="PRIMARY"/>
                     <property name="ipcEndpointEnabled" value="false"/>

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-2.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-2.xml b/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-2.xml
index 9344e99..1f7eaa3 100644
--- a/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-2.xml
+++ b/modules/hadoop/src/test/config/hadoop-fs-open-test/grid-2.xml
@@ -59,39 +59,6 @@
         </property>
 
         <!--
-            Configure caches where IGFS will store data.
-        -->
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Configure metadata cache where file system structure will be stored. It must be TRANSACTIONAL,
-                    and must have backups to maintain file system consistency in case of node crash.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="replicated"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <!--
-                    Configure data cache where file's data will be stored.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="partitioned"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <property name="groupSize" value="128"/>
-                        </bean>
-                    </property>
-                </bean>
-            </list>
-        </property>
-
-        <!--
             This port will be used by Apache Hadoop client to connect to Ignite node as if it was a job tracker.
         -->
         <property name="connectorConfiguration">
@@ -109,9 +76,27 @@
                     <!-- IGFS name you will use to access IGFS through Hadoop API. -->
                     <property name="name" value="igfs-2"/>
 
-                    <!-- Caches with these names must be configured. -->
-                    <property name="metaCacheName" value="replicated"/>
-                    <property name="dataCacheName" value="partitioned"/>
+                    <!-- IGFS Caches. -->
+                    <property name="metaCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="cacheMode" value="REPLICATED"/>
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                        </bean>
+                    </property>
+                    <property name="dataCacheConfiguration">
+                        <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                            <property name="atomicityMode" value="TRANSACTIONAL"/>
+                            <property name="cacheMode" value="PARTITIONED"/>
+                            <property name="writeSynchronizationMode" value="FULL_SYNC"/>
+
+                            <property name="affinityMapper">
+                                <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
+                                    <property name="groupSize" value="128"/>
+                                </bean>
+                            </property>
+                        </bean>
+                    </property>
+
                     <property name="blockSize" value="524288"/>
                     <property name="defaultMode" value="PRIMARY"/>
                     <property name="ipcEndpointEnabled" value="false"/>


[3/3] ignite git commit: IGNITE-3625: IGFS: "meta" and "data" caches are now configured inside IGFS bean. This closes #923. This closes #972.

Posted by vo...@apache.org.
IGNITE-3625: IGFS: "meta" and "data" caches are now configured inside IGFS bean. This closes #923. This closes #972.


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

Branch: refs/heads/ignite-2.0
Commit: 3ca46d1a1bebf940f916ef47eaae48c3a181433d
Parents: f55370b
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Tue Feb 21 13:55:30 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Tue Feb 21 13:55:30 2017 +0300

----------------------------------------------------------------------
 config/hadoop/default-config.xml                |  29 --
 examples/config/filesystem/example-igfs.xml     |  27 --
 .../JettyRestProcessorAbstractSelfTest.java     |  23 --
 .../configuration/FileSystemConfiguration.java  |  75 +++--
 .../org/apache/ignite/internal/IgnitionEx.java  |   9 +-
 .../processors/cache/GridCacheAdapter.java      |   3 +-
 .../processors/cache/GridCacheProcessor.java    |   5 +-
 .../processors/igfs/IgfsDataManager.java        |  11 +-
 .../internal/processors/igfs/IgfsImpl.java      |   2 +-
 .../processors/igfs/IgfsMetaManager.java        |  13 +-
 .../internal/processors/igfs/IgfsProcessor.java | 130 +-------
 .../internal/processors/igfs/IgfsUtils.java     | 215 +++++++++++--
 .../visor/node/VisorIgfsConfiguration.java      |   4 +-
 .../visor/node/VisorNodeDataCollectorJob.java   |   6 +-
 modules/core/src/test/config/igfs-loopback.xml  |  27 --
 modules/core/src/test/config/igfs-shmem.xml     |  27 --
 .../ignite/igfs/IgfsEventsAbstractSelfTest.java |  51 ++-
 .../igfs/IgfsFragmentizerAbstractSelfTest.java  |  17 +-
 .../ignite/igfs/IgfsFragmentizerSelfTest.java   |   3 +-
 .../igfs/IgfsAbstractBaseSelfTest.java          |  17 +-
 .../igfs/IgfsBackupFailoverSelfTest.java        |   7 +-
 ...lockMessageSystemPoolStarvationSelfTest.java |  17 +-
 ...sCachePerBlockLruEvictionPolicySelfTest.java |  18 +-
 .../processors/igfs/IgfsCacheSelfTest.java      |  19 +-
 .../igfs/IgfsDataManagerSelfTest.java           |  33 +-
 .../processors/igfs/IgfsMaxSizeSelfTest.java    |   6 +-
 .../igfs/IgfsMetaManagerSelfTest.java           |   6 +-
 .../processors/igfs/IgfsMetricsSelfTest.java    |  16 +-
 .../processors/igfs/IgfsModesSelfTest.java      |  51 ++-
 .../processors/igfs/IgfsOneClientNodeTest.java  |  13 +-
 .../processors/igfs/IgfsProcessorSelfTest.java  |  25 +-
 .../igfs/IgfsProcessorValidationSelfTest.java   | 320 ++++---------------
 ...gfsSecondaryFileSystemInjectionSelfTest.java |   8 +-
 ...IpcEndpointRegistrationAbstractSelfTest.java |  17 +-
 .../processors/igfs/IgfsSizeSelfTest.java       |  27 +-
 .../processors/igfs/IgfsStartCacheTest.java     |  28 +-
 .../processors/igfs/IgfsStreamsSelfTest.java    |  46 +--
 .../processors/igfs/IgfsTaskSelfTest.java       |   8 +-
 .../IgfsAbstractRecordResolverSelfTest.java     |   8 +-
 .../ipc/shmem/IpcSharedMemoryNodeStartup.java   |  30 +-
 .../test/config/hadoop-fs-open-test/grid-0.xml  |  57 ++--
 .../test/config/hadoop-fs-open-test/grid-1.xml  |  57 ++--
 .../test/config/hadoop-fs-open-test/grid-2.xml  |  57 ++--
 .../test/config/igfs-cli-config-dual-async.xml  |  57 ++--
 .../test/config/igfs-cli-config-dual-sync.xml   |  57 ++--
 .../src/test/config/igfs-cli-config-primary.xml |  57 ++--
 .../src/test/config/igfs-cli-config-proxy.xml   |  57 ++--
 .../impl/HadoopAbstractMapReduceTest.java       |   6 +-
 .../hadoop/impl/HadoopAbstractSelfTest.java     |  18 +-
 .../igfs/HadoopFIleSystemFactorySelfTest.java   |   8 +-
 .../HadoopIgfs20FileSystemAbstractSelfTest.java |  52 +--
 .../igfs/HadoopIgfsDualAbstractSelfTest.java    |   8 +-
 ...oopSecondaryFileSystemConfigurationTest.java |  69 ++--
 .../igfs/IgfsNearOnlyMultiNodeSelfTest.java     |   6 +-
 .../IgniteHadoopFileSystemAbstractSelfTest.java |  67 ++--
 ...niteHadoopFileSystemClientBasedOpenTest.java |   3 +-
 .../IgniteHadoopFileSystemClientSelfTest.java   |  56 ++--
 ...IgniteHadoopFileSystemHandshakeSelfTest.java |   8 +-
 .../IgniteHadoopFileSystemIpcCacheSelfTest.java |  47 +--
 ...niteHadoopFileSystemLoggerStateSelfTest.java |  22 +-
 ...condaryFileSystemInitializationSelfTest.java |  30 +-
 .../org/apache/ignite/spring/sprint-exclude.xml |   2 -
 62 files changed, 889 insertions(+), 1309 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/config/hadoop/default-config.xml
----------------------------------------------------------------------
diff --git a/config/hadoop/default-config.xml b/config/hadoop/default-config.xml
index d8d3636..83d3679 100644
--- a/config/hadoop/default-config.xml
+++ b/config/hadoop/default-config.xml
@@ -54,31 +54,6 @@
     -->
     <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
         <!--
-            Configure caches where IGFS will store data.
-        -->
-        <property name="cacheConfiguration">
-            <list>
-                <!--
-                    Configure metadata cache where file system structure will be stored. It must be TRANSACTIONAL,
-                    and must have backups to maintain file system consistency in case of node crash.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="igfs-meta"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-
-                <!--
-                    Configure data cache where file's data will be stored.
-                -->
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="igfs-data"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                </bean>
-            </list>
-        </property>
-
-        <!--
             This port will be used by Apache Hadoop client to connect to Ignite node as if it was a job tracker.
         -->
         <property name="connectorConfiguration">
@@ -96,10 +71,6 @@
                     <!-- IGFS name you will use to access IGFS through Hadoop API. -->
                     <property name="name" value="igfs"/>
 
-                    <!-- Caches with these names must be configured. -->
-                    <property name="metaCacheName" value="igfs-meta"/>
-                    <property name="dataCacheName" value="igfs-data"/>
-
                     <!-- Configure TCP endpoint for communication with the file system instance. -->
                     <property name="ipcEndpointConfiguration">
                         <bean class="org.apache.ignite.igfs.IgfsIpcEndpointConfiguration">

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/examples/config/filesystem/example-igfs.xml
----------------------------------------------------------------------
diff --git a/examples/config/filesystem/example-igfs.xml b/examples/config/filesystem/example-igfs.xml
index a72ddce..2236821 100644
--- a/examples/config/filesystem/example-igfs.xml
+++ b/examples/config/filesystem/example-igfs.xml
@@ -61,8 +61,6 @@
             <list>
                 <bean class="org.apache.ignite.configuration.FileSystemConfiguration">
                     <property name="name" value="igfs"/>
-                    <property name="metaCacheName" value="igfs-meta"/>
-                    <property name="dataCacheName" value="igfs-data"/>
 
                     <!-- Must correlate with cache affinity mapper. -->
                     <property name="blockSize" value="#{128 * 1024}"/>
@@ -97,31 +95,6 @@
             </list>
         </property>
 
-        <property name="cacheConfiguration">
-            <list>
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="igfs-data"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-                    <property name="backups" value="0"/>
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <!-- Haw many blocks in row will be stored on the same node. -->
-                            <constructor-arg value="512"/>
-                        </bean>
-                    </property>
-                </bean>
-
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="igfs-meta"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-                </bean>
-            </list>
-        </property>
-
         <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
         <property name="discoverySpi">
             <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index 8d3ab74..84071ea 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -2274,32 +2274,9 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        CacheConfiguration cacheIgfs_data = new CacheConfiguration();
-
-        cacheIgfs_data.setName("igfs-data");
-        cacheIgfs_data.setCacheMode(CacheMode.PARTITIONED);
-        cacheIgfs_data.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-        cacheIgfs_data.setBackups(0);
-
-        cacheIgfs_data.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-
-        cacheIgfs_data.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(512));
-
-        CacheConfiguration cacheIgfs_meta = new CacheConfiguration();
-
-        cacheIgfs_meta.setName("igfs-meta");
-        cacheIgfs_meta.setCacheMode(CacheMode.REPLICATED);
-        cacheIgfs_meta.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-
-        cacheIgfs_meta.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-
-        cfg.setCacheConfiguration(cfg.getCacheConfiguration()[0], cacheIgfs_data, cacheIgfs_meta);
-
         FileSystemConfiguration igfs = new FileSystemConfiguration();
 
         igfs.setName("igfs");
-        igfs.setDataCacheName("igfs-data");
-        igfs.setMetaCacheName("igfs-meta");
 
         igfs.setIpcEndpointConfiguration(new IgfsIpcEndpointConfiguration());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
index e665e84..1a8d576 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java
@@ -98,12 +98,6 @@ public class FileSystemConfiguration {
     /** IGFS instance name. */
     private String name;
 
-    /** Cache name to store IGFS meta information. */
-    private String metaCacheName;
-
-    /** Cache name to store file's data blocks. */
-    private String dataCacheName;
-
     /** File's data block size (bytes). */
     private int blockSize = DFLT_BLOCK_SIZE;
 
@@ -185,6 +179,12 @@ public class FileSystemConfiguration {
     /** Update file length on flush flag. */
     private boolean updateFileLenOnFlush = DFLT_UPDATE_FILE_LEN_ON_FLUSH;
 
+    /** Meta cache config. */
+    private CacheConfiguration metaCacheCfg;
+
+    /** Data cache config. */
+    private CacheConfiguration dataCacheCfg;
+
     /**
      * Constructs default configuration.
      */
@@ -206,7 +206,7 @@ public class FileSystemConfiguration {
         blockSize = cfg.getBlockSize();
         bufSize = cfg.getStreamBufferSize();
         colocateMeta = cfg.isColocateMetadata();
-        dataCacheName = cfg.getDataCacheName();
+        dataCacheCfg = cfg.getDataCacheConfiguration();
         dfltMode = cfg.getDefaultMode();
         dualModeMaxPendingPutsSize = cfg.getDualModeMaxPendingPutsSize();
         dualModePutExec = cfg.getDualModePutExecutorService();
@@ -222,7 +222,7 @@ public class FileSystemConfiguration {
         ipcEndpointEnabled = cfg.isIpcEndpointEnabled();
         maxSpace = cfg.getMaxSpaceSize();
         maxTaskRangeLen = cfg.getMaximumTaskRangeLength();
-        metaCacheName = cfg.getMetaCacheName();
+        metaCacheCfg = cfg.getMetaCacheConfiguration();
         mgmtPort = cfg.getManagementPort();
         name = cfg.getName();
         pathModes = cfg.getPathModes();
@@ -255,40 +255,55 @@ public class FileSystemConfiguration {
     }
 
     /**
-     * Cache name to store IGFS meta information. If {@code null}, then instance
-     * with default meta-cache name will be used.
+     * Cache config to store IGFS meta information.
      *
-     * @return Cache name to store IGFS meta information.
+     * @return Cache configuration object.
      */
-    @Nullable public String getMetaCacheName() {
-        return metaCacheName;
+    @Nullable public CacheConfiguration getMetaCacheConfiguration() {
+        return metaCacheCfg;
     }
 
     /**
-     * Sets cache name to store IGFS meta information.
+     * Cache config to store IGFS meta information. If {@code null}, then default config for
+     * meta-cache will be used.
+     *
+     * Default configuration for the meta cache is:
+     * <ul>
+     *     <li>atomicityMode = TRANSACTIONAL</li>
+     *     <li>cacheMode = PARTITIONED</li>
+     *     <li>backups = 1</li>
+     * </ul>
      *
-     * @param metaCacheName Cache name to store IGFS meta information.
+     * @param metaCacheCfg Cache configuration object.
      */
-    public void setMetaCacheName(String metaCacheName) {
-        this.metaCacheName = metaCacheName;
+    public void setMetaCacheConfiguration(CacheConfiguration metaCacheCfg) {
+        this.metaCacheCfg = metaCacheCfg;
     }
 
     /**
-     * Cache name to store IGFS data.
+     * Cache config to store IGFS data.
      *
-     * @return Cache name to store IGFS data.
+     * @return Cache configuration object.
      */
-    @Nullable public String getDataCacheName() {
-        return dataCacheName;
+    @Nullable public CacheConfiguration getDataCacheConfiguration() {
+        return dataCacheCfg;
     }
 
     /**
-     * Sets cache name to store IGFS data.
+     * Cache config to store IGFS data. If {@code null}, then default config for
+     * data cache will be used.
+     *
+     * Default configuration for the data cache is:
+     * <ul>
+     *     <<li>atomicityMode = TRANSACTIONAL</li>
+     *     <li>cacheMode = PARTITIONED</li>
+     *     <li>backups = 0</li>
+     * </ul>
      *
-     * @param dataCacheName Cache name to store IGFS data.
+     * @param dataCacheCfg Cache configuration object.
      */
-    public void setDataCacheName(String dataCacheName) {
-        this.dataCacheName = dataCacheName;
+    public void setDataCacheConfiguration(CacheConfiguration dataCacheCfg) {
+        this.dataCacheCfg = dataCacheCfg;
     }
 
     /**
@@ -878,11 +893,11 @@ public class FileSystemConfiguration {
      * transaction with keys owned only by a single node.
      * <p>
      * IGFS stores information about file system structure (metadata) inside a transactional cache configured through
-     * {@link #getMetaCacheName()} property. Metadata updates caused by operations on IGFS usually require several
-     * internal keys to be updated. As IGFS metadata cache usually operates in {@link CacheMode#REPLICATED} mode,
-     * meaning that all nodes have all metadata locally, it makes sense to give a hint to Ignite to co-locate
-     * ownership of all metadata keys on a single node. This will decrease amount of network trips required to update
-     * metadata and hence could improve performance.
+     * {@link #getMetaCacheConfiguration()} property. Metadata updates caused by operations on IGFS usually require
+     * several internal keys to be updated. As IGFS metadata cache usually operates
+     * in {@link CacheMode#REPLICATED} mode, meaning that all nodes have all metadata locally, it makes sense to give
+     * a hint to Ignite to co-locate ownership of all metadata keys on a single node.
+     * This will decrease amount of network trips required to update metadata and hence could improve performance.
      * <p>
      * This property should be disabled if you see excessive CPU and network load on a single node, which
      * degrades performance and cannot be explained by business logic of your application.

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 05d19c0..9fe2dba 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -2126,17 +2126,20 @@ public class IgnitionEx {
                         throw new IgniteCheckedException("Cache name cannot be \"" + CU.UTILITY_CACHE_NAME +
                             "\" because it is reserved for internal purposes.");
 
+                    if (IgfsUtils.matchIgfsCacheName(ccfg.getName()))
+                        throw new IgniteCheckedException(
+                            "Cache name cannot start with \""+ IgfsUtils.IGFS_CACHE_PREFIX
+                                + "\" because it is reserved for IGFS internal purposes.");
+
                     cacheCfgs.add(ccfg);
                 }
             }
 
             cfg.setCacheConfiguration(cacheCfgs.toArray(new CacheConfiguration[cacheCfgs.size()]));
 
-            // Iterate over IGFS caches and prepare their configurations if needed.
             assert cfg.getCacheConfiguration() != null;
 
-            for (CacheConfiguration ccfg : cfg.getCacheConfiguration())
-                IgfsUtils.prepareCacheConfiguration(cfg, ccfg);
+            IgfsUtils.prepareCacheConfigurations(cfg);
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 4507c53..285ba11 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -97,6 +97,7 @@ import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.processors.datastreamer.DataStreamerEntry;
 import org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl;
 import org.apache.ignite.internal.processors.dr.IgniteDrDataStreamerCacheUpdater;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilter;
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.transactions.IgniteTxHeuristicCheckedException;
@@ -338,7 +339,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         if (igfsCfgs != null) {
             for (FileSystemConfiguration igfsCfg : igfsCfgs) {
-                if (F.eq(ctx.name(), igfsCfg.getDataCacheName())) {
+                if (F.eq(ctx.name(), igfsCfg.getDataCacheConfiguration().getName())) {
                     if (!ctx.isNear()) {
                         igfsDataCache = true;
                         igfsDataCacheSize = new LongAdder8();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 17f9c2a..b1644d1 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -99,6 +99,7 @@ import org.apache.ignite.internal.processors.cache.transactions.IgniteTransactio
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager;
 import org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessor;
+import org.apache.ignite.internal.processors.igfs.IgfsUtils;
 import org.apache.ignite.internal.processors.plugin.CachePluginManager;
 import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
@@ -726,8 +727,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
         if (igfsCfgs != null) {
             for (FileSystemConfiguration igfsCfg : igfsCfgs) {
-                internalCaches.add(maskNull(igfsCfg.getMetaCacheName()));
-                internalCaches.add(maskNull(igfsCfg.getDataCacheName()));
+                internalCaches.add(maskNull(igfsCfg.getMetaCacheConfiguration().getName()));
+                internalCaches.add(maskNull(igfsCfg.getDataCacheConfiguration().getName()));
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
index d6297b9..dc845ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java
@@ -130,6 +130,9 @@ public class IgfsDataManager extends IgfsManager {
     /** Async file delete worker. */
     private AsyncDeleteWorker delWorker;
 
+    /** Async file delete worker. */
+    private String dataCacheName;
+
     /** On-going remote reads futures. */
     private final ConcurrentHashMap8<IgfsBlockKey, IgniteInternalFuture<byte[]>> rmtReadFuts =
         new ConcurrentHashMap8<>();
@@ -180,19 +183,21 @@ public class IgfsDataManager extends IgfsManager {
 
         delWorker = new AsyncDeleteWorker(igfsCtx.kernalContext().gridName(),
             "igfs-" + igfsName + "-delete-worker", log);
+
+        dataCacheName = igfsCtx.configuration().getDataCacheConfiguration().getName();
     }
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override protected void onKernalStart0() throws IgniteCheckedException {
-        dataCachePrj = igfsCtx.kernalContext().cache().getOrStartCache(igfsCtx.configuration().getDataCacheName());
+        dataCachePrj = igfsCtx.kernalContext().cache().getOrStartCache(dataCacheName);
 
         assert dataCachePrj != null;
 
         dataCache = (IgniteInternalCache)dataCachePrj;
 
         AffinityKeyMapper mapper = igfsCtx.kernalContext().cache()
-            .internalCache(igfsCtx.configuration().getDataCacheName()).configuration().getAffinityMapper();
+            .internalCache(dataCacheName).configuration().getAffinityMapper();
 
         grpSize = mapper instanceof IgfsGroupDataBlocksKeyMapper ?
             ((IgfsGroupDataBlocksKeyMapper)mapper).getGroupSize() : 1;
@@ -201,7 +206,7 @@ public class IgfsDataManager extends IgfsManager {
 
         assert grpBlockSize != 0;
 
-        igfsCtx.kernalContext().cache().internalCache(igfsCtx.configuration().getDataCacheName()).preloader()
+        igfsCtx.kernalContext().cache().internalCache(dataCacheName).preloader()
             .startFuture().listen(new CI1<IgniteInternalFuture<Object>>() {
             @Override public void apply(IgniteInternalFuture<Object> f) {
                 dataCacheStartLatch.countDown();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 56da121..7165f31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -263,7 +263,7 @@ public final class IgfsImpl implements IgfsEx {
         secondaryPaths = new IgfsPaths(secondaryFsPayload, dfltMode, modeRslvr.modesOrdered());
 
         // Check whether IGFS LRU eviction policy is set on data cache.
-        String dataCacheName = igfsCtx.configuration().getDataCacheName();
+        String dataCacheName = igfsCtx.configuration().getDataCacheConfiguration().getName();
 
         for (CacheConfiguration cacheCfg : igfsCtx.kernalContext().config().getCacheConfiguration()) {
             if (F.eq(dataCacheName, cacheCfg.getName())) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index 95d73a8..35d0776 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -155,6 +155,9 @@ public class IgfsMetaManager extends IgfsManager {
     /** Compute facade for client tasks. */
     private IgniteCompute cliCompute;
 
+    /** Compute facade for client tasks. */
+    private String metaCacheName;
+
     /**
      * Constructor.
      *
@@ -189,16 +192,18 @@ public class IgfsMetaManager extends IgfsManager {
         sampling = new IgfsSamplingKey(cfg.getName());
 
         log = igfsCtx.kernalContext().log(IgfsMetaManager.class);
+
+        metaCacheName = cfg.getMetaCacheConfiguration().getName();
     }
 
     /** {@inheritDoc} */
     @SuppressWarnings("RedundantCast")
     @Override protected void onKernalStart0() throws IgniteCheckedException {
-        metaCache = igfsCtx.kernalContext().cache().getOrStartCache(cfg.getMetaCacheName());
+        metaCache = igfsCtx.kernalContext().cache().getOrStartCache(metaCacheName);
 
         assert metaCache != null;
 
-        igfsCtx.kernalContext().cache().internalCache(cfg.getMetaCacheName()).preloader().startFuture()
+        igfsCtx.kernalContext().cache().internalCache(metaCacheName).preloader().startFuture()
             .listen(new CI1<IgniteInternalFuture<Object>>() {
                 @Override public void apply(IgniteInternalFuture<Object> f) {
                     metaCacheStartLatch.countDown();
@@ -267,7 +272,7 @@ public class IgfsMetaManager extends IgfsManager {
     <T> T runClientTask(IgniteUuid affinityFileId, IgfsClientAbstractCallable<T> task) {
         try {
             return (cfg.isColocateMetadata()) ?
-                clientCompute().affinityCall(cfg.getMetaCacheName(), affinityFileId, task) :
+                clientCompute().affinityCall(metaCacheName, affinityFileId, task) :
                 clientCompute().call(task);
         }
         catch (ClusterTopologyException e) {
@@ -288,7 +293,7 @@ public class IgfsMetaManager extends IgfsManager {
         if (cliCompute0 == null) {
             IgniteEx ignite = igfsCtx.kernalContext().grid();
 
-            ClusterGroup cluster = ignite.cluster().forIgfsMetadataDataNodes(cfg.getName(), cfg.getMetaCacheName());
+            ClusterGroup cluster = ignite.cluster().forIgfsMetadataDataNodes(cfg.getName(), metaCacheName);
 
             cliCompute0 = ignite.compute(cluster);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
index 57bf70f..405016c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsProcessor.java
@@ -26,14 +26,11 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
-import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
-import org.apache.ignite.igfs.IgfsMode;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.igfs.mapreduce.IgfsJob;
 import org.apache.ignite.igfs.mapreduce.IgfsRecordResolver;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.IgniteNodeAttributes;
-import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.util.ipc.IpcServerEndpoint;
 import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.F;
@@ -46,7 +43,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Map;
@@ -55,8 +51,6 @@ import java.util.concurrent.ConcurrentMap;
 
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK;
 import static org.apache.ignite.IgniteSystemProperties.getBoolean;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.igfs.IgfsMode.PROXY;
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGFS;
 
 /**
@@ -66,12 +60,6 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
     /** Null IGFS name. */
     private static final String NULL_NAME = UUID.randomUUID().toString();
 
-    /** Min available TCP port. */
-    private static final int MIN_TCP_PORT = 1;
-
-    /** Max available TCP port. */
-    private static final int MAX_TCP_PORT = 0xFFFF;
-
     /** Converts context to IGFS. */
     private static final IgniteClosure<IgfsContext,IgniteFileSystem> CTX_TO_IGFS = new C1<IgfsContext, IgniteFileSystem>() {
         @Override public IgniteFileSystem apply(IgfsContext igfsCtx) {
@@ -101,8 +89,6 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
 
         assert cfgs != null && cfgs.length > 0;
 
-        validateLocalIgfsConfigurations(cfgs);
-
         // Start IGFS instances.
         for (FileSystemConfiguration cfg : cfgs) {
             FileSystemConfiguration cfg0 = new FileSystemConfiguration(cfg);
@@ -111,9 +97,11 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
 
             CacheConfiguration[] cacheCfgs = igniteCfg.getCacheConfiguration();
 
+            String metaCacheName = cfg.getMetaCacheConfiguration().getName();
+
             if (cacheCfgs != null) {
                 for (CacheConfiguration cacheCfg : cacheCfgs) {
-                    if (F.eq(cacheCfg.getName(), cfg.getMetaCacheName())) {
+                    if (F.eq(cacheCfg.getName(), metaCacheName)) {
                         metaClient = false;
 
                         break;
@@ -162,7 +150,9 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
         assert igniteCfg.getFileSystemConfiguration() != null;
 
         for (FileSystemConfiguration igfsCfg : igniteCfg.getFileSystemConfiguration()) {
-            CacheConfiguration cacheCfg = cacheCfgs.get(igfsCfg.getDataCacheName());
+            String dataCacheName = igfsCfg.getDataCacheConfiguration().getName();
+
+            CacheConfiguration cacheCfg = cacheCfgs.get(dataCacheName);
 
             if (cacheCfg == null)
                 continue; // No cache for the given IGFS configuration.
@@ -178,8 +168,8 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
                 igfsCfg.getName(),
                 igfsCfg.getBlockSize(),
                 ((IgfsGroupDataBlocksKeyMapper)affMapper).getGroupSize(),
-                igfsCfg.getMetaCacheName(),
-                igfsCfg.getDataCacheName(),
+                igfsCfg.getMetaCacheConfiguration().getName(),
+                dataCacheName,
                 igfsCfg.getDefaultMode(),
                 igfsCfg.getPathModes(),
                 igfsCfg.isFragmentizerEnabled()));
@@ -288,110 +278,6 @@ public class IgfsProcessor extends IgfsProcessorAdapter {
     }
 
     /**
-     * Validates local IGFS configurations. Compares attributes only for IGFSes with same name.
-     * @param cfgs IGFS configurations
-     * @throws IgniteCheckedException If any of IGFS configurations is invalid.
-     */
-    private void validateLocalIgfsConfigurations(FileSystemConfiguration[] cfgs) throws IgniteCheckedException {
-        Collection<String> cfgNames = new HashSet<>();
-
-        Collection<String> dataCacheNames = new HashSet<>();
-        Collection<String> metaCacheNames = new HashSet<>();
-
-        for (FileSystemConfiguration cfg : cfgs) {
-            String name = cfg.getName();
-
-            if (cfgNames.contains(name))
-                throw new IgniteCheckedException("Duplicate IGFS name found (check configuration and " +
-                    "assign unique name to each): " + name);
-
-            CacheConfiguration dataCacheCfg = config(cfg.getDataCacheName());
-            CacheConfiguration metaCacheCfg = config(cfg.getMetaCacheName());
-
-            if (dataCacheCfg == null)
-                throw new IgniteCheckedException("Data cache is not configured locally for IGFS: " + cfg);
-
-            if (GridQueryProcessor.isEnabled(dataCacheCfg))
-                throw new IgniteCheckedException("IGFS data cache cannot start with enabled query indexing.");
-
-            if (dataCacheCfg.getAtomicityMode() != TRANSACTIONAL && cfg.isFragmentizerEnabled())
-                throw new IgniteCheckedException("Data cache should be transactional: " + cfg.getDataCacheName() +
-                    " when fragmentizer is enabled");
-
-            if (metaCacheCfg == null)
-                throw new IgniteCheckedException("Metadata cache is not configured locally for IGFS: " + cfg);
-
-            if (GridQueryProcessor.isEnabled(metaCacheCfg))
-                throw new IgniteCheckedException("IGFS metadata cache cannot start with enabled query indexing.");
-
-            if (metaCacheCfg.getAtomicityMode() != TRANSACTIONAL)
-                throw new IgniteCheckedException("Meta cache should be transactional: " + cfg.getMetaCacheName());
-
-            if (F.eq(cfg.getDataCacheName(), cfg.getMetaCacheName()))
-                throw new IgniteCheckedException("Cannot use same cache as both data and meta cache: " + cfg.getName());
-
-            if (dataCacheNames.contains(cfg.getDataCacheName()))
-                throw new IgniteCheckedException("Data cache names should be different for different IGFS instances: "
-                    + cfg.getName());
-
-            if (metaCacheNames.contains(cfg.getMetaCacheName()))
-                throw new IgniteCheckedException("Meta cache names should be different for different IGFS instances: "
-                    + cfg.getName());
-
-            if (!(dataCacheCfg.getAffinityMapper() instanceof IgfsGroupDataBlocksKeyMapper))
-                throw new IgniteCheckedException("Invalid IGFS data cache configuration (key affinity mapper class should be " +
-                    IgfsGroupDataBlocksKeyMapper.class.getSimpleName() + "): " + cfg);
-
-            IgfsIpcEndpointConfiguration ipcCfg = cfg.getIpcEndpointConfiguration();
-
-            if (ipcCfg != null) {
-                final int tcpPort = ipcCfg.getPort();
-
-                if (!(tcpPort >= MIN_TCP_PORT && tcpPort <= MAX_TCP_PORT))
-                    throw new IgniteCheckedException("IGFS endpoint TCP port is out of range [" + MIN_TCP_PORT +
-                        ".." + MAX_TCP_PORT + "]: " + tcpPort);
-
-                if (ipcCfg.getThreadCount() <= 0)
-                    throw new IgniteCheckedException("IGFS endpoint thread count must be positive: " +
-                        ipcCfg.getThreadCount());
-            }
-
-            boolean secondary = cfg.getDefaultMode() == PROXY;
-
-            if (cfg.getPathModes() != null) {
-                for (Map.Entry<String, IgfsMode> mode : cfg.getPathModes().entrySet()) {
-                    if (mode.getValue() == PROXY)
-                        secondary = true;
-                }
-            }
-
-            if (secondary) {
-                // When working in any mode except of primary, secondary FS config must be provided.
-                assertParameter(cfg.getSecondaryFileSystem() != null,
-                    "secondaryFileSystem cannot be null when mode is not " + IgfsMode.PRIMARY);
-            }
-
-            dataCacheNames.add(cfg.getDataCacheName());
-            metaCacheNames.add(cfg.getMetaCacheName());
-
-            cfgNames.add(name);
-        }
-    }
-
-    /**
-     * @param cacheName Cache name.
-     * @return Configuration.
-     */
-    private CacheConfiguration config(String cacheName) {
-        for (CacheConfiguration ccfg : ctx.config().getCacheConfiguration()) {
-            if (F.eq(cacheName, ccfg.getName()))
-                return ccfg;
-        }
-
-        return null;
-    }
-
-    /**
      * Check IGFS config on remote node.
      *
      * @param rmtNode Remote node.

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
index 6763d2a..ec12884 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsUtils.java
@@ -17,11 +17,16 @@
 
 package org.apache.ignite.internal.processors.igfs;
 
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.binary.BinaryRawReader;
 import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.cache.CacheAtomicWriteOrderMode;
+import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.CacheWriteSynchronizationMode;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.cluster.ClusterTopologyException;
@@ -31,6 +36,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.events.IgfsEvent;
 import org.apache.ignite.igfs.IgfsException;
 import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper;
+import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration;
 import org.apache.ignite.igfs.IgfsMode;
 import org.apache.ignite.igfs.IgfsPath;
 import org.apache.ignite.internal.GridKernalContext;
@@ -38,6 +44,7 @@ import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
 import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
+import org.apache.ignite.internal.processors.query.GridQueryProcessor;
 import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.future.IgniteFutureImpl;
 import org.apache.ignite.internal.util.lang.IgniteOutClosureX;
@@ -65,6 +72,8 @@ import java.util.UUID;
 import java.util.concurrent.ThreadLocalRandom;
 
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_CACHE_RETRIES_COUNT;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 import static org.apache.ignite.igfs.IgfsMode.DUAL_ASYNC;
 import static org.apache.ignite.igfs.IgfsMode.DUAL_SYNC;
 import static org.apache.ignite.igfs.IgfsMode.PRIMARY;
@@ -127,9 +136,27 @@ public class IgfsUtils {
     /** Flag: this is a file. */
     private static final byte FLAG_FILE = 0x2;
 
+    /** Filesystem cache prefix. */
+    public static final String IGFS_CACHE_PREFIX = "igfs-internal-";
+
+    /** Data cache suffix. */
+    public static final String DATA_CACHE_SUFFIX = "-data";
+
+    /** Meta cache suffix. */
+    public static final String META_CACHE_SUFFIX = "-meta";
+
     /** Maximum string length to be written at once. */
     private static final int MAX_STR_LEN = 0xFFFF / 4;
 
+    /** Min available TCP port. */
+    private static final int MIN_TCP_PORT = 1;
+
+    /** Max available TCP port. */
+    private static final int MAX_TCP_PORT = 0xFFFF;
+
+    /*
+     * Static initializer.
+     */
     static {
         TRASH_IDS = new IgniteUuid[TRASH_CONCURRENCY];
 
@@ -311,6 +338,7 @@ public class IgfsUtils {
     /**
      * Sends a series of event.
      *
+     * @param kernalCtx Kernal context.
      * @param path The path of the created file.
      * @param type The type of event to send.
      */
@@ -321,6 +349,7 @@ public class IgfsUtils {
     /**
      * Sends a series of event.
      *
+     * @param kernalCtx Kernal context.
      * @param path The path of the created file.
      * @param newPath New path.
      * @param type The type of event to send.
@@ -342,70 +371,189 @@ public class IgfsUtils {
     }
 
     /**
+     * @param cacheName Cache name.
+     * @return {@code True} in this is IGFS data or meta cache.
+     */
+    public static boolean matchIgfsCacheName(@Nullable String cacheName) {
+        return cacheName != null && cacheName.startsWith(IGFS_CACHE_PREFIX);
+    }
+
+    /**
      * @param cfg Grid configuration.
      * @param cacheName Cache name.
      * @return {@code True} in this is IGFS data or meta cache.
      */
     public static boolean isIgfsCache(IgniteConfiguration cfg, @Nullable String cacheName) {
+        return matchIgfsCacheName(cacheName);
+    }
+
+    /**
+     * Prepare cache configuration if this is IGFS meta or data cache.
+     *
+     * @param cfg Configuration.
+     * @throws IgniteCheckedException If failed.
+     */
+    public static void prepareCacheConfigurations(IgniteConfiguration cfg) throws IgniteCheckedException {
         FileSystemConfiguration[] igfsCfgs = cfg.getFileSystemConfiguration();
+        List<CacheConfiguration> ccfgs = new ArrayList<>(Arrays.asList(cfg.getCacheConfiguration()));
 
         if (igfsCfgs != null) {
             for (FileSystemConfiguration igfsCfg : igfsCfgs) {
-                // IGFS config probably has not been validated yet => possible NPE, so we check for null.
-                if (igfsCfg != null) {
-                    if (F.eq(cacheName, igfsCfg.getDataCacheName()) || F.eq(cacheName, igfsCfg.getMetaCacheName()))
-                        return true;
+                if (igfsCfg == null)
+                    continue;
+
+                CacheConfiguration ccfgMeta = igfsCfg.getMetaCacheConfiguration();
+
+                if (ccfgMeta == null) {
+                    ccfgMeta = defaultMetaCacheConfig();
+
+                    igfsCfg.setMetaCacheConfiguration(ccfgMeta);
+                }
+
+                ccfgMeta.setName(IGFS_CACHE_PREFIX + igfsCfg.getName() + META_CACHE_SUFFIX);
+
+                ccfgs.add(ccfgMeta);
+
+                CacheConfiguration ccfgData = igfsCfg.getDataCacheConfiguration();
+
+                if (ccfgData == null) {
+                    ccfgData = defaultDataCacheConfig();
+
+                    igfsCfg.setDataCacheConfiguration(ccfgData);
                 }
+
+                ccfgData.setName(IGFS_CACHE_PREFIX + igfsCfg.getName() + DATA_CACHE_SUFFIX);
+
+                ccfgs.add(ccfgData);
+
+
+                // No copy-on-read.
+                ccfgMeta.setCopyOnRead(false);
+                ccfgData.setCopyOnRead(false);
+
+                // Always full-sync to maintain consistency.
+                ccfgMeta.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+                ccfgData.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+
+                // Set co-located affinity mapper if needed.
+                if (igfsCfg.isColocateMetadata() && ccfgMeta.getAffinityMapper() == null)
+                    ccfgMeta.setAffinityMapper(new IgfsColocatedMetadataAffinityKeyMapper());
+
+                // Set affinity mapper if needed.
+                if (ccfgData.getAffinityMapper() == null)
+                    ccfgData.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper());
             }
+
+            cfg.setCacheConfiguration(ccfgs.toArray(new CacheConfiguration[ccfgs.size()]));
         }
 
-        return false;
+        validateLocalIgfsConfigurations(cfg);
     }
 
     /**
-     * Prepare cache configuration if this is IGFS meta or data cache.
+     * Validates local IGFS configurations. Compares attributes only for IGFSes with same name.
      *
-     * @param cfg Configuration.
-     * @param ccfg Cache configuration.
+     * @param igniteCfg Ignite config.
+     * @throws IgniteCheckedException If any of IGFS configurations is invalid.
      */
-    public static void prepareCacheConfiguration(IgniteConfiguration cfg, CacheConfiguration ccfg) {
-        FileSystemConfiguration[] igfsCfgs = cfg.getFileSystemConfiguration();
+    private static void validateLocalIgfsConfigurations(IgniteConfiguration igniteCfg)
+        throws IgniteCheckedException {
 
-        if (igfsCfgs != null) {
-            for (FileSystemConfiguration igfsCfg : igfsCfgs) {
-                if (igfsCfg != null) {
-                    if (F.eq(ccfg.getName(), igfsCfg.getMetaCacheName())) {
-                        // No copy-on-read.
-                        ccfg.setCopyOnRead(false);
+        if (igniteCfg.getFileSystemConfiguration() == null || igniteCfg.getFileSystemConfiguration().length == 0)
+            return;
+
+        Collection<String> cfgNames = new HashSet<>();
 
-                        // Always full-sync to maintain consistency.
-                        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        for (FileSystemConfiguration cfg : igniteCfg.getFileSystemConfiguration()) {
+            String name = cfg.getName();
 
-                        // Set co-located affinity mapper if needed.
-                        if (igfsCfg.isColocateMetadata() && ccfg.getAffinityMapper() == null)
-                            ccfg.setAffinityMapper(new IgfsColocatedMetadataAffinityKeyMapper());
+            if (cfgNames.contains(name))
+                throw new IgniteCheckedException("Duplicate IGFS name found (check configuration and " +
+                    "assign unique name to each): " + name);
 
-                        return;
-                    }
+            CacheConfiguration ccfgData = cfg.getDataCacheConfiguration();
 
-                    if (F.eq(ccfg.getName(), igfsCfg.getDataCacheName())) {
-                        // No copy-on-read.
-                        ccfg.setCopyOnRead(false);
+            CacheConfiguration ccfgMeta = cfg.getMetaCacheConfiguration();
 
-                        // Always full-sync to maintain consistency.
-                        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+            if (GridQueryProcessor.isEnabled(ccfgData))
+                throw new IgniteCheckedException("IGFS data cache cannot start with enabled query indexing.");
 
-                        // Set affinity mapper if needed.
-                        if (ccfg.getAffinityMapper() == null)
-                            ccfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper());
+            if (GridQueryProcessor.isEnabled(ccfgMeta))
+                throw new IgniteCheckedException("IGFS metadata cache cannot start with enabled query indexing.");
 
-                        return;
-                    }
+            if (ccfgMeta.getAtomicityMode() != TRANSACTIONAL)
+                throw new IgniteCheckedException("IGFS metadata cache should be transactional: " + cfg.getName());
+
+            if (!(ccfgData.getAffinityMapper() instanceof IgfsGroupDataBlocksKeyMapper))
+                throw new IgniteCheckedException(
+                    "Invalid IGFS data cache configuration (key affinity mapper class should be " +
+                    IgfsGroupDataBlocksKeyMapper.class.getSimpleName() + "): " + cfg);
+
+            IgfsIpcEndpointConfiguration ipcCfg = cfg.getIpcEndpointConfiguration();
+
+            if (ipcCfg != null) {
+                final int tcpPort = ipcCfg.getPort();
+
+                if (!(tcpPort >= MIN_TCP_PORT && tcpPort <= MAX_TCP_PORT))
+                    throw new IgniteCheckedException("IGFS endpoint TCP port is out of range [" + MIN_TCP_PORT +
+                        ".." + MAX_TCP_PORT + "]: " + tcpPort);
+
+                if (ipcCfg.getThreadCount() <= 0)
+                    throw new IgniteCheckedException("IGFS endpoint thread count must be positive: " +
+                        ipcCfg.getThreadCount());
+            }
+
+            boolean secondary = cfg.getDefaultMode() == IgfsMode.PROXY;
+
+            if (cfg.getPathModes() != null) {
+                for (Map.Entry<String, IgfsMode> mode : cfg.getPathModes().entrySet()) {
+                    if (mode.getValue() == IgfsMode.PROXY)
+                        secondary = true;
                 }
             }
+
+            if (secondary && cfg.getSecondaryFileSystem() == null) {
+                // When working in any mode except of primary, secondary FS config must be provided.
+                throw new IgniteCheckedException("Grid configuration parameter invalid: " +
+                    "secondaryFileSystem cannot be null when mode is not " + IgfsMode.PRIMARY);
+            }
+
+            cfgNames.add(name);
         }
     }
 
+
+    /**
+     * @return Default IGFS cache configuration.
+     */
+    private static CacheConfiguration defaultCacheConfig() {
+        CacheConfiguration cfg = new CacheConfiguration();
+        cfg.setAtomicWriteOrderMode(CacheAtomicWriteOrderMode.PRIMARY);
+        cfg.setAtomicityMode(TRANSACTIONAL);
+        cfg.setWriteSynchronizationMode(FULL_SYNC);
+        cfg.setCacheMode(CacheMode.PARTITIONED);
+
+        return cfg;
+    }
+
+    /**
+     * @return Default IGFS meta cache configuration.
+     */
+    private static CacheConfiguration defaultMetaCacheConfig() {
+        CacheConfiguration cfg = defaultCacheConfig();
+
+        cfg.setBackups(1);
+
+        return cfg;
+    }
+
+    /**
+     * @return Default IGFS data cache configuration.
+     */
+    private static CacheConfiguration defaultDataCacheConfig() {
+        return defaultCacheConfig();
+    }
+
     /**
      * Create empty directory with the given ID.
      *
@@ -532,6 +680,7 @@ public class IgfsUtils {
      *
      * @param in Reader.
      * @return Entry.
+     * @throws IOException If failed.
      */
     @Nullable public static IgfsListingEntry readListingEntry(DataInput in) throws IOException {
         if (in.readBoolean()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
index cb10c1c..7f8e3b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
@@ -130,8 +130,8 @@ public class VisorIgfsConfiguration implements Serializable, LessNamingBean {
         VisorIgfsConfiguration cfg = new VisorIgfsConfiguration();
 
         cfg.name = igfs.getName();
-        cfg.metaCacheName = igfs.getMetaCacheName();
-        cfg.dataCacheName = igfs.getDataCacheName();
+        cfg.metaCacheName = igfs.getMetaCacheConfiguration().getName();
+        cfg.dataCacheName = igfs.getDataCacheConfiguration().getName();
         cfg.blockSize = igfs.getBlockSize();
         cfg.prefetchBlocks = igfs.getPrefetchBlocks();
         cfg.streamBufSize = igfs.getStreamBufferSize();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
index abe1364..48487ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
@@ -188,7 +188,8 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
                 if (proxyCache(cacheName))
                     continue;
 
-                if (arg.systemCaches() || !(isSystemCache(cacheName) || isIgfsCache(cfg, cacheName))) {
+                if (arg.systemCaches() ||
+                    !(isSystemCache(cacheName) || isIgfsCache(ignite.configuration(), cacheName))) {
                     long start0 = U.currentTimeMillis();
 
                     try {
@@ -227,7 +228,8 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
 
                 FileSystemConfiguration igfsCfg = igfs.configuration();
 
-                if (proxyCache(igfsCfg.getDataCacheName()) || proxyCache(igfsCfg.getMetaCacheName()))
+                if (proxyCache(igfsCfg.getDataCacheConfiguration().getName())
+                    || proxyCache(igfsCfg.getMetaCacheConfiguration().getName()))
                     continue;
 
                 try {

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/config/igfs-loopback.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/igfs-loopback.xml b/modules/core/src/test/config/igfs-loopback.xml
index dbbfb4e..5bfbdae 100644
--- a/modules/core/src/test/config/igfs-loopback.xml
+++ b/modules/core/src/test/config/igfs-loopback.xml
@@ -75,8 +75,6 @@
             <list>
                 <bean class="org.apache.ignite.configuration.FileSystemConfiguration">
                     <property name="name" value="igfs"/>
-                    <property name="metaCacheName" value="igfs-meta"/>
-                    <property name="dataCacheName" value="igfs-data"/>
 
                     <!-- Must correlate with cache affinity mapper. -->
                     <property name="blockSize" value="#{128 * 1024}"/>
@@ -97,31 +95,6 @@
             </list>
         </property>
 
-        <property name="cacheConfiguration">
-            <list>
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="igfs-data"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-                    <property name="backups" value="0"/>
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <!-- Haw many blocks in row will be stored on the same node. -->
-                            <constructor-arg value="512"/>
-                        </bean>
-                    </property>
-                </bean>
-
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="igfs-meta"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-                </bean>
-            </list>
-        </property>
-
         <!--
             Disable events.
         -->

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/config/igfs-shmem.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/igfs-shmem.xml b/modules/core/src/test/config/igfs-shmem.xml
index c4c8704..5876b41 100644
--- a/modules/core/src/test/config/igfs-shmem.xml
+++ b/modules/core/src/test/config/igfs-shmem.xml
@@ -75,8 +75,6 @@
             <list>
                 <bean class="org.apache.ignite.configuration.FileSystemConfiguration">
                     <property name="name" value="igfs"/>
-                    <property name="metaCacheName" value="igfs-meta"/>
-                    <property name="dataCacheName" value="igfs-data"/>
 
                     <!-- Must correlate with cache affinity mapper. -->
                     <property name="blockSize" value="#{128 * 1024}"/>
@@ -97,31 +95,6 @@
             </list>
         </property>
 
-        <property name="cacheConfiguration">
-            <list>
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="igfs-data"/>
-                    <property name="cacheMode" value="PARTITIONED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-                    <property name="backups" value="0"/>
-                    <property name="affinityMapper">
-                        <bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">
-                            <!-- Haw many blocks in row will be stored on the same node. -->
-                            <constructor-arg value="512"/>
-                        </bean>
-                    </property>
-                </bean>
-
-                <bean class="org.apache.ignite.configuration.CacheConfiguration">
-                    <property name="name" value="igfs-meta"/>
-                    <property name="cacheMode" value="REPLICATED"/>
-                    <property name="atomicityMode" value="TRANSACTIONAL"/>
-                    <property name="writeSynchronizationMode" value="FULL_SYNC"/>
-                </bean>
-            </list>
-        </property>
-
         <!--
             Disable events.
         -->

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java
index 9c2c6e5..ea2be11 100644
--- a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java
@@ -71,46 +71,33 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest
     private IgnitePredicate<Event> lsnr;
 
     /**
-     * Gets cache configuration.
-     *
-     * @param gridName Grid name.
-     * @return Cache configuration.
+     * @return IGFS configuration for this test.
      */
-    @SuppressWarnings("deprecation")
-    protected CacheConfiguration[] getCacheConfiguration(String gridName) {
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setName("dataCache");
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setNearConfiguration(null);
-        cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
-        cacheCfg.setEvictionPolicy(null);
-        cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
-        cacheCfg.setBackups(0);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
+    protected FileSystemConfiguration getIgfsConfiguration() throws IgniteCheckedException {
+        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
+
+        igfsCfg.setName("igfs");
+        igfsCfg.setBlockSize(512 * 1024); // Together with group blocks mapper will yield 64M per node groups.
+
+        CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
+
+        dataCacheCfg.setCacheMode(PARTITIONED);
+        dataCacheCfg.setNearConfiguration(null);
+        dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+        dataCacheCfg.setEvictionPolicy(null);
+        dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
+        dataCacheCfg.setBackups(0);
+        dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
         metaCacheCfg.setEvictionPolicy(null);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
-        return new CacheConfiguration[] {cacheCfg, metaCacheCfg};
-    }
-
-    /**
-     * @return IGFS configuration for this test.
-     */
-    protected FileSystemConfiguration getIgfsConfiguration() throws IgniteCheckedException {
-        FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
-
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
-        igfsCfg.setName("igfs");
-
-        igfsCfg.setBlockSize(512 * 1024); // Together with group blocks mapper will yield 64M per node groups.
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
 
         return igfsCfg;
     }
@@ -139,8 +126,6 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest
 
         cfg.setFileSystemConfiguration(igfsCfg);
 
-        cfg.setCacheConfiguration(getCacheConfiguration(gridName));
-
         cfg.setHadoopConfiguration(null);
 
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java
index d52a918..6536267 100644
--- a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java
@@ -51,12 +51,6 @@ public class IgfsFragmentizerAbstractSelfTest extends IgfsCommonAbstractTest {
     /** IGFS group size. */
     protected static final int IGFS_GROUP_SIZE = 32;
 
-    /** Metadata cache name. */
-    private static final String META_CACHE_NAME = "meta";
-
-    /** File data cache name. */
-    protected static final String DATA_CACHE_NAME = "data";
-
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -67,13 +61,9 @@ public class IgfsFragmentizerAbstractSelfTest extends IgfsCommonAbstractTest {
 
         cfg.setDiscoverySpi(discoSpi);
 
-        cfg.setCacheConfiguration(metaConfiguration(), dataConfiguration());
-
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
         igfsCfg.setName("igfs");
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
         igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
 
         // Need to set this to avoid thread starvation.
@@ -82,6 +72,9 @@ public class IgfsFragmentizerAbstractSelfTest extends IgfsCommonAbstractTest {
         igfsCfg.setFragmentizerThrottlingBlockLength(16 * IGFS_BLOCK_SIZE);
         igfsCfg.setFragmentizerThrottlingDelay(10);
 
+        igfsCfg.setMetaCacheConfiguration(metaConfiguration());
+        igfsCfg.setDataCacheConfiguration(dataConfiguration());
+
         cfg.setFileSystemConfiguration(igfsCfg);
 
         return cfg;
@@ -95,8 +88,6 @@ public class IgfsFragmentizerAbstractSelfTest extends IgfsCommonAbstractTest {
     protected CacheConfiguration metaConfiguration() {
         CacheConfiguration cfg = defaultCacheConfiguration();
 
-        cfg.setName(META_CACHE_NAME);
-
         cfg.setCacheMode(REPLICATED);
         cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         cfg.setAtomicityMode(TRANSACTIONAL);
@@ -112,8 +103,6 @@ public class IgfsFragmentizerAbstractSelfTest extends IgfsCommonAbstractTest {
     protected CacheConfiguration dataConfiguration() {
         CacheConfiguration cfg = defaultCacheConfiguration();
 
-        cfg.setName(DATA_CACHE_NAME);
-
         cfg.setCacheMode(PARTITIONED);
         cfg.setBackups(0);
         cfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(IGFS_GROUP_SIZE));

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java
index 4e0f12b..5149493 100644
--- a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java
@@ -244,7 +244,8 @@ public class IgfsFragmentizerSelfTest extends IgfsFragmentizerAbstractSelfTest {
                 for (int i = 0; i < NODE_CNT; i++) {
                     IgniteEx g = grid(i);
 
-                    GridCacheAdapter<Object, Object> cache = ((IgniteKernal)g).internalCache(DATA_CACHE_NAME);
+                    GridCacheAdapter<Object, Object> cache = ((IgniteKernal)g).internalCache(
+                        g.igfsx("igfs").configuration().getDataCacheConfiguration().getName());
 
                     assertTrue("Data cache is not empty [keys=" + cache.keySet() +
                         ", node=" + g.localNode().id() + ']', cache.isEmpty());

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractBaseSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractBaseSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractBaseSelfTest.java
index 374d3d3..90ac4b1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractBaseSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractBaseSelfTest.java
@@ -375,8 +375,6 @@ public abstract class IgfsAbstractBaseSelfTest extends IgfsCommonAbstractTest {
         TcpDiscoveryIpFinder ipFinder) throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(igfsName);
         igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
         igfsCfg.setDefaultMode(mode);
@@ -391,7 +389,6 @@ public abstract class IgfsAbstractBaseSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setNearConfiguration(null);
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setNearConfiguration(null);
@@ -404,12 +401,16 @@ public abstract class IgfsAbstractBaseSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setNearConfiguration(null);
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        prepareCacheConfigurations(dataCacheCfg, metaCacheCfg);
+
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         if (useOptimizedMarshaller())
@@ -421,10 +422,7 @@ public abstract class IgfsAbstractBaseSelfTest extends IgfsCommonAbstractTest {
 
         discoSpi.setIpFinder(ipFinder);
 
-        prepareCacheConfigurations(dataCacheCfg, metaCacheCfg);
-
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");
@@ -545,6 +543,7 @@ public abstract class IgfsAbstractBaseSelfTest extends IgfsCommonAbstractTest {
     /**
      * Create the file in the given IGFS and write provided data chunks to it.
      *
+     * @param uni FS tests adaptor.
      * @param file File.
      * @param chunks Data chunks.
      * @throws IOException In case of IO exception.
@@ -942,7 +941,7 @@ public abstract class IgfsAbstractBaseSelfTest extends IgfsCommonAbstractTest {
      * @return The data cache.
      */
     protected static GridCacheAdapter<IgfsBlockKey, byte[]> getDataCache(IgniteFileSystem igfs) {
-        String dataCacheName = igfs.configuration().getDataCacheName();
+        String dataCacheName = igfs.configuration().getDataCacheConfiguration().getName();
 
         IgniteEx igniteEx = ((IgfsEx)igfs).context().kernalContext().grid();
 
@@ -956,7 +955,7 @@ public abstract class IgfsAbstractBaseSelfTest extends IgfsCommonAbstractTest {
      * @return The data cache.
      */
     protected static GridCacheAdapter<IgniteUuid, IgfsEntryInfo> getMetaCache(IgniteFileSystem igfs) {
-        String dataCacheName = igfs.configuration().getMetaCacheName();
+        String dataCacheName = igfs.configuration().getMetaCacheConfiguration().getName();
 
         IgniteEx igniteEx = ((IgfsEx)igfs).context().kernalContext().grid();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBackupFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBackupFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBackupFailoverSelfTest.java
index 187aeeb..51b9ace 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBackupFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBackupFailoverSelfTest.java
@@ -133,8 +133,6 @@ public class IgfsBackupFailoverSelfTest extends IgfsCommonAbstractTest {
         throws Exception {
         final FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName("igfs");
         igfsCfg.setBlockSize(igfsBlockSize);
         igfsCfg.setDefaultMode(mode);
@@ -142,7 +140,6 @@ public class IgfsBackupFailoverSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration<?,?> dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(affGrpSize));
@@ -151,11 +148,13 @@ public class IgfsBackupFailoverSelfTest extends IgfsCommonAbstractTest {
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName(gridName);

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBlockMessageSystemPoolStarvationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBlockMessageSystemPoolStarvationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBlockMessageSystemPoolStarvationSelfTest.java
index 57c709b..fba78c8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBlockMessageSystemPoolStarvationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsBlockMessageSystemPoolStarvationSelfTest.java
@@ -57,12 +57,6 @@ public class IgfsBlockMessageSystemPoolStarvationSelfTest extends IgfsCommonAbst
     /** Second node name. */
     private static final String NODE_2_NAME = "node2";
 
-    /** Data cache name. */
-    private static final String DATA_CACHE_NAME = "data";
-
-    /** Meta cache name. */
-    private static final String META_CACHE_NAME = "meta";
-
     /** Key in data caceh we will use to reproduce the issue. */
     private static final Integer DATA_KEY = 1;
 
@@ -212,13 +206,15 @@ public class IgfsBlockMessageSystemPoolStarvationSelfTest extends IgfsCommonAbst
      * @throws Exception If failed.
      */
     private GridCacheAdapter dataCache(Ignite node) throws Exception  {
-        return ((IgniteKernal)node).internalCache(DATA_CACHE_NAME);
+        return ((IgniteKernal)node).internalCache(((IgniteKernal)node).igfsx(null).configuration()
+            .getDataCacheConfiguration().getName());
     }
 
     /**
      * Create node configuration.
      *
      * @param name Node name.
+     * @param ipFinder IpFinder.
      * @return Configuration.
      * @throws Exception If failed.
      */
@@ -226,7 +222,6 @@ public class IgfsBlockMessageSystemPoolStarvationSelfTest extends IgfsCommonAbst
         // Data cache configuration.
         CacheConfiguration dataCcfg = new CacheConfiguration();
 
-        dataCcfg.setName(DATA_CACHE_NAME);
         dataCcfg.setCacheMode(CacheMode.REPLICATED);
         dataCcfg.setAtomicityMode(TRANSACTIONAL);
         dataCcfg.setWriteSynchronizationMode(FULL_SYNC);
@@ -236,7 +231,6 @@ public class IgfsBlockMessageSystemPoolStarvationSelfTest extends IgfsCommonAbst
         // Meta cache configuration.
         CacheConfiguration metaCcfg = new CacheConfiguration();
 
-        metaCcfg.setName(META_CACHE_NAME);
         metaCcfg.setCacheMode(CacheMode.REPLICATED);
         metaCcfg.setAtomicityMode(TRANSACTIONAL);
         metaCcfg.setWriteSynchronizationMode(FULL_SYNC);
@@ -245,10 +239,10 @@ public class IgfsBlockMessageSystemPoolStarvationSelfTest extends IgfsCommonAbst
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
         igfsCfg.setDefaultMode(IgfsMode.PRIMARY);
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
         igfsCfg.setFragmentizerEnabled(false);
         igfsCfg.setBlockSize(1024);
+        igfsCfg.setDataCacheConfiguration(dataCcfg);
+        igfsCfg.setMetaCacheConfiguration(metaCcfg);
 
         // Ignite configuration.
         IgniteConfiguration cfg = getConfiguration(name);
@@ -258,7 +252,6 @@ public class IgfsBlockMessageSystemPoolStarvationSelfTest extends IgfsCommonAbst
         discoSpi.setIpFinder(ipFinder);
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCcfg, metaCcfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCachePerBlockLruEvictionPolicySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCachePerBlockLruEvictionPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCachePerBlockLruEvictionPolicySelfTest.java
index 93171ba..1b8ab58 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCachePerBlockLruEvictionPolicySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCachePerBlockLruEvictionPolicySelfTest.java
@@ -98,8 +98,6 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
     private void startPrimary() throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(IGFS_PRIMARY);
         igfsCfg.setBlockSize(512);
         igfsCfg.setDefaultMode(DUAL_SYNC);
@@ -115,7 +113,6 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
 
         CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setNearConfiguration(null);
         dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
@@ -129,12 +126,14 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setNearConfiguration(null);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("grid-primary");
@@ -144,7 +143,6 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");
@@ -155,7 +153,7 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
         igfsPrimary = (IgfsImpl)g.fileSystem(IGFS_PRIMARY);
 
         dataCache = igfsPrimary.context().kernalContext().cache().internalCache(
-            igfsPrimary.context().configuration().getDataCacheName());
+            igfsPrimary.context().configuration().getDataCacheConfiguration().getName());
     }
 
     /**
@@ -166,8 +164,6 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
     private void startSecondary() throws Exception {
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setDataCacheName("dataCache");
-        igfsCfg.setMetaCacheName("metaCache");
         igfsCfg.setName(IGFS_SECONDARY);
         igfsCfg.setBlockSize(512);
         igfsCfg.setDefaultMode(PRIMARY);
@@ -175,7 +171,6 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
 
         CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
 
-        dataCacheCfg.setName("dataCache");
         dataCacheCfg.setCacheMode(PARTITIONED);
         dataCacheCfg.setNearConfiguration(null);
         dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
@@ -185,12 +180,14 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
 
         CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
 
-        metaCacheCfg.setName("metaCache");
         metaCacheCfg.setCacheMode(REPLICATED);
         metaCacheCfg.setNearConfiguration(null);
         metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
 
+        igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
+        igfsCfg.setDataCacheConfiguration(dataCacheCfg);
+
         IgniteConfiguration cfg = new IgniteConfiguration();
 
         cfg.setGridName("grid-secondary");
@@ -200,7 +197,6 @@ public class IgfsCachePerBlockLruEvictionPolicySelfTest extends IgfsCommonAbstra
         discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
 
         cfg.setDiscoverySpi(discoSpi);
-        cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
         cfg.setFileSystemConfiguration(igfsCfg);
 
         cfg.setLocalHost("127.0.0.1");

http://git-wip-us.apache.org/repos/asf/ignite/blob/3ca46d1a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCacheSelfTest.java
index 81caa91..090c86a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsCacheSelfTest.java
@@ -41,12 +41,6 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED;
  * Tests ensuring that IGFS data and meta caches are not "visible" through public API.
  */
 public class IgfsCacheSelfTest extends IgfsCommonAbstractTest {
-    /** Meta-information cache name. */
-    private static final String META_CACHE_NAME = "meta";
-
-    /** Data cache name. */
-    private static final String DATA_CACHE_NAME = null;
-
     /** Regular cache name. */
     private static final String CACHE_NAME = "cache";
 
@@ -54,8 +48,7 @@ public class IgfsCacheSelfTest extends IgfsCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        cfg.setCacheConfiguration(cacheConfiguration(META_CACHE_NAME), cacheConfiguration(DATA_CACHE_NAME),
-            cacheConfiguration(CACHE_NAME));
+        cfg.setCacheConfiguration(cacheConfiguration(CACHE_NAME));
 
         TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
 
@@ -65,9 +58,9 @@ public class IgfsCacheSelfTest extends IgfsCommonAbstractTest {
 
         FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
 
-        igfsCfg.setMetaCacheName(META_CACHE_NAME);
-        igfsCfg.setDataCacheName(DATA_CACHE_NAME);
         igfsCfg.setName("igfs");
+        igfsCfg.setMetaCacheConfiguration(cacheConfiguration("meta"));
+        igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
 
         cfg.setFileSystemConfiguration(igfsCfg);
 
@@ -80,7 +73,7 @@ public class IgfsCacheSelfTest extends IgfsCommonAbstractTest {
 
         cacheCfg.setName(cacheName);
 
-        if (META_CACHE_NAME.equals(cacheName))
+        if ("meta".equals(cacheName))
             cacheCfg.setCacheMode(REPLICATED);
         else {
             cacheCfg.setCacheMode(PARTITIONED);
@@ -128,7 +121,7 @@ public class IgfsCacheSelfTest extends IgfsCommonAbstractTest {
 
         GridTestUtils.assertThrows(log(), new Callable<Object>() {
             @Override public Object call() throws Exception {
-                g.cache(META_CACHE_NAME);
+                g.cache(((IgniteKernal)g).igfsx("igfs").configuration().getMetaCacheConfiguration().getName());
 
                 return null;
             }
@@ -136,7 +129,7 @@ public class IgfsCacheSelfTest extends IgfsCommonAbstractTest {
 
         GridTestUtils.assertThrows(log(), new Callable<Object>() {
             @Override public Object call() throws Exception {
-                g.cache(DATA_CACHE_NAME);
+                g.cache(((IgniteKernal)g).igfsx("igfs").configuration().getDataCacheConfiguration().getName());
 
                 return null;
             }