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://[email protected]: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}"/>
