Search in sources :

Example 46 with TcpCommunicationSpi

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

the class GridSingleSplitsRedeployLoadTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
    IgniteConfiguration cfg = super.getConfiguration();
    CommunicationSpi commSpi = new TcpCommunicationSpi();
    cfg.setCommunicationSpi(commSpi);
    DiscoverySpi discoSpi = new TcpDiscoverySpi();
    cfg.setDiscoverySpi(discoSpi);
    cfg.setDeploymentMode(DeploymentMode.CONTINUOUS);
    return cfg;
}
Also used : CommunicationSpi(org.apache.ignite.spi.communication.CommunicationSpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) DiscoverySpi(org.apache.ignite.spi.discovery.DiscoverySpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 47 with TcpCommunicationSpi

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

the class GridCacheAbstractFullApiSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setForceServerMode(true);
    int[] evtTypes = cfg.getIncludeEventTypes();
    if (evtTypes == null || evtTypes.length == 0)
        cfg.setIncludeEventTypes(EventType.EVT_CACHE_OBJECT_READ);
    else {
        for (int evtType : evtTypes) {
            if (evtType == EventType.EVT_CACHE_OBJECT_READ)
                return cfg;
        }
        int[] updatedEvtTypes = Arrays.copyOf(evtTypes, evtTypes.length + 1);
        updatedEvtTypes[updatedEvtTypes.length - 1] = EventType.EVT_CACHE_OBJECT_READ;
    }
    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 48 with TcpCommunicationSpi

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

the class IgniteCacheContainsKeyAbstractSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    cfg.setCommunicationSpi(commSpi);
    TransactionConfiguration tcfg = new TransactionConfiguration();
    tcfg.setTxSerializableEnabled(true);
    cfg.setTransactionConfiguration(tcfg);
    return cfg;
}
Also used : TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)

Example 49 with TcpCommunicationSpi

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

the class IgniteCacheIncrementTxTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    if (getTestIgniteInstanceName(SRVS).equals(igniteInstanceName))
        cfg.setClientMode(true);
    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 50 with TcpCommunicationSpi

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

the class GridAbstractTest method getConfiguration.

/**
 * This method should be overridden by subclasses to change configuration parameters.
 *
 * @return Grid configuration used for starting of grid.
 * @param igniteInstanceName Ignite instance name.
 * @param rsrcs Resources.
 * @throws Exception If failed.
 */
@SuppressWarnings("deprecation")
protected IgniteConfiguration getConfiguration(String igniteInstanceName, IgniteTestResources rsrcs) throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName(igniteInstanceName);
    cfg.setGridLogger(rsrcs.getLogger());
    cfg.setMarshaller(rsrcs.getMarshaller());
    cfg.setNodeId(rsrcs.getNodeId());
    cfg.setIgniteHome(rsrcs.getIgniteHome());
    cfg.setMBeanServer(rsrcs.getMBeanServer());
    cfg.setPeerClassLoadingEnabled(true);
    cfg.setMetricsLogFrequency(0);
    cfg.setConnectorConfiguration(null);
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    commSpi.setLocalPort(GridTestUtils.getNextCommPort(getClass()));
    commSpi.setTcpNoDelay(true);
    cfg.setCommunicationSpi(commSpi);
    TcpDiscoverySpi discoSpi = new TestTcpDiscoverySpi();
    if (isDebug()) {
        cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
        cfg.setNetworkTimeout(Long.MAX_VALUE / 3);
    } else {
        // Set network timeout to 10 sec to avoid unexpected p2p class loading errors.
        cfg.setNetworkTimeout(10_000);
        cfg.setFailureDetectionTimeout(10_000);
        cfg.setClientFailureDetectionTimeout(10_000);
    }
    // Set metrics update interval to 1 second to speed up tests.
    cfg.setMetricsUpdateFrequency(1000);
    String mcastAddr = GridTestUtils.getNextMulticastGroup(getClass());
    TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
    ipFinder.setAddresses(Collections.singleton("127.0.0.1:" + TcpDiscoverySpi.DFLT_PORT));
    if (!F.isEmpty(mcastAddr)) {
        ipFinder.setMulticastGroup(mcastAddr);
        ipFinder.setMulticastPort(GridTestUtils.getNextMulticastPort(getClass()));
    }
    discoSpi.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(discoSpi);
    SharedFsCheckpointSpi cpSpi = new SharedFsCheckpointSpi();
    Collection<String> paths = new ArrayList<>();
    paths.add(getDefaultCheckpointPath(cfg.getMarshaller()));
    cpSpi.setDirectoryPaths(paths);
    cfg.setCheckpointSpi(cpSpi);
    cfg.setEventStorageSpi(new MemoryEventStorageSpi());
    cfg.setIncludeEventTypes(EventType.EVTS_ALL);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryMulticastIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder) SharedFsCheckpointSpi(org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi) ArrayList(java.util.ArrayList) MemoryEventStorageSpi(org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi) TestTcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TestTcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi) 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