use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class ApplicationConfiguration method igniteInstance.
@Bean
public Ignite igniteInstance() {
IgniteConfiguration cfg = new IgniteConfiguration();
CacheConfiguration ccfg = new CacheConfiguration("PersonCache");
ccfg.setIndexedTypes(Integer.class, Person.class);
cfg.setCacheConfiguration(ccfg);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(spi);
return Ignition.start(cfg);
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class GridCacheOffHeapSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
cfg.setNetworkTimeout(2000);
CacheConfiguration<?, ?> cacheCfg = defaultCacheConfiguration();
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cacheCfg.setCacheMode(REPLICATED);
cacheCfg.setIndexedTypes(Integer.class, CacheValue.class);
cfg.setCacheConfiguration(cacheCfg);
cfg.setDeploymentMode(SHARED);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class GridCacheQuerySerializationSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setName(CACHE_NAME);
cacheCfg.setCacheMode(CACHE_MODE);
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cacheCfg.setIndexedTypes(Integer.class, GridCacheQueryTestValue.class);
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class GridCacheQuerySimpleBenchmark method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
CacheConfiguration<?, ?> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg.setName("offheap-cache");
ccfg.setCacheMode(CacheMode.PARTITIONED);
ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
ccfg.setIndexedTypes(Long.class, Person.class);
c.setCacheConfiguration(ccfg);
return c;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class IgniteCacheAbstractFieldsQuerySelfTest method discovery.
/**
* @return Discovery SPI.
*/
private DiscoverySpi discovery() {
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(IP_FINDER);
return spi;
}
Aggregations