Search in sources :

Example 21 with TcpCommunicationSpi

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

the class IgniteCacheGetRestartTest 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);
    Boolean clientMode = client.get();
    if (clientMode != null) {
        cfg.setClientMode(clientMode);
        client.remove();
    }
    cfg.setConsistentId(igniteInstanceName);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 22 with TcpCommunicationSpi

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

the class IgniteCacheMessageRecoveryAbstractTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    commSpi.setSocketWriteTimeout(1000);
    commSpi.setSharedMemoryPort(-1);
    commSpi.setConnectionsPerNode(connectionsPerNode());
    cfg.setCommunicationSpi(commSpi);
    CacheConfiguration ccfg = defaultCacheConfiguration();
    ccfg.setCacheMode(PARTITIONED);
    ccfg.setAtomicityMode(atomicityMode());
    ccfg.setBackups(1);
    ccfg.setNearConfiguration(null);
    ccfg.setWriteSynchronizationMode(FULL_SYNC);
    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 23 with TcpCommunicationSpi

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

the class GridCacheAbstractDataStructuresFailoverSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    AtomicConfiguration atomicCfg = new AtomicConfiguration();
    atomicCfg.setCacheMode(collectionCacheMode());
    atomicCfg.setBackups(collectionConfiguration().getBackups());
    cfg.setAtomicConfiguration(atomicCfg);
    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    ccfg.setName(TRANSACTIONAL_CACHE_NAME);
    ccfg.setAtomicityMode(TRANSACTIONAL);
    cfg.setCacheConfiguration(ccfg);
    if (client) {
        cfg.setClientMode(client);
        ((TcpDiscoverySpi) (cfg.getDiscoverySpi())).setForceServerMode(true);
    }
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) AtomicConfiguration(org.apache.ignite.configuration.AtomicConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 24 with TcpCommunicationSpi

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

the class IgniteCacheAtomicMessageRecoveryPairedConnectionsTest method getConfiguration.

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

Example 25 with TcpCommunicationSpi

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

the class GridCachePutAllFailoverSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    cfg.setPeerClassLoadingEnabled(false);
    cfg.setDeploymentMode(DeploymentMode.CONTINUOUS);
    TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
    discoverySpi.setAckTimeout(60000);
    discoverySpi.setIpFinder(ipFinder);
    discoverySpi.setForceServerMode(true);
    cfg.setDiscoverySpi(discoverySpi);
    if (igniteInstanceName.startsWith("master")) {
        cfg.setClientMode(true);
        cfg.setUserAttributes(ImmutableMap.of("segment", "master"));
        // For sure.
        failoverSpi.setMaximumFailoverAttempts(100);
        cfg.setFailoverSpi(failoverSpi);
    } else if (igniteInstanceName.startsWith("worker")) {
        cfg.setUserAttributes(ImmutableMap.of("segment", "worker"));
        CacheConfiguration cacheCfg = defaultCacheConfiguration();
        cacheCfg.setName("partitioned");
        cacheCfg.setAtomicityMode(atomicityMode());
        cacheCfg.setCacheMode(PARTITIONED);
        cacheCfg.setBackups(backups);
        cacheCfg.setNearConfiguration(nearEnabled ? new NearCacheConfiguration() : null);
        cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
        cfg.setCacheConfiguration(cacheCfg);
    } else
        throw new IllegalStateException("Unexpected Ignite instance name: " + igniteInstanceName);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration)

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