Search in sources :

Example 41 with DataRegionConfiguration

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

the class PageMemoryImplNoLoadTest method memory.

/**
 * @return Page memory implementation.
 */
@Override
protected PageMemory memory() throws Exception {
    File memDir = U.resolveWorkDirectory(U.defaultWorkDirectory(), "pagemem", false);
    long[] sizes = new long[10];
    for (int i = 0; i < sizes.length; i++) sizes[i] = 5 * 1024 * 1024;
    DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), memDir);
    GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(new GridTestKernalContext(log), null, null, null, new NoOpPageStoreManager(), new NoOpWALManager(), null, new IgniteCacheDatabaseSharedManager(), null, null, null, null, null, null, null, null);
    return new PageMemoryImpl(provider, sizes, sharedCtx, PAGE_SIZE, (fullPageId, byteBuf, tag) -> {
        assert false : "No page replacement (rotation with disk) should happen during the test";
    }, new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {

        @Override
        public void applyx(Long page, FullPageId fullId, PageMemoryEx pageMem) {
        }
    }, new CheckpointLockStateChecker() {

        @Override
        public boolean checkpointLockIsHeldByThread() {
            return true;
        }
    }, new DataRegionMetricsImpl(new DataRegionConfiguration()), PageMemoryImpl.ThrottlingPolicy.DISABLED, null);
}
Also used : MappedFileMemoryProvider(org.apache.ignite.internal.mem.file.MappedFileMemoryProvider) GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) GridCacheSharedContext(org.apache.ignite.internal.processors.cache.GridCacheSharedContext) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) DirectMemoryProvider(org.apache.ignite.internal.mem.DirectMemoryProvider) File(java.io.File) CheckpointLockStateChecker(org.apache.ignite.internal.processors.cache.persistence.CheckpointLockStateChecker) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager) FullPageId(org.apache.ignite.internal.pagemem.FullPageId)

Example 42 with DataRegionConfiguration

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

the class IgniteDataStorageMetricsSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setConsistentId(gridName);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(10 * 1024 * 1024).setPersistenceEnabled(true).setMetricsEnabled(true).setName("dflt-plc")).setDataRegionConfigurations(new DataRegionConfiguration().setMaxSize(10 * 1024 * 1024).setPersistenceEnabled(false).setMetricsEnabled(true).setName("no-persistence")).setWalMode(WALMode.LOG_ONLY).setPageSize(4 * 1024).setMetricsEnabled(true);
    cfg.setDataStorageConfiguration(memCfg);
    cfg.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false));
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
    cfg.setCacheConfiguration(cacheConfiguration(GROUP1, "cache", PARTITIONED, ATOMIC, 1, null), cacheConfiguration(null, "cache-np", PARTITIONED, ATOMIC, 1, "no-persistence"));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 43 with DataRegionConfiguration

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

the class IgnitePdsBinaryMetadataOnClusterRestartTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    if (customWorkSubDir != null)
        cfg.setWorkDirectory(Paths.get(U.defaultWorkDirectory(), customWorkSubDir).toString());
    cfg.setClientMode(clientMode);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setWalMode(WALMode.LOG_ONLY).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(100 * 1024 * 1024)));
    BinaryConfiguration bCfg = new BinaryConfiguration();
    BinaryTypeConfiguration binaryEnumCfg = new BinaryTypeConfiguration(EnumType.class.getName());
    binaryEnumCfg.setEnum(true);
    binaryEnumCfg.setEnumValues(F.asMap(EnumType.ENUM_VAL_0.name(), EnumType.ENUM_VAL_0.ordinal(), EnumType.ENUM_VAL_1.name(), EnumType.ENUM_VAL_1.ordinal()));
    bCfg.setTypeConfigurations(Arrays.asList(binaryEnumCfg));
    cfg.setBinaryConfiguration(bCfg);
    CacheKeyConfiguration dynamicMetaKeyCfg = new CacheKeyConfiguration(DYNAMIC_TYPE_NAME, DYNAMIC_INT_FIELD_NAME);
    cfg.setCacheKeyConfiguration(dynamicMetaKeyCfg);
    cfg.setCacheConfiguration(new CacheConfiguration().setName(CACHE_NAME).setAffinity(new RendezvousAffinityFunction()).setCacheMode(CacheMode.REPLICATED));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) CacheKeyConfiguration(org.apache.ignite.cache.CacheKeyConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) BinaryTypeConfiguration(org.apache.ignite.binary.BinaryTypeConfiguration) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 44 with DataRegionConfiguration

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

the class IgniteChangeGlobalStateAbstractTest method getConfiguration.

/**
 * @param gridName Grid name.
 */
@Override
protected IgniteConfiguration getConfiguration(final String gridName) throws Exception {
    final IgniteConfiguration cfg = super.getConfiguration(gridName);
    DataStorageConfiguration pCfg = new DataStorageConfiguration();
    pCfg.setStoragePath(testName() + "/db");
    pCfg.setWalArchivePath(testName() + "/db/wal/archive");
    pCfg.setWalPath(testName() + "/db/wal");
    pCfg.setPageSize(1024);
    pCfg.setConcurrencyLevel(64);
    pCfg.setWalMode(WALMode.LOG_ONLY);
    pCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024).setPersistenceEnabled(true));
    cfg.setDataStorageConfiguration(pCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 45 with DataRegionConfiguration

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

the class IgniteCheckpointDirtyPagesForLowLoadTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    List<CacheConfiguration> ccfgs = new ArrayList<>();
    for (int g = 0; g < GROUPS; g++) {
        for (int i = 0; i < CACHES_IN_GRP; i++) {
            CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>().setName("dummyCache" + i + "." + g).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL).setGroupName("dummyGroup" + g).setAffinity(new RendezvousAffinityFunction(false, PARTS));
            ccfgs.add(ccfg);
        }
    }
    cfg.setCacheConfiguration(ccfgs.toArray(new CacheConfiguration[ccfgs.size()]));
    DataStorageConfiguration dsCfg = new DataStorageConfiguration();
    // smaller page to reduce overhead to short values
    dsCfg.setPageSize(1024);
    dsCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true));
    dsCfg.setCheckpointFrequency(500);
    dsCfg.setWalMode(WALMode.LOG_ONLY);
    dsCfg.setWalHistorySize(1);
    cfg.setDataStorageConfiguration(dsCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ArrayList(java.util.ArrayList) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

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