Search in sources :

Example 81 with TcpCommunicationSpi

use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.

the class IgniteCacheLockFailoverSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)

Example 82 with TcpCommunicationSpi

use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.

the class IgniteCacheEntryProcessorNodeJoinTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration());
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    commSpi.setSharedMemoryPort(-1);
    cfg.setCommunicationSpi(commSpi);
    cfg.setDiscoverySpi(disco);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 83 with TcpCommunicationSpi

use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.

the class GridCacheDhtPreloadPerformanceTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
    CacheConfiguration cc = defaultCacheConfiguration();
    cc.setCacheMode(CacheMode.PARTITIONED);
    cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cc.setRebalanceMode(CacheRebalanceMode.SYNC);
    cc.setAffinity(new RendezvousAffinityFunction(false, 1300));
    cc.setBackups(2);
    CacheConfiguration cc1 = defaultCacheConfiguration();
    cc1.setName("cc1");
    cc1.setCacheMode(CacheMode.PARTITIONED);
    cc1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cc1.setRebalanceMode(CacheRebalanceMode.SYNC);
    cc1.setAffinity(new RendezvousAffinityFunction(false, 1300));
    cc1.setBackups(2);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(ipFinder);
    c.setDiscoverySpi(disco);
    c.setIgfsThreadPoolSize(1);
    c.setSystemThreadPoolSize(2);
    c.setPublicThreadPoolSize(2);
    c.setManagementThreadPoolSize(1);
    c.setUtilityCachePoolSize(2);
    c.setPeerClassLoadingThreadPoolSize(1);
    c.setCacheConfiguration(cc, cc1);
    TcpCommunicationSpi comm = new TcpCommunicationSpi();
    comm.setSharedMemoryPort(-1);
    c.setCommunicationSpi(comm);
    return c;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 84 with TcpCommunicationSpi

use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.

the class IgnitePdsTransactionsHangTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(discoSpi);
    BinaryConfiguration binaryCfg = new BinaryConfiguration();
    binaryCfg.setCompactFooter(false);
    cfg.setBinaryConfiguration(binaryCfg);
    cfg.setPeerClassLoadingEnabled(true);
    TcpCommunicationSpi tcpCommSpi = new TcpCommunicationSpi();
    tcpCommSpi.setSharedMemoryPort(-1);
    cfg.setCommunicationSpi(tcpCommSpi);
    TransactionConfiguration txCfg = new TransactionConfiguration();
    txCfg.setDefaultTxIsolation(TransactionIsolation.READ_COMMITTED);
    cfg.setTransactionConfiguration(txCfg);
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setName("dfltDataRegion");
    memPlcCfg.setInitialSize(PAGE_CACHE_SIZE * 1024 * 1024);
    memPlcCfg.setMaxSize(PAGE_CACHE_SIZE * 1024 * 1024);
    memPlcCfg.setPersistenceEnabled(true);
    DataStorageConfiguration memCfg = new DataStorageConfiguration();
    memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    memCfg.setWalHistorySize(1);
    memCfg.setCheckpointFrequency(CHECKPOINT_FREQUENCY);
    memCfg.setPageSize(PAGE_SIZE * 1024);
    cfg.setDataStorageConfiguration(memCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 85 with TcpCommunicationSpi

use of org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi in project ignite by apache.

the class GridCacheRebalancingSyncSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration iCfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) iCfg.getDiscoverySpi()).setIpFinder(ipFinder);
    ((TcpDiscoverySpi) iCfg.getDiscoverySpi()).setForceServerMode(true);
    TcpCommunicationSpi commSpi = new CountingCommunicationSpi();
    commSpi.setLocalPort(GridTestUtils.getNextCommPort(getClass()));
    commSpi.setTcpNoDelay(true);
    iCfg.setCommunicationSpi(commSpi);
    if (getTestIgniteInstanceName(10).equals(igniteInstanceName))
        iCfg.setClientMode(true);
    CacheConfiguration<Integer, Integer> cachePCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    cachePCfg.setName(CACHE_NAME_DHT_PARTITIONED);
    cachePCfg.setCacheMode(CacheMode.PARTITIONED);
    cachePCfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    cachePCfg.setBackups(1);
    cachePCfg.setRebalanceBatchSize(1);
    cachePCfg.setRebalanceBatchesPrefetchCount(1);
    cachePCfg.setRebalanceOrder(2);
    CacheConfiguration<Integer, Integer> cachePCfg2 = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    cachePCfg2.setName(CACHE_NAME_DHT_PARTITIONED_2);
    cachePCfg2.setCacheMode(CacheMode.PARTITIONED);
    cachePCfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
    cachePCfg2.setBackups(1);
    cachePCfg2.setRebalanceOrder(2);
    // cachePCfg2.setRebalanceDelay(5000);//Known issue, possible deadlock in case of low priority cache rebalancing delayed.
    CacheConfiguration<Integer, Integer> cacheRCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    cacheRCfg.setName(CACHE_NAME_DHT_REPLICATED);
    cacheRCfg.setCacheMode(CacheMode.REPLICATED);
    cacheRCfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    cacheRCfg.setRebalanceBatchSize(1);
    cacheRCfg.setRebalanceBatchesPrefetchCount(Integer.MAX_VALUE);
    // Shmem fail fix for Integer.MAX_VALUE.
    ((TcpCommunicationSpi) iCfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    CacheConfiguration<Integer, Integer> cacheRCfg2 = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    cacheRCfg2.setName(CACHE_NAME_DHT_REPLICATED_2);
    cacheRCfg2.setCacheMode(CacheMode.REPLICATED);
    cacheRCfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
    cacheRCfg2.setRebalanceOrder(4);
    iCfg.setCacheConfiguration(cachePCfg, cachePCfg2, cacheRCfg, cacheRCfg2);
    iCfg.setRebalanceThreadPoolSize(3);
    return iCfg;
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)113 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)98 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)75 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)30 MemoryEventStorageSpi (org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi)8 TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)6 CommunicationSpi (org.apache.ignite.spi.communication.CommunicationSpi)6 AtomicConfiguration (org.apache.ignite.configuration.AtomicConfiguration)5 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)5 HashMap (java.util.HashMap)4 IgniteException (org.apache.ignite.IgniteException)4 ClusterNode (org.apache.ignite.cluster.ClusterNode)4 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)4 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)4 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)4 IgniteSpiException (org.apache.ignite.spi.IgniteSpiException)4 LinkedHashMap (java.util.LinkedHashMap)3 UUID (java.util.UUID)3 DiscoverySpi (org.apache.ignite.spi.discovery.DiscoverySpi)3 ArrayList (java.util.ArrayList)2