use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteCacheSizeFailoverTest 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);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(PARTITIONED);
ccfg.setAtomicityMode(ATOMIC);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setBackups(1);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class TcpDiscoveryMultiThreadedTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings({ "IfMayBeConditional" })
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
UUID id = nodeId.get();
if (id != null) {
cfg.setNodeId(id);
nodeId.set(null);
}
if (client())
cfg.setClientMode(true);
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder).setJoinTimeout(60_000).setNetworkTimeout(10_000));
int[] evts = { EVT_NODE_FAILED, EVT_NODE_LEFT };
Map<IgnitePredicate<? extends Event>, int[]> lsnrs = new HashMap<>();
lsnrs.put(new IgnitePredicate<Event>() {
@Override
public boolean apply(Event evt) {
DiscoveryEvent discoveryEvt = (DiscoveryEvent) evt;
failedNodes.add(discoveryEvt.eventNode().id());
return true;
}
}, evts);
cfg.setLocalEventListeners(lsnrs);
cfg.setCacheConfiguration();
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
cfg.setIncludeProperties();
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridManagerStopSelfTest method testStopCommunicationManager.
/**
* @throws Exception If failed.
*/
public void testStopCommunicationManager() throws Exception {
CommunicationSpi spi = new TcpCommunicationSpi();
injectLogger(spi);
ctx.config().setCommunicationSpi(spi);
ctx.config().setMarshaller(new BinaryMarshaller());
GridIoManager mgr = new GridIoManager(ctx);
mgr.onKernalStop(true);
mgr.stop(false);
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridIoManagerSelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
ctx.config().setCommunicationSpi(new TcpCommunicationSpi());
ctx.config().setMarshaller(new JdkMarshaller());
// Turn off peer class loading to simplify mocking.
ctx.config().setPeerClassLoadingEnabled(false);
// Register local and remote nodes in discovery manager.
GridDiscoveryManager mockedDiscoveryMgr = Mockito.mock(GridDiscoveryManager.class);
when(mockedDiscoveryMgr.localNode()).thenReturn(locNode);
when(mockedDiscoveryMgr.remoteNodes()).thenReturn(F.<ClusterNode>asList(rmtNode));
ctx.add(mockedDiscoveryMgr);
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class TaskNodeRestartTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
return cfg;
}
Aggregations