Search in sources :

Example 56 with DataRegionConfiguration

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

the class PagesWriteThrottleSandboxTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi) cfg.getDiscoverySpi();
    discoverySpi.setIpFinder(ipFinder);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(4000L * 1024 * 1024).setCheckpointPageBufferSize(1000L * 1000 * 1000).setName("dfltDataRegion").setMetricsEnabled(true).setPersistenceEnabled(true)).setWalMode(WALMode.BACKGROUND).setCheckpointFrequency(20_000).setWriteThrottlingEnabled(true);
    cfg.setDataStorageConfiguration(dbCfg);
    CacheConfiguration ccfg1 = new CacheConfiguration();
    ccfg1.setName(CACHE_NAME);
    ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg1.setAffinity(new RendezvousAffinityFunction(false, 64));
    cfg.setCacheConfiguration(ccfg1);
    cfg.setConsistentId(gridName);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 57 with DataRegionConfiguration

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

the class IgniteOutOfMemoryPropagationTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    DataStorageConfiguration memCfg = new DataStorageConfiguration();
    memCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(10 * 1024 * 1024 + 1));
    cfg.setDataStorageConfiguration(memCfg);
    CacheConfiguration<Object, Object> baseCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    baseCfg.setAtomicityMode(this.atomicityMode);
    baseCfg.setCacheMode(this.mode);
    baseCfg.setBackups(this.backupsCnt);
    baseCfg.setWriteSynchronizationMode(this.writeSyncMode);
    cfg.setCacheConfiguration(baseCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 58 with DataRegionConfiguration

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

the class IgnitePdsCacheRebalancingAbstractTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setConsistentId(gridName);
    CacheConfiguration ccfg1 = cacheConfiguration(cacheName).setPartitionLossPolicy(PartitionLossPolicy.READ_WRITE_SAFE).setBackups(2).setRebalanceMode(CacheRebalanceMode.ASYNC).setIndexedTypes(Integer.class, Integer.class).setAffinity(new RendezvousAffinityFunction(false, 32)).setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    CacheConfiguration ccfg2 = cacheConfiguration("indexed");
    ccfg2.setBackups(1);
    ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    QueryEntity qryEntity = new QueryEntity(Integer.class.getName(), TestValue.class.getName());
    LinkedHashMap<String, String> fields = new LinkedHashMap<>();
    fields.put("v1", Integer.class.getName());
    fields.put("v2", Integer.class.getName());
    qryEntity.setFields(fields);
    QueryIndex qryIdx = new QueryIndex("v1", true);
    qryEntity.setIndexes(Collections.singleton(qryIdx));
    ccfg2.setQueryEntities(Collections.singleton(qryEntity));
    // Do not start filtered cache on coordinator.
    if (gridName.endsWith("0")) {
        cfg.setCacheConfiguration(ccfg1, ccfg2);
    } else {
        CacheConfiguration ccfg3 = cacheConfiguration("filtered");
        ccfg3.setPartitionLossPolicy(PartitionLossPolicy.READ_ONLY_SAFE);
        ccfg3.setBackups(1);
        ccfg3.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
        ccfg3.setNodeFilter(new CoordinatorNodeFilter());
        cfg.setCacheConfiguration(ccfg1, ccfg2, ccfg3);
    }
    DataStorageConfiguration memCfg = new DataStorageConfiguration();
    memCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
    memCfg.setPageSize(1024);
    memCfg.setWalMode(WALMode.LOG_ONLY);
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setName("dfltDataRegion");
    memPlcCfg.setMaxSize(150 * 1024 * 1024);
    memPlcCfg.setInitialSize(100 * 1024 * 1024);
    memPlcCfg.setSwapPath("work/swap");
    memPlcCfg.setPersistenceEnabled(true);
    memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    cfg.setDataStorageConfiguration(memCfg);
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
    return cfg;
}
Also used : QueryEntity(org.apache.ignite.cache.QueryEntity) LinkedHashMap(java.util.LinkedHashMap) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) QueryIndex(org.apache.ignite.cache.QueryIndex) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 59 with DataRegionConfiguration

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

the class IgnitePdsPageReplacementTest method createDbConfig.

/**
 * @return DB config.
 */
private DataStorageConfiguration createDbConfig() {
    final DataStorageConfiguration memCfg = new DataStorageConfiguration();
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setInitialSize(MEMORY_LIMIT);
    memPlcCfg.setMaxSize(MEMORY_LIMIT);
    memPlcCfg.setPageEvictionMode(DataPageEvictionMode.RANDOM_LRU);
    memPlcCfg.setName("dfltDataRegion");
    memPlcCfg.setPersistenceEnabled(true);
    memCfg.setPageSize(PAGE_SIZE);
    memCfg.setConcurrencyLevel(NUMBER_OF_SEGMENTS);
    memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    memCfg.setWalMode(WALMode.LOG_ONLY);
    return memCfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration)

Example 60 with DataRegionConfiguration

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

the class PageEvictionAbstractTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration();
    DataRegionConfiguration plc = new DataRegionConfiguration();
    // This will test additional segment allocation.
    plc.setInitialSize(SIZE / 2);
    plc.setMaxSize(SIZE);
    plc.setEmptyPagesPoolSize(EMPTY_PAGES_POOL_SIZE);
    plc.setEvictionThreshold(EVICTION_THRESHOLD);
    plc.setName(DEFAULT_POLICY_NAME);
    dbCfg.setDefaultDataRegionConfiguration(plc);
    dbCfg.setPageSize(PAGE_SIZE);
    cfg.setDataStorageConfiguration(dbCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)147 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)119 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)108 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)48 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)45 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)33 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)16 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)15 UnsafeMemoryProvider (org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)10 PageMemory (org.apache.ignite.internal.pagemem.PageMemory)9 DirectMemoryProvider (org.apache.ignite.internal.mem.DirectMemoryProvider)8 File (java.io.File)7 PageMemoryNoStoreImpl (org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl)7 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 MappedFileMemoryProvider (org.apache.ignite.internal.mem.file.MappedFileMemoryProvider)5 FullPageId (org.apache.ignite.internal.pagemem.FullPageId)5 GridCacheSharedContext (org.apache.ignite.internal.processors.cache.GridCacheSharedContext)5 IgniteCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)5 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)4 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)4