Search in sources :

Example 91 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class SqlConnectorConfigurationValidationSelfTest method check.

/**
 * Perform check.
 *
 * @param sqlCfg SQL configuration.
 * @param success Success flag. * @throws Exception If failed.
 */
@SuppressWarnings({ "ThrowableResultOfMethodCallIgnored", "unchecked" })
private void check(SqlConnectorConfiguration sqlCfg, boolean success) throws Exception {
    final IgniteConfiguration cfg = super.getConfiguration();
    cfg.setIgniteInstanceName(SqlConnectorConfigurationValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet());
    cfg.setLocalHost("127.0.0.1");
    cfg.setSqlConnectorConfiguration(sqlCfg);
    cfg.setMarshaller(new BinaryMarshaller());
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(spi);
    CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME).setIndexedTypes(SqlConnectorKey.class, SqlConnectorValue.class);
    cfg.setCacheConfiguration(ccfg);
    if (success)
        startGrid(cfg.getIgniteInstanceName(), cfg);
    else {
        GridTestUtils.assertThrows(log, new Callable<Void>() {

            @Override
            public Void call() throws Exception {
                startGrid(cfg.getIgniteInstanceName(), cfg);
                return null;
            }
        }, IgniteException.class, null);
    }
}
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) IgniteException(org.apache.ignite.IgniteException) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 92 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class GridSpiAbstractTest method configureDiscovery.

/**
 * @param spiTest SPI test annotation.
 * @throws Exception If anything failed.
 */
private void configureDiscovery(GridSpiTest spiTest) throws Exception {
    DiscoverySpi discoSpi = spiTest.discoverySpi().newInstance();
    if (discoSpi instanceof TcpDiscoverySpi) {
        TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi) discoSpi;
        tcpDisco.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    }
    getTestData().setDiscoverySpi(discoSpi);
    getTestResources().inject(discoSpi);
    configure(discoSpi);
    if (discoSpi.getNodeAttributes() != null)
        getTestData().getAttributes().putAll(discoSpi.getNodeAttributes());
}
Also used : TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) DiscoverySpi(org.apache.ignite.spi.discovery.DiscoverySpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 93 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class IgfsCacheSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration(CACHE_NAME));
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName("igfs");
    igfsCfg.setMetaCacheConfiguration(cacheConfiguration("meta"));
    igfsCfg.setDataCacheConfiguration(cacheConfiguration("data"));
    cfg.setFileSystemConfiguration(igfsCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 94 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class HibernateL2CacheStrategySelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setCacheConfiguration(cacheConfiguration(ENTITY3_NAME), cacheConfiguration(ENTITY4_NAME), cacheConfiguration("cache1"), cacheConfiguration("cache2"), cacheConfiguration(TIMESTAMP_CACHE), cacheConfiguration(QUERY_CACHE));
    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 95 with TcpDiscoveryVmIpFinder

use of org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder in project ignite by apache.

the class OdbcConfigurationValidationSelfTest method check.

/**
 * Perform check.
 *
 * @param odbcCfg ODBC configuration.
 * @param success Success flag. * @throws Exception If failed.
 */
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
private void check(OdbcConfiguration odbcCfg, boolean success) throws Exception {
    final IgniteConfiguration cfg = super.getConfiguration();
    cfg.setIgniteInstanceName(OdbcConfigurationValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet());
    cfg.setLocalHost("127.0.0.1");
    cfg.setOdbcConfiguration(odbcCfg);
    cfg.setMarshaller(new BinaryMarshaller());
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(spi);
    if (success)
        startGrid(cfg.getIgniteInstanceName(), cfg);
    else {
        GridTestUtils.assertThrows(log, new Callable<Void>() {

            @Override
            public Void call() throws Exception {
                startGrid(cfg.getIgniteInstanceName(), cfg);
                return null;
            }
        }, IgniteException.class, null);
    }
}
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) IgniteException(org.apache.ignite.IgniteException) 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