Search in sources :

Example 31 with TcpDiscoveryVmIpFinder

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

the class JdbcStreamingSelfTest method getConfiguration0.

/**
 * @param gridName Grid name.
 * @return Grid configuration used for starting the grid.
 * @throws Exception If failed.
 */
private IgniteConfiguration getConfiguration0(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration<?, ?> cache = defaultCacheConfiguration();
    cache.setCacheMode(PARTITIONED);
    cache.setBackups(1);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setIndexedTypes(Integer.class, Integer.class);
    cfg.setCacheConfiguration(cache);
    cfg.setLocalHost("127.0.0.1");
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
    ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500..47501"));
    disco.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(disco);
    cfg.setConnectorConfiguration(new ConnectorConfiguration());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 32 with TcpDiscoveryVmIpFinder

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

the class IgfsEventsAbstractSelfTest method getConfiguration.

/**
 * The same as getConfiguration(String igniteInstanceName) but it sets custom IGFS configuration
 *
 * @param igniteInstanceName Ignite instance name.
 * @param igfsCfg IGFS configuration.
 * @return Grid configuration.
 * @throws Exception If failed.
 */
protected IgniteConfiguration getConfiguration(String igniteInstanceName, FileSystemConfiguration igfsCfg) throws Exception {
    IgniteConfiguration cfg = IgnitionEx.loadConfiguration("config/hadoop/default-config.xml").get1();
    assert cfg != null;
    cfg.setIgniteInstanceName(igniteInstanceName);
    cfg.setIncludeEventTypes(concat(EVTS_IGFS, EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED));
    cfg.setFileSystemConfiguration(igfsCfg);
    cfg.setHadoopConfiguration(null);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(discoSpi);
    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 33 with TcpDiscoveryVmIpFinder

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

the class BinaryTreeSelfTest method configuration.

/**
 * Create configuration.
 *
 * @param name Node name.
 * @param client Client mode flag.
 * @return Configuration.
 */
private static IgniteConfiguration configuration(String name, boolean client) {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName(name);
    cfg.setClientMode(client);
    cfg.setLocalHost("127.0.0.1");
    cfg.setPeerClassLoadingEnabled(false);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
    ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500"));
    discoSpi.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(discoSpi);
    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    cfg.setCacheConfiguration(ccfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) 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 34 with TcpDiscoveryVmIpFinder

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

the class GridCacheNearOneNodeSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
    IgniteConfiguration cfg = super.getConfiguration();
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(disco);
    CacheConfiguration cacheCfg = defaultCacheConfiguration();
    cacheCfg.setCacheMode(PARTITIONED);
    cacheCfg.setBackups(1);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cacheCfg.setCacheStoreFactory(singletonFactory(store));
    cacheCfg.setReadThrough(true);
    cacheCfg.setWriteThrough(true);
    cacheCfg.setLoadPreviousValue(true);
    cfg.setCacheConfiguration(cacheCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) 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 35 with TcpDiscoveryVmIpFinder

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

the class GridCacheLocalLoadAllSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(disco);
    CacheConfiguration ccfg = defaultCacheConfiguration();
    ccfg.setName("test-cache");
    ccfg.setCacheMode(LOCAL);
    ccfg.setCacheStoreFactory(singletonFactory(new TestStore()));
    ccfg.setReadThrough(true);
    ccfg.setWriteThrough(true);
    ccfg.setLoadPreviousValue(true);
    cfg.setCacheConfiguration(ccfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) 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