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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations