use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class GridCacheReloadSelfTest method getConfiguration.
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setLocalHost("127.0.0.1");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500"));
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setName(CACHE_NAME);
cacheCfg.setCacheMode(cacheMode);
LruEvictionPolicy plc = new LruEvictionPolicy();
plc.setMaxSize(MAX_CACHE_ENTRIES);
cacheCfg.setEvictionPolicy(plc);
cacheCfg.setOnheapCacheEnabled(true);
cacheCfg.setNearConfiguration(nearEnabled ? new NearCacheConfiguration() : null);
final CacheStore store = new CacheStoreAdapter<Integer, Integer>() {
@Override
public Integer load(Integer key) {
return key;
}
@Override
public void write(javax.cache.Cache.Entry<? extends Integer, ? extends Integer> e) {
//No-op.
}
@Override
public void delete(Object key) {
//No-op.
}
};
cacheCfg.setCacheStoreFactory(singletonFactory(store));
cacheCfg.setReadThrough(true);
cacheCfg.setWriteThrough(true);
cacheCfg.setLoadPreviousValue(true);
if (cacheMode == PARTITIONED)
cacheCfg.setBackups(1);
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class GridCacheLocalMultithreadedSelfTest method getConfiguration.
/** {@inheritDoc} */
@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(LOCAL);
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class IndexingSpiQuerySelfTest method configuration.
/**
* @return Configuration.
*/
protected IgniteConfiguration configuration() {
IgniteConfiguration cfg = new IgniteConfiguration();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
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;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class GridCacheLocalLockSelfTest method getConfiguration.
/** {@inheritDoc} */
@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(LOCAL);
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
Aggregations