Search in sources :

Example 1 with NullLogger

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);
}
Also used : NullLogger(org.apache.ignite.logger.NullLogger) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) GridBinaryMarshaller(org.apache.ignite.internal.binary.GridBinaryMarshaller) GridBinaryMarshaller(org.apache.ignite.internal.binary.GridBinaryMarshaller) BinaryContext(org.apache.ignite.internal.binary.BinaryContext)

Example 2 with NullLogger

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;
}
Also used : NullLogger(org.apache.ignite.logger.NullLogger) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) BinaryContext(org.apache.ignite.internal.binary.BinaryContext)

Example 3 with NullLogger

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;
}
Also used : BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) JmxSystemViewExporterSpi(org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi) MarshallerContextTestImpl(org.apache.ignite.marshaller.MarshallerContextTestImpl) DiscoverySpiCustomMessage(org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage) GridDiscoveryManager(org.apache.ignite.internal.managers.discovery.GridDiscoveryManager) NullLogger(org.apache.ignite.logger.NullLogger) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) GridSystemViewManager(org.apache.ignite.internal.managers.systemview.GridSystemViewManager) IgniteException(org.apache.ignite.IgniteException) BinaryContext(org.apache.ignite.internal.binary.BinaryContext) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 4 with NullLogger

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);
    }
}
Also used : NullLogger(org.apache.ignite.logger.NullLogger) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) IgniteException(org.apache.ignite.IgniteException) Ignite(org.apache.ignite.Ignite) TcpDiscoveryIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder) LinkedList(java.util.LinkedList) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 5 with NullLogger

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;
}
Also used : GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) JmxSystemViewExporterSpi(org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi) MarshallerContextTestImpl(org.apache.ignite.marshaller.MarshallerContextTestImpl) DiscoverySpiCustomMessage(org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage) GridDiscoveryManager(org.apache.ignite.internal.managers.discovery.GridDiscoveryManager) NullLogger(org.apache.ignite.logger.NullLogger) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) GridSystemViewManager(org.apache.ignite.internal.managers.systemview.GridSystemViewManager) IgniteException(org.apache.ignite.IgniteException) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

NullLogger (org.apache.ignite.logger.NullLogger)23 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)17 BinaryContext (org.apache.ignite.internal.binary.BinaryContext)10 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)10 MarshallerContextTestImpl (org.apache.ignite.marshaller.MarshallerContextTestImpl)10 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)8 Test (org.junit.Test)6 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)4 IgniteException (org.apache.ignite.IgniteException)4 GridBinaryMarshaller (org.apache.ignite.internal.binary.GridBinaryMarshaller)4 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)4 Ignite (org.apache.ignite.Ignite)3 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)3 File (java.io.File)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 BinaryTypeConfiguration (org.apache.ignite.binary.BinaryTypeConfiguration)2 GridDiscoveryManager (org.apache.ignite.internal.managers.discovery.GridDiscoveryManager)2 GridSystemViewManager (org.apache.ignite.internal.managers.systemview.GridSystemViewManager)2 JmxSystemViewExporterSpi (org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi)2 WALIterator (org.apache.ignite.internal.pagemem.wal.WALIterator)2