use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class ClientConnectorConfigurationValidationSelfTest method baseConfiguration.
/**
* Get base node configuration.
*
* @return Configuration.
* @throws Exception If failed.
*/
@SuppressWarnings("unchecked")
private IgniteConfiguration baseConfiguration() throws Exception {
final IgniteConfiguration cfg = super.getConfiguration();
cfg.setIgniteInstanceName(ClientConnectorConfigurationValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet());
cfg.setLocalHost("127.0.0.1");
cfg.setMarshaller(new BinaryMarshaller());
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(spi);
CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME).setIndexedTypes(ClientConnectorKey.class, ClientConnectorValue.class);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class ComputeFailoverNodeStartup method configuration.
/**
* Create Ignite configuration with configured checkpoints.
*
* @return Ignite configuration.
* @throws IgniteException If configuration creation failed.
*/
public static IgniteConfiguration configuration() throws IgniteException {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setLocalHost("127.0.0.1");
cfg.setPeerClassLoadingEnabled(true);
// Configure checkpoint SPI.
SharedFsCheckpointSpi checkpointSpi = new SharedFsCheckpointSpi();
checkpointSpi.setDirectoryPaths(Collections.singletonList("work/checkpoint/sharedfs"));
cfg.setCheckpointSpi(checkpointSpi);
// Configure discovery SPI.
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class OptimizedMarshallerTest method testNonSerializable1.
/**
* Tests ability to marshal non-serializable objects.
*
* @throws IgniteCheckedException If marshalling failed.
*/
public void testNonSerializable1() throws IgniteCheckedException {
OptimizedMarshaller marsh = marshaller();
marsh.setRequireSerializable(false);
byte[] bytes = marsh.marshal(new TcpDiscoveryVmIpFinder());
TcpDiscoveryIpFinder ipFinder = marsh.unmarshal(bytes, null);
assertFalse(ipFinder.isShared());
ipFinder = marsh.unmarshal(marsh.marshal(new TcpDiscoveryVmIpFinder(true)), null);
assertTrue(ipFinder.isShared());
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class CacheInterceptorPartitionCounterLocalSanityTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(new TcpDiscoveryVmIpFinder(true));
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.
the class IndexingSpiQuerySelfTest method configuration.
/**
* @return Configuration.
*/
protected IgniteConfiguration configuration() {
IgniteConfiguration cfg = new IgniteConfiguration();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
return cfg;
}
Aggregations