Search in sources :

Example 61 with DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.

the class MigratingToWalV2SerializerWithCompactionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setPeerClassLoadingEnabled(false);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)).setWalSegmentSize(WAL_SEGMENT_SIZE).setWalCompactionEnabled(true).setWalMode(WALMode.LOG_ONLY).setWalHistorySize(200);
    cfg.setDataStorageConfiguration(memCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 62 with DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.

the class IgniteKernal method ackMemoryConfiguration.

/**
 */
private void ackMemoryConfiguration() {
    DataStorageConfiguration memCfg = cfg.getDataStorageConfiguration();
    if (memCfg == null)
        return;
    U.log(log, "System cache's DataRegion size is configured to " + (memCfg.getSystemRegionInitialSize() / (1024 * 1024)) + " MB. " + "Use DataStorageConfiguration.systemCacheMemorySize property to change the setting.");
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration)

Example 63 with DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.

the class IgniteClusterActivateDeactivateTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    if (testReconnectSpi) {
        TcpDiscoverySpi spi = new IgniteClientReconnectAbstractTest.TestTcpDiscoverySpi();
        cfg.setDiscoverySpi(spi);
        spi.setJoinTimeout(2 * 60_000);
    }
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
    cfg.setConsistentId(igniteInstanceName);
    cfg.setClientMode(client);
    cfg.setActiveOnStart(active);
    if (ccfgs != null) {
        cfg.setCacheConfiguration(ccfgs);
        ccfgs = null;
    }
    DataStorageConfiguration memCfg = new DataStorageConfiguration();
    memCfg.setPageSize(4 * 1024);
    memCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(300 * 1024 * 1024).setPersistenceEnabled(persistenceEnabled()));
    memCfg.setDataRegionConfigurations(new DataRegionConfiguration().setMaxSize(300 * 1024 * 1024).setName(NO_PERSISTENCE_REGION).setPersistenceEnabled(false));
    if (persistenceEnabled())
        memCfg.setWalMode(WALMode.LOG_ONLY);
    cfg.setDataStorageConfiguration(memCfg);
    if (testSpi) {
        TestRecordingCommunicationSpi spi = new TestRecordingCommunicationSpi();
        if (testSpiRecord != null)
            spi.record(testSpiRecord);
        cfg.setCommunicationSpi(spi);
    }
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 64 with DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.

the class IgniteClusterActivateDeactivateTestWithPersistence method activateCachesRestore.

/**
 * @param srvs Number of server nodes.
 * @param withNewCaches If {@code true} then after restart has new caches in configuration.
 * @throws Exception If failed.
 */
private void activateCachesRestore(int srvs, boolean withNewCaches) throws Exception {
    Map<Integer, Integer> cacheData = startGridsAndLoadData(srvs);
    stopAllGrids();
    for (int i = 0; i < srvs; i++) {
        if (withNewCaches)
            ccfgs = cacheConfigurations2();
        startGrid(i);
    }
    Ignite srv = ignite(0);
    checkNoCaches(srvs);
    srv.active(true);
    final int CACHES = withNewCaches ? 4 : 2;
    for (int i = 0; i < srvs; i++) {
        for (int c = 0; c < CACHES; c++) checkCache(ignite(i), CACHE_NAME_PREFIX + c, true);
    }
    DataStorageConfiguration dsCfg = srv.configuration().getDataStorageConfiguration();
    checkCachesData(cacheData, dsCfg);
    checkCaches(srvs, CACHES);
    int nodes = srvs;
    client = false;
    startGrid(nodes++);
    for (int i = 0; i < nodes; i++) {
        for (int c = 0; c < CACHES; c++) checkCache(ignite(i), CACHE_NAME_PREFIX + c, true);
    }
    checkCaches(nodes, CACHES);
    client = true;
    startGrid(nodes++);
    for (int c = 0; c < CACHES; c++) checkCache(ignite(nodes - 1), CACHE_NAME_PREFIX + c, false);
    checkCaches(nodes, CACHES);
    for (int i = 0; i < nodes; i++) {
        for (int c = 0; c < CACHES; c++) checkCache(ignite(i), CACHE_NAME_PREFIX + c, true);
    }
    checkCachesData(cacheData, dsCfg);
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) Ignite(org.apache.ignite.Ignite)

Example 65 with DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration in project ignite by apache.

the class LargeEntryUpdateTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setPublicThreadPoolSize(THREAD_COUNT);
    DataStorageConfiguration mem = new DataStorageConfiguration();
    mem.setPageSize(PAGE_SIZE);
    cfg.setDataStorageConfiguration(mem);
    CacheConfiguration[] ccfgs = new CacheConfiguration[CACHE_COUNT];
    for (int i = 0; i < CACHE_COUNT; ++i) {
        CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
        ccfg.setName(CACHE_PREFIX + i);
        ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
        ccfg.setCacheMode(CacheMode.PARTITIONED);
        ccfgs[i] = ccfg;
    }
    cfg.setCacheConfiguration(ccfgs);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Aggregations

DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)143 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)120 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)119 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)55 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)51 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)33 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)17 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)7 File (java.io.File)6 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)6 ArrayList (java.util.ArrayList)4 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)4 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)4 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)4 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)3 IgniteOutOfMemoryException (org.apache.ignite.internal.mem.IgniteOutOfMemoryException)3 IOException (java.io.IOException)2 LinkedHashMap (java.util.LinkedHashMap)2 QueryEntity (org.apache.ignite.cache.QueryEntity)2 QueryIndex (org.apache.ignite.cache.QueryIndex)2