use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class JdbcStreamingSelfTest method getConfiguration0.
/**
* @param gridName Grid name.
* @return Grid configuration used for starting the grid.
* @throws Exception If failed.
*/
private IgniteConfiguration getConfiguration0(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
CacheConfiguration<?, ?> cache = defaultCacheConfiguration();
cache.setCacheMode(PARTITIONED);
cache.setBackups(1);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setIndexedTypes(Integer.class, Integer.class);
cfg.setCacheConfiguration(cache);
cfg.setLocalHost("127.0.0.1");
TcpDiscoverySpi disco = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500..47501"));
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
cfg.setConnectorConfiguration(new ConnectorConfiguration());
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder 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.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class BinaryTreeSelfTest method configuration.
/**
* Create configuration.
*
* @param name Node name.
* @param client Client mode flag.
* @return Configuration.
*/
private static IgniteConfiguration configuration(String name, boolean client) {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName(name);
cfg.setClientMode(client);
cfg.setLocalHost("127.0.0.1");
cfg.setPeerClassLoadingEnabled(false);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500"));
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(CacheMode.PARTITIONED);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class GridCacheNearOneNodeSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(disco);
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setBackups(1);
cacheCfg.setAtomicityMode(TRANSACTIONAL);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setCacheStoreFactory(singletonFactory(store));
cacheCfg.setReadThrough(true);
cacheCfg.setWriteThrough(true);
cacheCfg.setLoadPreviousValue(true);
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class GridCacheLocalLoadAllSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(disco);
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setName("test-cache");
ccfg.setCacheMode(LOCAL);
ccfg.setCacheStoreFactory(singletonFactory(new TestStore()));
ccfg.setReadThrough(true);
ccfg.setWriteThrough(true);
ccfg.setLoadPreviousValue(true);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
Aggregations