use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class IgniteCacheNoClassQuerySelfTest method getConfiguration.
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
c.setDiscoverySpi(new TcpDiscoverySpi().setForceServerMode(true).setIpFinder(ipFinder));
CacheConfiguration cc = defaultCacheConfiguration();
c.setMarshaller(new BinaryMarshaller());
cc.setName("cache");
cc.setAtomicityMode(TRANSACTIONAL);
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setRebalanceMode(SYNC);
QueryEntity qryEntity = new QueryEntity();
qryEntity.setKeyType(Integer.class.getName());
qryEntity.setValueType("MyClass");
LinkedHashMap<String, String> fields = new LinkedHashMap<>();
fields.put("strField", String.class.getName());
fields.put("intField", Integer.class.getName());
fields.put("doubleField", Double.class.getName());
qryEntity.setFields(fields);
qryEntity.setFields(fields);
qryEntity.setIndexes(Arrays.asList(new QueryIndex("strField"), new QueryIndex("intField"), new QueryIndex("doubleField")));
cc.setQueryEntities(Collections.singletonList(qryEntity));
c.setCacheConfiguration(cc);
return c;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class CacheStartupInDeploymentModesTest method testStartedInPrivateMode.
/**
* @throws Exception If fail.
*/
public void testStartedInPrivateMode() throws Exception {
deploymentMode = DeploymentMode.PRIVATE;
marshaller = new BinaryMarshaller();
doCheckStarted(deploymentMode);
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class CacheStartupInDeploymentModesTest method testStartedInIsolatedMode.
/**
* @throws Exception If fail.
*/
public void testStartedInIsolatedMode() throws Exception {
deploymentMode = DeploymentMode.ISOLATED;
marshaller = new BinaryMarshaller();
doCheckStarted(deploymentMode);
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class CacheStartupInDeploymentModesTest method doCheckStarted.
/**
* @param mode Deployment mode.
* @throws Exception If failed.
*/
private void doCheckStarted(DeploymentMode mode) throws Exception {
startGridsMultiThreaded(2);
checkTopology(2);
assertEquals(mode, ignite(0).configuration().getDeploymentMode());
assert ignite(0).configuration().getMarshaller() instanceof BinaryMarshaller;
IgniteCache rCache = ignite(0).cache(REPLICATED_CACHE);
checkPutCache(rCache);
IgniteCache pCache = ignite(0).cache(PARTITIONED_CACHE);
checkPutCache(pCache);
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridCacheBinaryObjectsAbstractDataStreamerSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
cacheCfg.setCacheMode(cacheMode());
cacheCfg.setAtomicityMode(atomicityMode());
cacheCfg.setNearConfiguration(nearConfiguration());
cacheCfg.setWriteSynchronizationMode(writeSynchronizationMode());
cfg.setCacheConfiguration(cacheCfg);
BinaryConfiguration bCfg = new BinaryConfiguration();
bCfg.setTypeConfigurations(Arrays.asList(new BinaryTypeConfiguration(TestObject.class.getName())));
cfg.setBinaryConfiguration(bCfg);
cfg.setMarshaller(new BinaryMarshaller());
return cfg;
}
Aggregations