use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteCommunicationBalanceTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpCommunicationSpi commSpi = ((TcpCommunicationSpi) cfg.getCommunicationSpi());
commSpi.setSharedMemoryPort(-1);
commSpi.setConnectionsPerNode(connectionsPerNode());
commSpi.setUsePairedConnections(usePairedConnections());
if (selectors > 0)
commSpi.setSelectorsCount(selectors);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
cfg.setClientMode(client);
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;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class CacheLoadingConcurrentGridStartSelfTest method getConfiguration.
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setLateAffinityAssignment(true);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(PARTITIONED);
ccfg.setBackups(1);
ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestCacheStoreAdapter()));
if (getTestIgniteInstanceName(0).equals(igniteInstanceName)) {
if (client)
cfg.setClientMode(true);
if (configured)
cfg.setCacheConfiguration(ccfg);
} else
cfg.setCacheConfiguration(ccfg);
if (!configured) {
ccfg.setNodeFilter(new P1<ClusterNode>() {
@Override
public boolean apply(ClusterNode node) {
String name = node.attribute(ATTR_IGNITE_INSTANCE_NAME).toString();
return !getTestIgniteInstanceName(0).equals(name);
}
});
}
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteCachePutRetryAbstractSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setIncludeEventTypes();
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
AtomicConfiguration acfg = new AtomicConfiguration();
acfg.setBackups(1);
cfg.setAtomicConfiguration(acfg);
cfg.setIncludeEventTypes(new int[0]);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridMultipleJobsSelfTest 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);
if (getTestIgniteInstanceName(1).equals(igniteInstanceName))
c.setCacheConfiguration();
else {
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setBackups(1);
c.setCacheConfiguration(cc);
}
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
c.setCommunicationSpi(commSpi);
return c;
}
Aggregations