use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class IgnitePersistentStoreTest method blobBinaryLoadCacheTest.
/**
*/
@Test
public void blobBinaryLoadCacheTest() {
Ignition.stopAll(true);
try (Ignite ignite = Ignition.start("org/apache/ignite/tests/persistence/loadall_blob/ignite-config.xml")) {
IgniteCache<Long, PojoPerson> personCache = ignite.getOrCreateCache("cache2");
assert ignite.configuration().getMarshaller() instanceof BinaryMarshaller;
personCache.put(1L, new PojoPerson(1, "name"));
assert personCache.withKeepBinary().get(1L) instanceof BinaryObject;
}
Ignition.stopAll(true);
try (Ignite ignite = Ignition.start("org/apache/ignite/tests/persistence/loadall_blob/ignite-config.xml")) {
IgniteCache<Long, PojoPerson> personCache = ignite.getOrCreateCache("cache2");
personCache.loadCache(null, null);
PojoPerson person = personCache.get(1L);
LOGGER.info("loadCache tests passed");
}
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridCacheUtilsSelfTest method binaryMarshaller.
/**
* @return Binary marshaller.
* @throws IgniteCheckedException if failed.
*/
private BinaryMarshaller binaryMarshaller() throws IgniteCheckedException {
IgniteConfiguration iCfg = new IgniteConfiguration();
BinaryConfiguration bCfg = new BinaryConfiguration();
iCfg.setBinaryConfiguration(bCfg);
BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger());
BinaryMarshaller marsh = new BinaryMarshaller();
marsh.setContext(new MarshallerContextTestImpl(null));
IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
return marsh;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridCacheBinariesNearPartitionedByteArrayValuesSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setMarshaller(new BinaryMarshaller());
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class TcpDiscoveryMarshallerCheckSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
cfg.setLocalHost("127.0.0.1");
if (flag)
cfg.setMarshaller(new JdkMarshaller());
else
cfg.setMarshaller(sameMarsh ? new JdkMarshaller() : new BinaryMarshaller());
// Flip flag.
flag = !flag;
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class IgniteHadoopFileSystemAbstractSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = new IgniteConfiguration();
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setIgniteInstanceName(igniteInstanceName);
cfg.setMarshaller(new BinaryMarshaller());
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsConfiguration(igniteInstanceName));
cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
return cfg;
}
Aggregations