use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsProcessorValidationSelfTest method testRemoteIfDefaultModeDiffers.
/**
* @throws Exception If failed.
*/
public void testRemoteIfDefaultModeDiffers() throws Exception {
IgniteConfiguration g2Cfg = getConfiguration("g2");
FileSystemConfiguration g2IgfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
FileSystemConfiguration g2IgfsCfg2 = new FileSystemConfiguration(g1IgfsCfg2);
g1IgfsCfg1.setDefaultMode(DUAL_ASYNC);
g1IgfsCfg2.setDefaultMode(DUAL_ASYNC);
g2IgfsCfg1.setDefaultMode(DUAL_SYNC);
g2IgfsCfg2.setDefaultMode(DUAL_SYNC);
g2Cfg.setFileSystemConfiguration(g2IgfsCfg1, g2IgfsCfg2);
G.start(g1Cfg);
checkGridStartFails(g2Cfg, "Default mode should be the same on all nodes in grid for IGFS", false);
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsProcessorValidationSelfTest method testPreConfiguredCache.
/**
* @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());
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsProcessorValidationSelfTest method testRemoteIfAffinityMapperGroupSizeDiffers.
/**
* @throws Exception If failed.
*/
public void testRemoteIfAffinityMapperGroupSizeDiffers() throws Exception {
IgniteConfiguration g2Cfg = getConfiguration("g2");
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);
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsProcessorSelfTest method beforeTest.
/** {@inheritDoc} */
@Override
protected void beforeTest() throws Exception {
IgniteEx grid = grid(0);
igfs = grid.fileSystem(igfsName());
FileSystemConfiguration[] cfgs = grid.configuration().getFileSystemConfiguration();
assert cfgs.length == 1;
metaCacheName = cfgs[0].getMetaCacheConfiguration().getName();
metaCache = ((IgniteKernal) grid).internalCache(metaCacheName);
}
use of org.apache.ignite.configuration.FileSystemConfiguration in project ignite by apache.
the class IgfsModesSelfTest method startUpSecondary.
/**
* Startup secondary file system.
*
* @throws Exception If failed.
*/
private void startUpSecondary() throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs-secondary");
igfsCfg.setBlockSize(512 * 1024);
igfsCfg.setDefaultMode(PRIMARY);
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.TCP);
endpointCfg.setPort(11500);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
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.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("igfs-grid-secondary");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
igfsSecondary = (IgfsImpl) G.start(cfg).fileSystem("igfs-secondary");
}
Aggregations