Search in sources :

Example 11 with TcpDiscoveryVmIpFinder

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 12 with TcpDiscoveryVmIpFinder

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) SharedFsCheckpointSpi(org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 13 with TcpDiscoveryVmIpFinder

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());
}
Also used : TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) TcpDiscoveryIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder)

Example 14 with TcpDiscoveryVmIpFinder

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 15 with TcpDiscoveryVmIpFinder

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)97 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)81 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)80 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)38 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)16 Ignite (org.apache.ignite.Ignite)14 IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)12 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)8 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)6 TcpDiscoveryNode (org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode)6 ArrayList (java.util.ArrayList)5 IgfsIpcEndpointConfiguration (org.apache.ignite.igfs.IgfsIpcEndpointConfiguration)5 HashMap (java.util.HashMap)4 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)4 IgniteException (org.apache.ignite.IgniteException)4 TcpDiscoveryIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder)4 InetSocketAddress (java.net.InetSocketAddress)3 UUID (java.util.UUID)3 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)3 File (java.io.File)2