Search in sources :

Example 11 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi 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 12 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class JdbcConnectionSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME), cacheConfiguration(CUSTOM_CACHE_NAME));
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(disco);
    cfg.setDaemon(daemon);
    cfg.setClientMode(client);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 13 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class RedisProtocolSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setLocalHost(HOST);
    assert cfg.getConnectorConfiguration() == null;
    ConnectorConfiguration redisCfg = new ConnectorConfiguration();
    redisCfg.setHost(HOST);
    redisCfg.setPort(PORT);
    cfg.setConnectorConfiguration(redisCfg);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(disco);
    CacheConfiguration ccfg = defaultCacheConfiguration();
    ccfg.setStatisticsEnabled(true);
    ccfg.setIndexedTypes(String.class, String.class);
    cfg.setCacheConfiguration(ccfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 14 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class AbstractJdbcPojoQuerySelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration<?, ?> cache = defaultCacheConfiguration();
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setAtomicityMode(TRANSACTIONAL);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(disco);
    cfg.setConnectorConfiguration(new ConnectorConfiguration());
    QueryEntity queryEntity = new QueryEntity();
    queryEntity.setKeyType("java.lang.String");
    queryEntity.setValueType("org.apache.ignite.internal.JdbcTestObject");
    queryEntity.addQueryField("id", "java.lang.Integer", null);
    queryEntity.addQueryField("testObject", "org.apache.ignite.internal.JdbcTestObject2", null);
    queryEntity.setIndexes(Collections.singletonList(new QueryIndex("id")));
    cache.setQueryEntities(Collections.singletonList(queryEntity));
    cfg.setCacheConfiguration(cache);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) QueryIndex(org.apache.ignite.cache.QueryIndex) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) QueryEntity(org.apache.ignite.cache.QueryEntity) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 15 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class RestProcessorTest method cacheTestConfiguration.

/**
     * @param cfg Initial configuration.
     * @return Final configuration.
     */
@SuppressWarnings({ "unchecked" })
private IgniteConfiguration cacheTestConfiguration(IgniteConfiguration cfg) {
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
    ipFinder.setShared(true);
    disco.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(disco);
    assert cfg.getConnectorConfiguration() == null;
    ConnectorConfiguration clientCfg = new ConnectorConfiguration();
    // Ensure - no authentication.
    clientCfg.setSecretKey(null);
    cfg.setConnectorConfiguration(clientCfg);
    cfg.setCacheConfiguration(defaultCacheConfiguration());
    return cfg;
}
Also used : TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)650 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)633 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)287 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)73 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)69 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)55 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)36 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)34 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)31 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)31 IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)21 ArrayList (java.util.ArrayList)15 Ignite (org.apache.ignite.Ignite)13 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)11 MemoryConfiguration (org.apache.ignite.configuration.MemoryConfiguration)11 QueryEntity (org.apache.ignite.cache.QueryEntity)10 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)10 DiscoverySpi (org.apache.ignite.spi.discovery.DiscoverySpi)10 MemoryEventStorageSpi (org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi)10 LruEvictionPolicy (org.apache.ignite.cache.eviction.lru.LruEvictionPolicy)9