Search in sources :

Example 6 with TcpCommunicationSpi

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

the class CacheContinuousQueryOrderingEventTest 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);
    cfg.setClientMode(client);
    MemoryEventStorageSpi storeSpi = new MemoryEventStorageSpi();
    storeSpi.setExpireCount(100);
    cfg.setEventStorageSpi(storeSpi);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) MemoryEventStorageSpi(org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 7 with TcpCommunicationSpi

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

the class IgniteHadoopFileSystemIpcCacheSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(discoSpi);
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName("igfs");
    igfsCfg.setManagementPort(FileSystemConfiguration.DFLT_MGMT_PORT + cnt);
    igfsCfg.setDataCacheConfiguration(dataCacheConfiguration());
    igfsCfg.setMetaCacheConfiguration(metaCacheConfiguration());
    IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration();
    endpointCfg.setType(IgfsIpcEndpointType.SHMEM);
    endpointCfg.setPort(IpcSharedMemoryServerEndpoint.DFLT_IPC_PORT + cnt);
    igfsCfg.setIpcEndpointConfiguration(endpointCfg);
    // Together with group blocks mapper will yield 64M per node groups.
    igfsCfg.setBlockSize(512 * 1024);
    cfg.setFileSystemConfiguration(igfsCfg);
    cfg.setCacheConfiguration(dataCacheConfiguration());
    cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    commSpi.setSharedMemoryPort(-1);
    cfg.setCommunicationSpi(commSpi);
    cnt++;
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 8 with TcpCommunicationSpi

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

the class IgniteCacheFullTextQueryNodeJoiningSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    CacheConfiguration cache = new CacheConfiguration(DEFAULT_CACHE_NAME);
    cache.setCacheMode(PARTITIONED);
    cache.setAtomicityMode(atomicityMode());
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setBackups(1);
    QueryEntity qryEntity = new QueryEntity();
    qryEntity.setKeyType(AffinityKey.class.getName());
    qryEntity.setValueType(IndexedEntity.class.getName());
    LinkedHashMap<String, String> fields = new LinkedHashMap<>();
    fields.put("val", String.class.getName());
    qryEntity.setFields(fields);
    qryEntity.setIndexes(Arrays.asList(new QueryIndex("val", QueryIndexType.FULLTEXT)));
    cache.setQueryEntities(Arrays.asList(qryEntity));
    cfg.setCacheConfiguration(cache);
    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) QueryIndex(org.apache.ignite.cache.QueryIndex) QueryEntity(org.apache.ignite.cache.QueryEntity) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) AffinityKey(org.apache.ignite.cache.affinity.AffinityKey) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) LinkedHashMap(java.util.LinkedHashMap) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 9 with TcpCommunicationSpi

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

the class GridCacheAbstractRemoveFailureTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER).setForceServerMode(true);
    if (testClientNode() && getTestIgniteInstanceName(0).equals(igniteInstanceName))
        cfg.setClientMode(true);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)

Example 10 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)

Aggregations

TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)109 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)94 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)72 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)29 MemoryEventStorageSpi (org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi)8 CommunicationSpi (org.apache.ignite.spi.communication.CommunicationSpi)6 ClusterNode (org.apache.ignite.cluster.ClusterNode)5 AtomicConfiguration (org.apache.ignite.configuration.AtomicConfiguration)5 TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)5 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)5 HashMap (java.util.HashMap)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 IgniteException (org.apache.ignite.IgniteException)3 GridIoManager (org.apache.ignite.internal.managers.communication.GridIoManager)3 DiscoverySpi (org.apache.ignite.spi.discovery.DiscoverySpi)3 ArrayList (java.util.ArrayList)2 CountDownLatch (java.util.concurrent.CountDownLatch)2