use of org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi 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.JmxSystemViewExporterSpi 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.JmxSystemViewExporterSpi in project ignite by apache.
the class StandaloneGridKernalContext method prepareIgniteConfiguration.
/**
* @return Ignite configuration which allows to start requied processors for WAL reader
*/
protected IgniteConfiguration prepareIgniteConfiguration() {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setDiscoverySpi(new StandaloneNoopDiscoverySpi());
cfg.setCommunicationSpi(new StandaloneNoopCommunicationSpi());
final Marshaller marshaller = new BinaryMarshaller();
cfg.setMarshaller(marshaller);
final DataStorageConfiguration pstCfg = new DataStorageConfiguration();
final DataRegionConfiguration regCfg = new DataRegionConfiguration();
regCfg.setPersistenceEnabled(true);
pstCfg.setDefaultDataRegionConfiguration(regCfg);
cfg.setDataStorageConfiguration(pstCfg);
marshaller.setContext(marshallerCtx);
cfg.setMetricExporterSpi(new NoopMetricExporterSpi());
cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
cfg.setGridLogger(log);
return cfg;
}
use of org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi in project ignite by apache.
the class GridAbstractTest method newContext.
/**
* @return Test kernal context.
*/
protected GridTestKernalContext newContext() throws IgniteCheckedException {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setClientMode(false);
cfg.setDiscoverySpi(new TcpDiscoverySpi() {
@Override
public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
// No-op.
}
});
cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi() {
@Override
protected void register(SystemView<?> sysView) {
// No-op.
}
});
GridTestKernalContext ctx = new GridTestKernalContext(log(), cfg);
return ctx;
}
use of org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi 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);
}
Aggregations