Search in sources :

Example 21 with BinaryContext

use of org.apache.ignite.internal.binary.BinaryContext in project ignite by apache.

the class GridAbstractTest method createStandaloneBinaryMarshaller.

/**
 * Create instance of {@link BinaryMarshaller} suitable for use
 * without starting a grid upon given {@link IgniteConfiguration}.
 *
 * @return Binary marshaller.
 * @throws IgniteCheckedException if failed.
 */
protected BinaryMarshaller createStandaloneBinaryMarshaller(IgniteConfiguration cfg) throws IgniteCheckedException {
    BinaryMarshaller marsh = new BinaryMarshaller();
    BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), cfg, new NullLogger());
    marsh.setContext(new MarshallerContextTestImpl());
    marsh.setBinaryContext(ctx, cfg);
    return marsh;
}
Also used : NullLogger(org.apache.ignite.logger.NullLogger) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) BinaryContext(org.apache.ignite.internal.binary.BinaryContext) MarshallerContextTestImpl(org.apache.ignite.marshaller.MarshallerContextTestImpl)

Example 22 with BinaryContext

use of org.apache.ignite.internal.binary.BinaryContext in project ignite by apache.

the class GridTestBinaryMarshaller method createBinaryMarshaller.

/**
 * @param log Logger.
 */
private BinaryMarshaller createBinaryMarshaller(IgniteLogger log) throws IgniteCheckedException {
    IgniteConfiguration iCfg = new IgniteConfiguration().setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(true)).setClientMode(false).setDiscoverySpi(new TcpDiscoverySpi() {

        @Override
        public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
        // No-op.
        }
    });
    BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger());
    MarshallerContextTestImpl marshCtx = new MarshallerContextTestImpl();
    marshCtx.onMarshallerProcessorStarted(new GridTestKernalContext(log, iCfg), null);
    BinaryMarshaller marsh = new BinaryMarshaller();
    marsh.setContext(marshCtx);
    marsh.setBinaryContext(ctx, iCfg);
    return marsh;
}
Also used : DiscoverySpiCustomMessage(org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage) 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) IgniteException(org.apache.ignite.IgniteException) BinaryContext(org.apache.ignite.internal.binary.BinaryContext) MarshallerContextTestImpl(org.apache.ignite.marshaller.MarshallerContextTestImpl) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

BinaryContext (org.apache.ignite.internal.binary.BinaryContext)22 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)14 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)12 NullLogger (org.apache.ignite.logger.NullLogger)10 GridBinaryMarshaller (org.apache.ignite.internal.binary.GridBinaryMarshaller)7 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)6 MarshallerContextTestImpl (org.apache.ignite.marshaller.MarshallerContextTestImpl)6 BinaryMetadata (org.apache.ignite.internal.binary.BinaryMetadata)5 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)3 IgniteException (org.apache.ignite.IgniteException)3 MarshallerContextImpl (org.apache.ignite.internal.MarshallerContextImpl)3 BinaryWriterExImpl (org.apache.ignite.internal.binary.BinaryWriterExImpl)3 BinaryHeapOutputStream (org.apache.ignite.internal.binary.streams.BinaryHeapOutputStream)3 CacheObjectBinaryProcessorImpl (org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl)3 HashMap (java.util.HashMap)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 BinaryObject (org.apache.ignite.binary.BinaryObject)2 BinaryType (org.apache.ignite.binary.BinaryType)2 BinaryTypeConfiguration (org.apache.ignite.binary.BinaryTypeConfiguration)2 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)2