use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteCacheGetRestartTest 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);
Boolean clientMode = client.get();
if (clientMode != null) {
cfg.setClientMode(clientMode);
client.remove();
}
cfg.setConsistentId(igniteInstanceName);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteCacheMessageRecoveryAbstractTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setSocketWriteTimeout(1000);
commSpi.setSharedMemoryPort(-1);
commSpi.setConnectionsPerNode(connectionsPerNode());
cfg.setCommunicationSpi(commSpi);
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setCacheMode(PARTITIONED);
ccfg.setAtomicityMode(atomicityMode());
ccfg.setBackups(1);
ccfg.setNearConfiguration(null);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridCacheAbstractDataStructuresFailoverSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
AtomicConfiguration atomicCfg = new AtomicConfiguration();
atomicCfg.setCacheMode(collectionCacheMode());
atomicCfg.setBackups(collectionConfiguration().getBackups());
cfg.setAtomicConfiguration(atomicCfg);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setName(TRANSACTIONAL_CACHE_NAME);
ccfg.setAtomicityMode(TRANSACTIONAL);
cfg.setCacheConfiguration(ccfg);
if (client) {
cfg.setClientMode(client);
((TcpDiscoverySpi) (cfg.getDiscoverySpi())).setForceServerMode(true);
}
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteCacheAtomicMessageRecoveryPairedConnectionsTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpCommunicationSpi commSpi = (TcpCommunicationSpi) cfg.getCommunicationSpi();
assertFalse(commSpi.isUsePairedConnections());
commSpi.setUsePairedConnections(true);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridCachePutAllFailoverSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
cfg.setPeerClassLoadingEnabled(false);
cfg.setDeploymentMode(DeploymentMode.CONTINUOUS);
TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
discoverySpi.setAckTimeout(60000);
discoverySpi.setIpFinder(ipFinder);
discoverySpi.setForceServerMode(true);
cfg.setDiscoverySpi(discoverySpi);
if (igniteInstanceName.startsWith("master")) {
cfg.setClientMode(true);
cfg.setUserAttributes(ImmutableMap.of("segment", "master"));
// For sure.
failoverSpi.setMaximumFailoverAttempts(100);
cfg.setFailoverSpi(failoverSpi);
} else if (igniteInstanceName.startsWith("worker")) {
cfg.setUserAttributes(ImmutableMap.of("segment", "worker"));
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setName("partitioned");
cacheCfg.setAtomicityMode(atomicityMode());
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setBackups(backups);
cacheCfg.setNearConfiguration(nearEnabled ? new NearCacheConfiguration() : null);
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setCacheConfiguration(cacheCfg);
} else
throw new IllegalStateException("Unexpected Ignite instance name: " + igniteInstanceName);
return cfg;
}
Aggregations