use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class ClientBinaryMarshaller method createImpl.
/**
* Create new marshaller implementation.
*/
private GridBinaryMarshaller createImpl(BinaryConfiguration binCfg) {
IgniteConfiguration igniteCfg = new IgniteConfiguration();
if (binCfg == null) {
binCfg = new BinaryConfiguration();
binCfg.setCompactFooter(false);
}
igniteCfg.setBinaryConfiguration(binCfg);
BinaryContext ctx = new BinaryContext(metaHnd, igniteCfg, new NullLogger());
BinaryMarshaller marsh = new BinaryMarshaller();
marsh.setContext(marshCtx);
ctx.configure(marsh, binCfg);
ctx.registerUserTypesSchema();
return new GridBinaryMarshaller(ctx);
}
use of org.apache.ignite.logger.NullLogger in project ignite by apache.
the class JdbcThinConnectionSelfTest method getBinaryContext.
/**
* Returns new binary context.
*
* @return New binary context.
*/
private BinaryContext getBinaryContext() {
BinaryMarshaller marsh = new BinaryMarshaller();
marsh.setContext(getFakeMarshallerCtx());
BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), new IgniteConfiguration(), new NullLogger());
ctx.configure(marsh);
ctx.registerUserTypesSchema();
return ctx;
}
use of org.apache.ignite.logger.NullLogger 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.logger.NullLogger in project ignite by apache.
the class BasicWarmupClosure method apply.
/**
* {@inheritDoc}
*/
@Override
public void apply(IgniteConfiguration gridCfg) {
// Remove cache duplicates, clean up the rest, etc.
IgniteConfiguration cfg = prepareConfiguration(gridCfg);
// Do nothing if no caches found.
if (cfg == null)
return;
out("Starting grids to warmup caches [gridCnt=" + gridCnt + ", caches=" + cfg.getCacheConfiguration().length + ']');
Collection<Ignite> ignites = new LinkedList<>();
String old = System.getProperty(IgniteSystemProperties.IGNITE_UPDATE_NOTIFIER);
try {
System.setProperty(IgniteSystemProperties.IGNITE_UPDATE_NOTIFIER, "false");
TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
for (int i = 0; i < gridCnt; i++) {
IgniteConfiguration cfg0 = new IgniteConfiguration(cfg);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
discoSpi.setLocalPort(discoveryPort);
cfg0.setDiscoverySpi(discoSpi);
cfg0.setGridLogger(new NullLogger());
cfg0.setIgniteInstanceName("ignite-warmup-grid-" + i);
ignites.add(Ignition.start(cfg0));
}
doWarmup(ignites);
} catch (Exception e) {
throw new IgniteException(e);
} finally {
for (Ignite ignite : ignites) Ignition.stop(ignite.name(), false);
out("Stopped warmup grids.");
if (old == null)
old = "false";
System.setProperty(IgniteSystemProperties.IGNITE_UPDATE_NOTIFIER, old);
}
}
use of org.apache.ignite.logger.NullLogger 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;
}
Aggregations