use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridSingleSplitsRedeployLoadTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
CommunicationSpi commSpi = new TcpCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
DiscoverySpi discoSpi = new TcpDiscoverySpi();
cfg.setDiscoverySpi(discoSpi);
cfg.setDeploymentMode(DeploymentMode.CONTINUOUS);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridCacheAbstractFullApiSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setForceServerMode(true);
int[] evtTypes = cfg.getIncludeEventTypes();
if (evtTypes == null || evtTypes.length == 0)
cfg.setIncludeEventTypes(EventType.EVT_CACHE_OBJECT_READ);
else {
for (int evtType : evtTypes) {
if (evtType == EventType.EVT_CACHE_OBJECT_READ)
return cfg;
}
int[] updatedEvtTypes = Arrays.copyOf(evtTypes, evtTypes.length + 1);
updatedEvtTypes[updatedEvtTypes.length - 1] = EventType.EVT_CACHE_OBJECT_READ;
}
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteCacheContainsKeyAbstractSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
TransactionConfiguration tcfg = new TransactionConfiguration();
tcfg.setTxSerializableEnabled(true);
cfg.setTransactionConfiguration(tcfg);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class IgniteCacheIncrementTxTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
if (getTestIgniteInstanceName(SRVS).equals(igniteInstanceName))
cfg.setClientMode(true);
return cfg;
}
use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.
the class GridAbstractTest method getConfiguration.
/**
* This method should be overridden by subclasses to change configuration parameters.
*
* @return Grid configuration used for starting of grid.
* @param igniteInstanceName Ignite instance name.
* @param rsrcs Resources.
* @throws Exception If failed.
*/
@SuppressWarnings("deprecation")
protected IgniteConfiguration getConfiguration(String igniteInstanceName, IgniteTestResources rsrcs) throws Exception {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName(igniteInstanceName);
cfg.setGridLogger(rsrcs.getLogger());
cfg.setMarshaller(rsrcs.getMarshaller());
cfg.setNodeId(rsrcs.getNodeId());
cfg.setIgniteHome(rsrcs.getIgniteHome());
cfg.setMBeanServer(rsrcs.getMBeanServer());
cfg.setPeerClassLoadingEnabled(true);
cfg.setMetricsLogFrequency(0);
cfg.setConnectorConfiguration(null);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setLocalPort(GridTestUtils.getNextCommPort(getClass()));
commSpi.setTcpNoDelay(true);
cfg.setCommunicationSpi(commSpi);
TcpDiscoverySpi discoSpi = new TestTcpDiscoverySpi();
if (isDebug()) {
cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
cfg.setNetworkTimeout(Long.MAX_VALUE / 3);
} else {
// Set network timeout to 10 sec to avoid unexpected p2p class loading errors.
cfg.setNetworkTimeout(10_000);
cfg.setFailureDetectionTimeout(10_000);
cfg.setClientFailureDetectionTimeout(10_000);
}
// Set metrics update interval to 1 second to speed up tests.
cfg.setMetricsUpdateFrequency(1000);
String mcastAddr = GridTestUtils.getNextMulticastGroup(getClass());
TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ipFinder.setAddresses(Collections.singleton("127.0.0.1:" + TcpDiscoverySpi.DFLT_PORT));
if (!F.isEmpty(mcastAddr)) {
ipFinder.setMulticastGroup(mcastAddr);
ipFinder.setMulticastPort(GridTestUtils.getNextMulticastPort(getClass()));
}
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
SharedFsCheckpointSpi cpSpi = new SharedFsCheckpointSpi();
Collection<String> paths = new ArrayList<>();
paths.add(getDefaultCheckpointPath(cfg.getMarshaller()));
cpSpi.setDirectoryPaths(paths);
cfg.setCheckpointSpi(cpSpi);
cfg.setEventStorageSpi(new MemoryEventStorageSpi());
cfg.setIncludeEventTypes(EventType.EVTS_ALL);
return cfg;
}
Aggregations