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;
}
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;
}
Aggregations