use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class IgfsEventsAbstractSelfTest method getConfiguration.
/**
* The same as getConfiguration(String igniteInstanceName) but it sets custom IGFS configuration
*
* @param igniteInstanceName Ignite instance name.
* @param igfsCfg IGFS configuration.
* @return Grid configuration.
* @throws Exception If failed.
*/
protected IgniteConfiguration getConfiguration(String igniteInstanceName, FileSystemConfiguration igfsCfg) throws Exception {
IgniteConfiguration cfg = IgnitionEx.loadConfiguration("config/hadoop/default-config.xml").get1();
assert cfg != null;
cfg.setIgniteInstanceName(igniteInstanceName);
cfg.setIncludeEventTypes(concat(EVTS_IGFS, EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED));
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setHadoopConfiguration(null);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
return cfg;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class IgfsFragmentizerAbstractSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
// Need to set this to avoid thread starvation.
igfsCfg.setPerNodeParallelBatchCount(8);
igfsCfg.setFragmentizerThrottlingBlockLength(16 * IGFS_BLOCK_SIZE);
igfsCfg.setFragmentizerThrottlingDelay(10);
igfsCfg.setMetaCacheConfiguration(metaConfiguration());
igfsCfg.setDataCacheConfiguration(dataConfiguration());
cfg.setFileSystemConfiguration(igfsCfg);
return cfg;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class ComputeJobCancelWithServiceSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
return cfg;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class GridAffinityP2PSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings({ "unchecked" })
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
c.setFailureDetectionTimeout(Integer.MAX_VALUE);
c.setDeploymentMode(depMode);
if (igniteInstanceName.endsWith("1"))
// Empty cache configuration.
c.setCacheConfiguration();
else {
assert igniteInstanceName.endsWith("2") || igniteInstanceName.endsWith("3");
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
GridTestExternalClassLoader ldr = new GridTestExternalClassLoader(URLS);
cc.setAffinity((AffinityFunction) ldr.loadClass(EXT_AFFINITY_CLS_NAME).newInstance());
cc.setAffinityMapper((AffinityKeyMapper) ldr.loadClass(EXT_AFFINITY_MAPPER_CLS_NAME).newInstance());
c.setCacheConfiguration(cc);
c.setUserAttributes(F.asMap(GridCacheModuloAffinityFunction.IDX_ATTR, igniteInstanceName.endsWith("2") ? 0 : 1));
}
return c;
}
use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.
the class IgniteUpdateNotifierPerClusterSettingSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
cfg.setClientMode(client);
return cfg;
}
Aggregations