use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridifySingleSplitLoadTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
/* Uncomment following code if you start it manually. */
CommunicationSpi commSpi = new TcpCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
DiscoverySpi discoSpi = new TcpDiscoverySpi();
cfg.setDiscoverySpi(discoSpi);
/*
*/
@SuppressWarnings("TypeMayBeWeakened") Log4JLogger log = (Log4JLogger) cfg.getGridLogger();
log.getLogger("org.apache.ignite").setLevel(Level.INFO);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteExceptionInNioWorkerSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
CacheConfiguration ccfg = new CacheConfiguration("cache");
ccfg.setBackups(1);
cfg.setCacheConfiguration(ccfg);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
cfg.setCommunicationSpi(commSpi);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridTcpSpiForwardingSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings({ "IfMayBeConditional", "deprecation" })
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
if (ipFinderUseLocPorts)
ipFinder.setAddresses(Arrays.asList("127.0.0.1:" + locPort1, "127.0.0.1:" + locPort2));
else
ipFinder.setAddresses(Arrays.asList("127.0.0.1:" + extPort1, "127.0.0.1:" + extPort2));
TcpDiscoverySpi spi = new TcpDiscoverySpi();
final int locPort;
final int commLocPort;
if (getTestIgniteInstanceName(0).equals(igniteInstanceName)) {
locPort = locPort1;
commLocPort = commLocPort1;
} else if (getTestIgniteInstanceName(1).equals(igniteInstanceName)) {
locPort = locPort2;
commLocPort = commLocPort2;
} else
throw new IllegalArgumentException("Unknown Ignite instance name");
spi.setIpFinder(ipFinder);
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
spi.setLocalPort(locPort);
spi.setLocalPortRange(1);
cfg.setDiscoverySpi(spi);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi() {
@Override
protected GridCommunicationClient createTcpClient(ClusterNode node, int connIdx) throws IgniteCheckedException {
Map<String, Object> attrs = new HashMap<>(node.attributes());
attrs.remove(createSpiAttributeName(ATTR_PORT));
((TcpDiscoveryNode) node).setAttributes(attrs);
return super.createTcpClient(node, connIdx);
}
};
commSpi.setLocalAddress("127.0.0.1");
commSpi.setLocalPort(commLocPort);
commSpi.setLocalPortRange(1);
commSpi.setSharedMemoryPort(-1);
commSpi.setConnectionsPerNode(1);
cfg.setCommunicationSpi(commSpi);
assert rslvr != null;
cfg.setAddressResolver(rslvr);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridMultiSplitsLoadTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("ConstantConditions")
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
CommunicationSpi commSpi = new TcpCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
DiscoverySpi discoSpi = new TcpDiscoverySpi();
cfg.setDiscoverySpi(discoSpi);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridSingleSplitsNewNodesAbstractLoadTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("ConstantConditions")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setCommunicationSpi(new TcpCommunicationSpi());
cfg.setDiscoverySpi(getDiscoverySpi(cfg));
cfg.setMetricsHistorySize(1000);
cfg.setPublicThreadPoolSize(100);
return cfg;
}
Aggregations