use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class TcpDiscoverySelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
TcpDiscoverySpi spi = nodeSpi.get();
if (spi == null) {
spi = igniteInstanceName.contains("testPingInterruptedOnNodeFailedFailingNode") ? new TestTcpDiscoverySpi() : new TcpDiscoverySpi();
} else
nodeSpi.set(null);
discoMap.put(igniteInstanceName, spi);
spi.setIpFinder(ipFinder);
spi.setNetworkTimeout(2500);
spi.setIpFinderCleanFrequency(5000);
spi.setJoinTimeout(5000);
cfg.setDiscoverySpi(spi);
cfg.setFailureDetectionTimeout(7500);
if (ccfgs != null)
cfg.setCacheConfiguration(ccfgs);
else
cfg.setCacheConfiguration();
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
cfg.setIncludeProperties();
cfg.setMetricsUpdateFrequency(1000);
if (!igniteInstanceName.contains("LoopbackProblemTest"))
cfg.setLocalHost("127.0.0.1");
if (igniteInstanceName.contains("testFailureDetectionOnNodePing")) {
// To make test faster: on Windows 1 connect takes 1 second.
spi.setReconnectCount(1);
cfg.setMetricsUpdateFrequency(40000);
cfg.setClientFailureDetectionTimeout(41000);
}
cfg.setConnectorConfiguration(null);
if (nodeId != null)
cfg.setNodeId(nodeId);
if (igniteInstanceName.contains("NonSharedIpFinder")) {
TcpDiscoveryVmIpFinder finder = new TcpDiscoveryVmIpFinder();
finder.setAddresses(Arrays.asList("127.0.0.1:47501"));
spi.setIpFinder(finder);
} else if (igniteInstanceName.contains("MulticastIpFinder")) {
TcpDiscoveryMulticastIpFinder finder = new TcpDiscoveryMulticastIpFinder();
finder.setAddressRequestAttempts(5);
finder.setMulticastGroup(GridTestUtils.getNextMulticastGroup(getClass()));
finder.setMulticastPort(GridTestUtils.getNextMulticastPort(getClass()));
spi.setIpFinder(finder);
// (possibly due to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7122846).
if (U.isMacOs())
spi.setLocalAddress(F.first(U.allLocalIps()));
} else if (igniteInstanceName.contains("testPingInterruptedOnNodeFailedPingingNode"))
cfg.setFailureDetectionTimeout(30_000);
else if (igniteInstanceName.contains("testNoRingMessageWorkerAbnormalFailureNormalNode"))
cfg.setFailureDetectionTimeout(3_000);
else if (igniteInstanceName.contains("testNoRingMessageWorkerAbnormalFailureSegmentedNode")) {
cfg.setFailureDetectionTimeout(6_000);
cfg.setGridLogger(strLog = new GridStringLogger());
} else if (igniteInstanceName.contains("testNodeShutdownOnRingMessageWorkerFailureFailedNode"))
cfg.setGridLogger(strLog = new GridStringLogger());
cfg.setClientMode(client);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class TcpDiscoverySnapshotHistoryTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500"));
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder));
cfg.setCacheConfiguration();
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class TcpDiscoverySpiConfigSelfTest method testLocalPortRange.
/**
* @throws Exception If failed.
*/
public void testLocalPortRange() throws Exception {
try {
IgniteConfiguration cfg = getConfiguration();
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
spi.setLocalPortRange(0);
cfg.setDiscoverySpi(spi);
startGrid(cfg.getIgniteInstanceName(), cfg);
} finally {
stopAllGrids();
}
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class IgniteHadoopFileSystemClientSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setDataCacheConfiguration(dataCacheConfiguration());
igfsCfg.setMetaCacheConfiguration(metaCacheConfiguration());
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(512 * 1024);
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.TCP);
endpointCfg.setPort(DFLT_IPC_PORT);
igfsCfg.setIpcEndpointConfiguration(endpointCfg);
cfg.setFileSystemConfiguration(igfsCfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class IgniteHadoopFileSystemLoggerStateSelfTest method startUp.
/**
* Startup the grid and instantiate the file system.
*
* @throws Exception If failed.
*/
private void startUp() throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setName("igfs");
igfsCfg.setBlockSize(512 * 1024);
igfsCfg.setDefaultMode(PRIMARY);
IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
endpointCfg.setType(IgfsIpcEndpointType.TCP);
endpointCfg.setPort(10500);
igfsCfg.setIpcEndpointConfiguration(endpointCfg);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setName("partitioned");
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setName("replicated");
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
igfsCfg.setDataCacheConfiguration(dataCacheCfg);
igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("igfs-grid");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
Ignite g = G.start(cfg);
igfs = (IgfsEx) g.fileSystem("igfs");
igfs.globalSampling(sampling);
fs = fileSystem();
}
Aggregations