use of org.apache.ignite.internal.managers.systemview.GridSystemViewManager in project ignite by apache.
the class GridBinaryCacheEntryMemorySizeSelfTest method createMarshaller.
/**
* {@inheritDoc}
*/
@Override
protected Marshaller createMarshaller() throws IgniteCheckedException {
BinaryMarshaller marsh = new BinaryMarshaller();
IgniteConfiguration iCfg = new IgniteConfiguration();
iCfg.setDiscoverySpi(new TcpDiscoverySpi() {
@Override
public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
// No-op.
}
});
iCfg.setClientMode(false);
iCfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi() {
@Override
protected void register(SystemView<?> sysView) {
// No-op.
}
});
GridTestKernalContext kernCtx = new GridTestKernalContext(log, iCfg);
kernCtx.add(new GridSystemViewManager(kernCtx));
kernCtx.add(new GridDiscoveryManager(kernCtx));
MarshallerContextTestImpl marshCtx = new MarshallerContextTestImpl(null);
marshCtx.onMarshallerProcessorStarted(kernCtx, null);
marsh.setContext(marshCtx);
BinaryContext pCtx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg, new NullLogger());
marsh.setBinaryContext(pCtx, iCfg);
return marsh;
}
use of org.apache.ignite.internal.managers.systemview.GridSystemViewManager in project ignite by apache.
the class BinaryMarshallerSelfTest method binaryMarshaller.
/**
* @return Binary marshaller.
*/
protected BinaryMarshaller binaryMarshaller(BinaryNameMapper nameMapper, BinaryIdMapper mapper, BinarySerializer serializer, Collection<BinaryTypeConfiguration> cfgs, Collection<String> excludedClasses) throws IgniteCheckedException {
IgniteConfiguration iCfg = new IgniteConfiguration();
BinaryConfiguration bCfg = new BinaryConfiguration();
bCfg.setNameMapper(nameMapper);
bCfg.setIdMapper(mapper);
bCfg.setSerializer(serializer);
bCfg.setCompactFooter(compactFooter());
bCfg.setTypeConfigurations(cfgs);
iCfg.setBinaryConfiguration(bCfg);
iCfg.setClientMode(false);
iCfg.setDiscoverySpi(new TcpDiscoverySpi() {
@Override
public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
// No-op.
}
});
iCfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger());
BinaryMarshaller marsh = new BinaryMarshaller();
MarshallerContextTestImpl marshCtx = new MarshallerContextTestImpl(null, excludedClasses);
GridTestKernalContext kernCtx = new GridTestKernalContext(log, iCfg);
kernCtx.add(new GridSystemViewManager(kernCtx));
kernCtx.add(new GridDiscoveryManager(kernCtx));
marshCtx.onMarshallerProcessorStarted(kernCtx, null);
marsh.setContext(marshCtx);
marsh.setBinaryContext(ctx, iCfg);
return marsh;
}
use of org.apache.ignite.internal.managers.systemview.GridSystemViewManager in project ignite by apache.
the class GridManagerStopSelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
ctx = newContext();
ctx.config().setPeerClassLoadingEnabled(true);
ctx.config().setMBeanServer(ManagementFactory.getPlatformMBeanServer());
ctx.add(new PoolProcessor(ctx));
ctx.add(new NoOpIgniteSecurityProcessor(ctx));
ctx.add(new GridResourceProcessor(ctx));
ctx.add(new GridSystemViewManager(ctx));
ctx.start();
}
use of org.apache.ignite.internal.managers.systemview.GridSystemViewManager 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.managers.systemview.GridSystemViewManager 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);
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, null);
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);
}
Aggregations