Search in sources :

Example 46 with DataRegionConfiguration

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

the class IgniteDbAbstractTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration();
    if (client)
        cfg.setClientMode(true);
    dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
    if (isLargePage())
        dbCfg.setPageSize(16 * 1024);
    else
        dbCfg.setPageSize(4 * 1024);
    dbCfg.setWalMode(WALMode.LOG_ONLY);
    dbCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setName("default"));
    configure(dbCfg);
    cfg.setDataStorageConfiguration(dbCfg);
    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    if (indexingEnabled())
        ccfg.setIndexedTypes(Integer.class, DbValue.class);
    ccfg.setAtomicityMode(TRANSACTIONAL);
    ccfg.setWriteSynchronizationMode(FULL_SYNC);
    ccfg.setRebalanceMode(SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    CacheConfiguration ccfg2 = new CacheConfiguration("non-primitive");
    if (indexingEnabled())
        ccfg2.setIndexedTypes(DbKey.class, DbValue.class);
    ccfg2.setAtomicityMode(TRANSACTIONAL);
    ccfg2.setWriteSynchronizationMode(FULL_SYNC);
    ccfg2.setRebalanceMode(SYNC);
    ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
    CacheConfiguration ccfg3 = new CacheConfiguration("large");
    if (indexingEnabled())
        ccfg3.setIndexedTypes(Integer.class, LargeDbValue.class);
    ccfg3.setAtomicityMode(TRANSACTIONAL);
    ccfg3.setWriteSynchronizationMode(FULL_SYNC);
    ccfg3.setRebalanceMode(SYNC);
    ccfg3.setAffinity(new RendezvousAffinityFunction(false, 32));
    CacheConfiguration ccfg4 = new CacheConfiguration("tiny");
    ccfg4.setAtomicityMode(TRANSACTIONAL);
    ccfg4.setWriteSynchronizationMode(FULL_SYNC);
    ccfg4.setRebalanceMode(SYNC);
    ccfg4.setAffinity(new RendezvousAffinityFunction(1, null));
    CacheConfiguration ccfg5 = new CacheConfiguration("atomic");
    if (indexingEnabled())
        ccfg5.setIndexedTypes(DbKey.class, DbValue.class);
    ccfg5.setAtomicityMode(ATOMIC);
    ccfg5.setWriteSynchronizationMode(FULL_SYNC);
    ccfg5.setRebalanceMode(SYNC);
    ccfg5.setAffinity(new RendezvousAffinityFunction(false, 32));
    if (!client)
        cfg.setCacheConfiguration(ccfg, ccfg2, ccfg3, ccfg4, ccfg5);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(discoSpi);
    cfg.setMarshaller(null);
    configure(cfg);
    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 47 with DataRegionConfiguration

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

the class SwapPathConstructionSelfTest method createMemoryConfiguration.

/**
 * @param isRelativePath flag is set to {@code true} if relative path should be used for data region configuration.
 */
private DataStorageConfiguration createMemoryConfiguration(boolean isRelativePath) {
    DataStorageConfiguration memCfg = new DataStorageConfiguration();
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setName("default");
    memPlcCfg.setMaxSize(20 * 1024 * 1024);
    if (isRelativePath)
        memPlcCfg.setSwapPath(RELATIVE_SWAP_PATH);
    else
        memPlcCfg.setSwapPath(Paths.get(getTmpDir(), ABSOLUTE_SWAP_PATH).toString());
    memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    return memCfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration)

Example 48 with DataRegionConfiguration

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

the class TxPessimisticDeadlockDetectionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    if (isDebug()) {
        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
        discoSpi.failureDetectionTimeoutEnabled(false);
        cfg.setDiscoverySpi(discoSpi);
    }
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_MAX_SIZE * 10).setName("dfltPlc"));
    cfg.setDataStorageConfiguration(memCfg);
    cfg.setClientMode(client);
    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)

Example 49 with DataRegionConfiguration

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

the class DataRegionMetricsSelfTest method beforeTest.

/**
 * {@inheritDoc}
 */
@Override
protected void beforeTest() throws Exception {
    DataRegionConfiguration plcCfg = new DataRegionConfiguration();
    memMetrics = new DataRegionMetricsImpl(plcCfg);
    memMetrics.enableMetrics();
}
Also used : DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)

Example 50 with DataRegionConfiguration

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

the class BPlusTreeBenchmark method createPageMemory.

/**
 * @return Page memory.
 * @throws Exception If failed.
 */
private PageMemory createPageMemory() throws Exception {
    long[] sizes = new long[CPUS];
    for (int i = 0; i < sizes.length; i++) sizes[i] = 1024 * MB / CPUS;
    DataRegionConfiguration plcCfg = new DataRegionConfiguration().setMaxSize(1024 * MB);
    PageMemory pageMem = new PageMemoryNoStoreImpl(new JavaLogger(), new UnsafeMemoryProvider(new JavaLogger()), null, PAGE_SIZE, plcCfg, new DataRegionMetricsImpl(plcCfg), false);
    pageMem.start();
    return pageMem;
}
Also used : DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl) PageMemory(org.apache.ignite.internal.pagemem.PageMemory) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) JavaLogger(org.apache.ignite.logger.java.JavaLogger) UnsafeMemoryProvider(org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)

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