Search in sources :

Example 11 with NoopMetricExporterSpi

use of org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi in project ignite by apache.

the class CacheFreeListSelfTest method createFreeList.

/**
 * @param pageSize Page size.
 * @return Free list.
 * @throws Exception If failed.
 */
private FreeList<CacheDataRow> createFreeList(int pageSize) throws Exception {
    DataRegionConfiguration plcCfg = new DataRegionConfiguration().setInitialSize(1024 * MB).setMaxSize(1024 * MB);
    pageMem = createPageMemory(pageSize, plcCfg);
    long metaPageId = pageMem.allocatePage(1, 1, PageIdAllocator.FLAG_DATA);
    IgniteConfiguration cfg = new IgniteConfiguration().setMetricExporterSpi(new NoopMetricExporterSpi());
    GridTestKernalContext ctx = new GridTestKernalContext(new GridTestLog4jLogger(), cfg);
    ctx.add(new GridMetricManager(ctx));
    ctx.add(new PerformanceStatisticsProcessor(ctx));
    DataRegionMetricsImpl regionMetrics = new DataRegionMetricsImpl(plcCfg, ctx);
    DataRegion dataRegion = new DataRegion(pageMem, plcCfg, regionMetrics, new NoOpPageEvictionTracker());
    PageLockTrackerManager pageLockTrackerManager = mock(PageLockTrackerManager.class);
    when(pageLockTrackerManager.createPageLockTracker(anyString())).thenReturn(PageLockTrackerManager.NOOP_LSNR);
    return new CacheFreeList(1, "freelist", dataRegion, null, metaPageId, true, pageLockTrackerManager, new GridTestKernalContext(log), null, PageIdAllocator.FLAG_IDX);
}
Also used : GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) CacheFreeList(org.apache.ignite.internal.processors.cache.persistence.freelist.CacheFreeList) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) PageLockTrackerManager(org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.PageLockTrackerManager) PerformanceStatisticsProcessor(org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsProcessor) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) NoOpPageEvictionTracker(org.apache.ignite.internal.processors.cache.persistence.evict.NoOpPageEvictionTracker) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) NoopMetricExporterSpi(org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi) GridMetricManager(org.apache.ignite.internal.processors.metric.GridMetricManager) GridTestLog4jLogger(org.apache.ignite.testframework.junits.logger.GridTestLog4jLogger) DataRegion(org.apache.ignite.internal.processors.cache.persistence.DataRegion)

Example 12 with NoopMetricExporterSpi

use of org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi in project ignite by apache.

the class GridManagerStopSelfTest method testStopCommunicationManager.

/**
 * @throws Exception If failed.
 */
@Test
public void testStopCommunicationManager() throws Exception {
    CommunicationSpi spi = new TcpCommunicationSpi();
    injectLogger(spi);
    ctx.config().setCommunicationSpi(spi);
    ctx.config().setMarshaller(new BinaryMarshaller());
    ctx.config().setMetricExporterSpi(new NoopMetricExporterSpi());
    ctx.add(new GridMetricManager(ctx));
    GridIoManager mgr = new GridIoManager(ctx);
    mgr.onKernalStop(true);
    mgr.stop(false);
}
Also used : CommunicationSpi(org.apache.ignite.spi.communication.CommunicationSpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) GridIoManager(org.apache.ignite.internal.managers.communication.GridIoManager) NoopMetricExporterSpi(org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi) GridMetricManager(org.apache.ignite.internal.processors.metric.GridMetricManager) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

NoopMetricExporterSpi (org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi)12 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)11 GridMetricManager (org.apache.ignite.internal.processors.metric.GridMetricManager)9 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)8 GridTestKernalContext (org.apache.ignite.testframework.junits.GridTestKernalContext)8 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)7 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)7 PerformanceStatisticsProcessor (org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsProcessor)7 JmxSystemViewExporterSpi (org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi)6 NoopEncryptionSpi (org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi)6 GridEncryptionManager (org.apache.ignite.internal.managers.encryption.GridEncryptionManager)5 GridSystemViewManager (org.apache.ignite.internal.managers.systemview.GridSystemViewManager)5 DirectMemoryProvider (org.apache.ignite.internal.mem.DirectMemoryProvider)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 CheckpointProgress (org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress)5 IgnitePluginProcessor (org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor)5 GridInternalSubscriptionProcessor (org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor)5 UnsafeMemoryProvider (org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)3