use of org.apache.ignite.internal.processors.cache.CacheDiagnosticManager in project ignite by apache.
the class IndexStoragePageMemoryImplTest method memory.
/**
* @param clean Clean flag. If {@code true}, will clean previous memory state and allocate
* new empty page memory.
* @return Page memory instance.
*/
@Override
protected PageMemory memory(boolean clean) throws Exception {
long[] sizes = new long[10];
for (int i = 0; i < sizes.length; i++) sizes[i] = 1024 * 1024;
DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), allocationPath);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setEncryptionSpi(new NoopEncryptionSpi());
cfg.setMetricExporterSpi(new NoopMetricExporterSpi());
cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
cfg.setDataStorageConfiguration(new DataStorageConfiguration());
GridTestKernalContext cctx = new GridTestKernalContext(log, cfg);
cctx.add(new IgnitePluginProcessor(cctx, cfg, Collections.emptyList()));
cctx.add(new GridInternalSubscriptionProcessor(cctx));
cctx.add(new PerformanceStatisticsProcessor(cctx));
cctx.add(new GridEncryptionManager(cctx));
cctx.add(new GridMetricManager(cctx));
cctx.add(new GridSystemViewManager(cctx));
GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(cctx, null, null, null, new NoOpPageStoreManager(), new NoOpWALManager(), null, new IgniteCacheDatabaseSharedManager(), null, null, null, null, null, null, null, null, null, null, null, null, new CacheDiagnosticManager());
IgniteOutClosure<CheckpointProgress> clo = () -> Mockito.mock(CheckpointProgressImpl.class);
return new PageMemoryImpl(provider, sizes, sharedCtx, sharedCtx.pageStore(), 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) {
}
}, () -> true, new DataRegionMetricsImpl(new DataRegionConfiguration(), cctx), PageMemoryImpl.ThrottlingPolicy.DISABLED, clo);
}
use of org.apache.ignite.internal.processors.cache.CacheDiagnosticManager in project ignite by apache.
the class BPlusTreePageMemoryImplTest method createPageMemory.
/**
* {@inheritDoc}
*/
@Override
protected PageMemory createPageMemory() throws Exception {
long[] sizes = new long[CPUS + 1];
for (int i = 0; i < sizes.length; i++) sizes[i] = 1024 * MB / CPUS;
sizes[CPUS] = 10 * MB;
DirectMemoryProvider provider = new UnsafeMemoryProvider(log);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setEncryptionSpi(new NoopEncryptionSpi());
cfg.setMetricExporterSpi(new NoopMetricExporterSpi());
cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
cfg.setDataStorageConfiguration(new DataStorageConfiguration());
GridTestKernalContext cctx = new GridTestKernalContext(log, cfg);
cctx.add(new IgnitePluginProcessor(cctx, cfg, Collections.emptyList()));
cctx.add(new GridInternalSubscriptionProcessor(cctx));
cctx.add(new PerformanceStatisticsProcessor(cctx));
cctx.add(new GridEncryptionManager(cctx));
cctx.add(new GridMetricManager(cctx));
cctx.add(new GridSystemViewManager(cctx));
GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(cctx, null, null, null, new NoOpPageStoreManager(), new NoOpWALManager(), null, new IgniteCacheDatabaseSharedManager(), null, null, null, null, null, null, null, null, null, null, null, null, new CacheDiagnosticManager());
IgniteOutClosure<CheckpointProgress> clo = new IgniteOutClosure<CheckpointProgress>() {
@Override
public CheckpointProgress apply() {
return Mockito.mock(CheckpointProgressImpl.class);
}
};
PageMemory mem = new PageMemoryImpl(provider, sizes, sharedCtx, sharedCtx.pageStore(), PAGE_SIZE, (fullPageId, byteBuf, tag) -> {
assert false : "No page replacement should happen during the test";
}, new CIX3<Long, FullPageId, PageMemoryEx>() {
@Override
public void applyx(Long aLong, FullPageId fullPageId, PageMemoryEx ex) {
}
}, () -> true, new DataRegionMetricsImpl(new DataRegionConfiguration(), cctx), PageMemoryImpl.ThrottlingPolicy.DISABLED, clo);
mem.start();
return mem;
}
Aggregations