Search in sources :

Example 1 with CacheDiagnosticManager

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);
}
Also used : IgnitePluginProcessor(org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor) CheckpointProgress(org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress) GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) GridCacheSharedContext(org.apache.ignite.internal.processors.cache.GridCacheSharedContext) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DirectMemoryProvider(org.apache.ignite.internal.mem.DirectMemoryProvider) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) MappedFileMemoryProvider(org.apache.ignite.internal.mem.file.MappedFileMemoryProvider) GridEncryptionManager(org.apache.ignite.internal.managers.encryption.GridEncryptionManager) NoopEncryptionSpi(org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi) GridInternalSubscriptionProcessor(org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor) CacheDiagnosticManager(org.apache.ignite.internal.processors.cache.CacheDiagnosticManager) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) JmxSystemViewExporterSpi(org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi) PerformanceStatisticsProcessor(org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsProcessor) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) GridSystemViewManager(org.apache.ignite.internal.managers.systemview.GridSystemViewManager) NoopMetricExporterSpi(org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi) GridMetricManager(org.apache.ignite.internal.processors.metric.GridMetricManager) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)

Example 2 with CacheDiagnosticManager

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;
}
Also used : IgnitePluginProcessor(org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor) CheckpointProgress(org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress) GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) GridCacheSharedContext(org.apache.ignite.internal.processors.cache.GridCacheSharedContext) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DirectMemoryProvider(org.apache.ignite.internal.mem.DirectMemoryProvider) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) GridEncryptionManager(org.apache.ignite.internal.managers.encryption.GridEncryptionManager) NoopEncryptionSpi(org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi) GridInternalSubscriptionProcessor(org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor) CacheDiagnosticManager(org.apache.ignite.internal.processors.cache.CacheDiagnosticManager) PageMemory(org.apache.ignite.internal.pagemem.PageMemory) IgniteOutClosure(org.apache.ignite.lang.IgniteOutClosure) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) JmxSystemViewExporterSpi(org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi) PerformanceStatisticsProcessor(org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsProcessor) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) GridSystemViewManager(org.apache.ignite.internal.managers.systemview.GridSystemViewManager) NoopMetricExporterSpi(org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi) GridMetricManager(org.apache.ignite.internal.processors.metric.GridMetricManager) UnsafeMemoryProvider(org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)

Aggregations

DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)2 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)2 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)2 GridEncryptionManager (org.apache.ignite.internal.managers.encryption.GridEncryptionManager)2 GridSystemViewManager (org.apache.ignite.internal.managers.systemview.GridSystemViewManager)2 JmxSystemViewExporterSpi (org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi)2 DirectMemoryProvider (org.apache.ignite.internal.mem.DirectMemoryProvider)2 FullPageId (org.apache.ignite.internal.pagemem.FullPageId)2 CacheDiagnosticManager (org.apache.ignite.internal.processors.cache.CacheDiagnosticManager)2 GridCacheSharedContext (org.apache.ignite.internal.processors.cache.GridCacheSharedContext)2 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)2 IgniteCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)2 CheckpointProgress (org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress)2 GridMetricManager (org.apache.ignite.internal.processors.metric.GridMetricManager)2 PerformanceStatisticsProcessor (org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsProcessor)2 IgnitePluginProcessor (org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor)2 GridInternalSubscriptionProcessor (org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor)2 NoopEncryptionSpi (org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi)2 NoopMetricExporterSpi (org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi)2 GridTestKernalContext (org.apache.ignite.testframework.junits.GridTestKernalContext)2