Search in sources :

Example 6 with MemoryEventStorageSpi

use of org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi in project ignite by apache.

the class CacheContinuousQueryOrderingEventTest method getConfiguration.

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

Example 7 with MemoryEventStorageSpi

use of org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi in project ignite by apache.

the class GridCacheReplicatedPreloadSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setRebalanceThreadPoolSize(2);
    cfg.setCacheConfiguration(cacheConfiguration(igniteInstanceName));
    cfg.setDeploymentMode(CONTINUOUS);
    cfg.setUserAttributes(F.asMap("EVEN", !igniteInstanceName.endsWith("0") && !igniteInstanceName.endsWith("2")));
    MemoryEventStorageSpi spi = new MemoryEventStorageSpi();
    spi.setExpireCount(50_000);
    cfg.setEventStorageSpi(spi);
    if (disableP2p)
        cfg.setPeerClassLoadingEnabled(false);
    if (getTestIgniteInstanceName(1).equals(igniteInstanceName) || useExtClassLoader || cfg.getMarshaller() instanceof BinaryMarshaller)
        cfg.setClassLoader(getExternalClassLoader());
    if (cutromEvt) {
        int[] evts = new int[EVTS_ALL.length + 1];
        evts[0] = Integer.MAX_VALUE - 1;
        System.arraycopy(EVTS_ALL, 0, evts, 1, EVTS_ALL.length);
        cfg.setIncludeEventTypes(evts);
    }
    cfg.setIncludeEventTypes(EventType.EVTS_ALL);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) MemoryEventStorageSpi(org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi)

Example 8 with MemoryEventStorageSpi

use of org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi in project ignite by apache.

the class CacheContinuousQueryAsyncFilterListenerTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    MemoryEventStorageSpi storeSpi = new MemoryEventStorageSpi();
    storeSpi.setExpireCount(1000);
    cfg.setEventStorageSpi(storeSpi);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) MemoryEventStorageSpi(org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi)

Example 9 with MemoryEventStorageSpi

use of org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi in project ignite by apache.

the class AgentClusterDemo method igniteConfiguration.

/**
 * Configure node.
 *
 * @param basePort Base port.
 * @param gridIdx Ignite instance name index.
 * @param client If {@code true} then start client node.
 * @return IgniteConfiguration
 */
private static IgniteConfiguration igniteConfiguration(int basePort, int gridIdx, boolean client) throws IgniteCheckedException {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName((client ? CLN_NODE_NAME : SRV_NODE_NAME) + gridIdx);
    cfg.setLocalHost("127.0.0.1");
    cfg.setEventStorageSpi(new MemoryEventStorageSpi());
    cfg.setConsistentId(cfg.getIgniteInstanceName());
    File workDir = new File(U.workDirectory(null, null), "demo-work");
    cfg.setWorkDirectory(workDir.getAbsolutePath());
    int[] evts = new int[EVTS_DISCOVERY.length + VISOR_TASK_EVTS.length];
    System.arraycopy(EVTS_DISCOVERY, 0, evts, 0, EVTS_DISCOVERY.length);
    System.arraycopy(VISOR_TASK_EVTS, 0, evts, EVTS_DISCOVERY.length, VISOR_TASK_EVTS.length);
    cfg.setIncludeEventTypes(evts);
    cfg.getConnectorConfiguration().setPort(basePort);
    System.setProperty(IGNITE_JETTY_PORT, String.valueOf(basePort + 10));
    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
    int discoPort = basePort + 20;
    ipFinder.setAddresses(Collections.singletonList("127.0.0.1:" + discoPort + ".." + (discoPort + NODE_CNT - 1)));
    // Configure discovery SPI.
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setLocalPort(discoPort);
    discoSpi.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(discoSpi);
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    commSpi.setSharedMemoryPort(-1);
    commSpi.setMessageQueueLimit(10);
    int commPort = basePort + 30;
    commSpi.setLocalPort(commPort);
    cfg.setCommunicationSpi(commSpi);
    cfg.setGridLogger(new Slf4jLogger(log));
    cfg.setMetricsLogFrequency(0);
    DataRegionConfiguration dataRegCfg = new DataRegionConfiguration();
    dataRegCfg.setName("demo");
    dataRegCfg.setMetricsEnabled(true);
    dataRegCfg.setMaxSize(DFLT_DATA_REGION_INITIAL_SIZE);
    dataRegCfg.setPersistenceEnabled(true);
    DataStorageConfiguration dataStorageCfg = new DataStorageConfiguration();
    dataStorageCfg.setMetricsEnabled(true);
    dataStorageCfg.setStoragePath(PdsConsistentIdProcessor.DB_DEFAULT_FOLDER);
    dataStorageCfg.setDefaultDataRegionConfiguration(dataRegCfg);
    dataStorageCfg.setSystemRegionMaxSize(DFLT_DATA_REGION_INITIAL_SIZE);
    dataStorageCfg.setWalMode(LOG_ONLY);
    dataStorageCfg.setWalSegments(WAL_SEGMENTS);
    dataStorageCfg.setWalSegmentSize(WAL_SEGMENT_SZ);
    cfg.setDataStorageConfiguration(dataStorageCfg);
    if (client)
        cfg.setClientMode(true);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) Slf4jLogger(org.apache.ignite.logger.slf4j.Slf4jLogger) MemoryEventStorageSpi(org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi) File(java.io.File) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 10 with MemoryEventStorageSpi

use of org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi in project ignite by apache.

the class IgniteCacheAbstractTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    TcpDiscoverySpi disco = (TcpDiscoverySpi) cfg.getDiscoverySpi();
    disco.setForceServerMode(true);
    if (isDebug())
        disco.setAckTimeout(Integer.MAX_VALUE);
    MemoryEventStorageSpi evtSpi = new MemoryEventStorageSpi();
    evtSpi.setExpireCount(100);
    cfg.setEventStorageSpi(evtSpi);
    cfg.setDiscoverySpi(disco);
    cfg.setCacheConfiguration(cacheConfiguration(igniteInstanceName));
    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)

Aggregations

MemoryEventStorageSpi (org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi)16 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)13 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)8 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)5 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)3 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 Ignite (org.apache.ignite.Ignite)2 BinaryBasicNameMapper (org.apache.ignite.binary.BinaryBasicNameMapper)2 AtomicConfiguration (org.apache.ignite.configuration.AtomicConfiguration)2 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)2 ExecutorConfiguration (org.apache.ignite.configuration.ExecutorConfiguration)2 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)2 TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)2 NoOpFailureHandler (org.apache.ignite.failure.NoOpFailureHandler)2 StopNodeFailureHandler (org.apache.ignite.failure.StopNodeFailureHandler)2 StopNodeOrHaltFailureHandler (org.apache.ignite.failure.StopNodeOrHaltFailureHandler)2 PlatformDotNetBinaryConfiguration (org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration)2 EventStorageSpi (org.apache.ignite.spi.eventstorage.EventStorageSpi)2 NoopEventStorageSpi (org.apache.ignite.spi.eventstorage.NoopEventStorageSpi)2