Search in sources :

Example 91 with TcpCommunicationSpi

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

the class TxOptimisticDeadlockDetectionCrossCacheTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    if (isDebug()) {
        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
        discoSpi.failureDetectionTimeoutEnabled(false);
        cfg.setDiscoverySpi(discoSpi);
    }
    TcpCommunicationSpi commSpi = new TestCommunicationSpi();
    cfg.setCommunicationSpi(commSpi);
    CacheConfiguration ccfg0 = defaultCacheConfiguration();
    ccfg0.setName("cache0");
    ccfg0.setCacheMode(CacheMode.PARTITIONED);
    ccfg0.setBackups(1);
    ccfg0.setNearConfiguration(null);
    CacheConfiguration ccfg1 = defaultCacheConfiguration();
    ccfg1.setName("cache1");
    ccfg1.setCacheMode(CacheMode.PARTITIONED);
    ccfg1.setBackups(1);
    ccfg1.setNearConfiguration(null);
    cfg.setCacheConfiguration(ccfg0, ccfg1);
    return cfg;
}
Also used : 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)

Example 92 with TcpCommunicationSpi

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

the class CacheKeepBinaryIterationTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    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 93 with TcpCommunicationSpi

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

the class ClientReconnectContinuousQueryTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    TcpCommunicationSpi commSpi = (TcpCommunicationSpi) cfg.getCommunicationSpi();
    commSpi.setSlowClientQueueLimit(50);
    commSpi.setIdleConnectionTimeout(300_000);
    if (getTestIgniteInstanceName(CLIENT_IDX).equals(gridName))
        cfg.setClientMode(true);
    else {
        CacheConfiguration ccfg = defaultCacheConfiguration();
        cfg.setCacheConfiguration(ccfg);
    }
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 94 with TcpCommunicationSpi

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

the class ClientReconnectContinuousQueryTest method skipRead.

/**
 * @param igniteClient Ignite client.
 * @param skip Skip.
 */
private void skipRead(IgniteEx igniteClient, boolean skip) {
    GridIoManager ioMgr = igniteClient.context().io();
    TcpCommunicationSpi commSpi = (TcpCommunicationSpi) ((Object[]) U.field(ioMgr, "spis"))[0];
    GridNioServer nioSrvr = U.field(commSpi, "nioSrvr");
    GridTestUtils.setFieldValue(nioSrvr, "skipRead", skip);
}
Also used : GridIoManager(org.apache.ignite.internal.managers.communication.GridIoManager) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) GridNioServer(org.apache.ignite.internal.util.nio.GridNioServer)

Example 95 with TcpCommunicationSpi

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

the class GridCacheContinuousQueryAbstractSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setPeerClassLoadingEnabled(peerClassLoadingEnabled());
    if (!igniteInstanceName.equals(NO_CACHE_IGNITE_INSTANCE_NAME)) {
        CacheConfiguration cacheCfg = defaultCacheConfiguration();
        cacheCfg.setCacheMode(cacheMode());
        cacheCfg.setAtomicityMode(atomicityMode());
        cacheCfg.setNearConfiguration(nearConfiguration());
        cacheCfg.setRebalanceMode(ASYNC);
        cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
        cacheCfg.setCacheStoreFactory(new StoreFactory());
        cacheCfg.setReadThrough(true);
        cacheCfg.setWriteThrough(true);
        cacheCfg.setLoadPreviousValue(true);
        cfg.setCacheConfiguration(cacheCfg);
    } else
        cfg.setClientMode(true);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(disco);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) 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