use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class TxOptimisticDeadlockDetectionCrossCacheTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
if (isDebug()) {
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.failureDetectionTimeoutEnabled(false);
cfg.setDiscoverySpi(discoSpi);
}
TcpCommunicationSpi commSpi = new TestCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
CacheConfiguration ccfg0 = defaultCacheConfiguration();
ccfg0.setName("cache0");
ccfg0.setCacheMode(CacheMode.PARTITIONED);
ccfg0.setBackups(1);
ccfg0.setNearConfiguration(null);
CacheConfiguration ccfg1 = defaultCacheConfiguration();
ccfg1.setName("cache1");
ccfg1.setCacheMode(CacheMode.PARTITIONED);
ccfg1.setBackups(1);
ccfg1.setNearConfiguration(null);
cfg.setCacheConfiguration(ccfg0, ccfg1);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class CacheKeepBinaryIterationTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class ClientReconnectContinuousQueryTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
TcpCommunicationSpi commSpi = (TcpCommunicationSpi) cfg.getCommunicationSpi();
commSpi.setSlowClientQueueLimit(50);
commSpi.setIdleConnectionTimeout(300_000);
if (getTestIgniteInstanceName(CLIENT_IDX).equals(gridName))
cfg.setClientMode(true);
else {
CacheConfiguration ccfg = defaultCacheConfiguration();
cfg.setCacheConfiguration(ccfg);
}
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class ClientReconnectContinuousQueryTest method skipRead.
/**
* @param igniteClient Ignite client.
* @param skip Skip.
*/
private void skipRead(IgniteEx igniteClient, boolean skip) {
GridIoManager ioMgr = igniteClient.context().io();
TcpCommunicationSpi commSpi = (TcpCommunicationSpi) ((Object[]) U.field(ioMgr, "spis"))[0];
GridNioServer nioSrvr = U.field(commSpi, "nioSrvr");
GridTestUtils.setFieldValue(nioSrvr, "skipRead", skip);
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridCacheContinuousQueryAbstractSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setPeerClassLoadingEnabled(peerClassLoadingEnabled());
if (!igniteInstanceName.equals(NO_CACHE_IGNITE_INSTANCE_NAME)) {
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(cacheMode());
cacheCfg.setAtomicityMode(atomicityMode());
cacheCfg.setNearConfiguration(nearConfiguration());
cacheCfg.setRebalanceMode(ASYNC);
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cacheCfg.setCacheStoreFactory(new StoreFactory());
cacheCfg.setReadThrough(true);
cacheCfg.setWriteThrough(true);
cacheCfg.setLoadPreviousValue(true);
cfg.setCacheConfiguration(cacheCfg);
} else
cfg.setClientMode(true);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
return cfg;
}
Aggregations