use of org.apache.ignite.internal.binary.BinaryContext in project ignite by apache.
the class GridSessionCheckpointSelfTest method testCacheCheckpoint.
/**
* @throws Exception If failed.
*/
@Test
public void testCacheCheckpoint() throws Exception {
IgniteConfiguration cfg = getConfiguration();
String cacheName = "test-checkpoints";
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setName(cacheName);
CacheCheckpointSpi spi = new CacheCheckpointSpi();
spi.setCacheName(cacheName);
cfg.setCacheConfiguration(cacheCfg);
cfg.setCheckpointSpi(spi);
if (cfg.getMarshaller() instanceof BinaryMarshaller) {
BinaryMarshaller marsh = (BinaryMarshaller) cfg.getMarshaller();
BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), cfg, new NullLogger());
marsh.setContext(new MarshallerContextTestImpl(null));
marsh.setBinaryContext(ctx, cfg);
}
GridSessionCheckpointSelfTest.spi = spi;
checkCheckpoints(cfg);
}
use of org.apache.ignite.internal.binary.BinaryContext 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.internal.binary.BinaryContext 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.internal.binary.BinaryContext in project ignite by apache.
the class GridCacheProcessor method withBinaryContext.
/**
* @param c Closure.
* @return Closure result.
* @throws IgniteCheckedException If failed.
*/
private <T> T withBinaryContext(IgniteOutClosureX<T> c) throws IgniteCheckedException {
IgniteCacheObjectProcessor objProc = ctx.cacheObjects();
BinaryContext oldCtx = null;
if (objProc instanceof CacheObjectBinaryProcessorImpl) {
GridBinaryMarshaller binMarsh = ((CacheObjectBinaryProcessorImpl) objProc).marshaller();
oldCtx = binMarsh == null ? null : binMarsh.pushContext();
}
try {
return c.applyx();
} finally {
if (objProc instanceof CacheObjectBinaryProcessorImpl)
GridBinaryMarshaller.popContext(oldCtx);
}
}
use of org.apache.ignite.internal.binary.BinaryContext in project ignite by apache.
the class PlatformUtils method marshaller.
/**
* Create binary marshaller.
*
* @return Marshaller.
*/
public static GridBinaryMarshaller marshaller() {
BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), new IgniteConfiguration(), new NullLogger());
BinaryMarshaller marsh = new BinaryMarshaller();
marsh.setContext(new MarshallerContextImpl(null, null));
ctx.configure(marsh);
return new GridBinaryMarshaller(ctx);
}
Aggregations