use of org.apache.ignite.configuration.BinaryConfiguration in project ignite by apache.
the class IgniteUuidCompatibilityTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setPeerClassLoadingEnabled(false);
cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
cfg.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(compactFooter));
return cfg;
}
use of org.apache.ignite.configuration.BinaryConfiguration in project ignite by apache.
the class IgniteServiceProxyTimeoutInitializedTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(final String igniteInstanceName) throws Exception {
final IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
final ServiceConfiguration scfg = new ServiceConfiguration();
if (igniteInstanceName.endsWith("0")) {
scfg.setName("testService");
scfg.setService(srvc);
scfg.setMaxPerNodeCount(1);
scfg.setTotalCount(1);
scfg.setNodeFilter(new NodeFilter());
final Map<String, String> attrs = new HashMap<>();
attrs.put("clusterGroup", "0");
cfg.setUserAttributes(attrs);
cfg.setServiceConfiguration(scfg);
}
cfg.setMarshaller(null);
final BinaryConfiguration binCfg = new BinaryConfiguration();
// Despite defaults explicitly set to lower case.
binCfg.setIdMapper(new BinaryBasicIdMapper(true));
cfg.setBinaryConfiguration(binCfg);
return cfg;
}
use of org.apache.ignite.configuration.BinaryConfiguration in project ignite by apache.
the class IgniteCacheAbstractInsertSqlQuerySelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
BinaryConfiguration binCfg = new BinaryConfiguration();
binCfg.setTypeConfigurations(Arrays.asList(new BinaryTypeConfiguration() {
{
setTypeName(Key.class.getName());
}
}, new BinaryTypeConfiguration() {
{
setTypeName(Key2.class.getName());
}
}));
cfg.setBinaryConfiguration(binCfg);
cfg.setPeerClassLoadingEnabled(false);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
return cfg;
}
use of org.apache.ignite.configuration.BinaryConfiguration in project ignite by apache.
the class BinarySerializationQuerySelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setLocalHost("127.0.0.1");
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setMarshaller(new BinaryMarshaller());
if (useReflectiveSerializer()) {
BinaryTypeConfiguration binTypCfg1 = new BinaryTypeConfiguration(EntityPlain.class.getName());
BinaryTypeConfiguration binTypCfg2 = new BinaryTypeConfiguration(EntitySerializable.class.getName());
BinaryTypeConfiguration binTypCfg3 = new BinaryTypeConfiguration(EntityExternalizable.class.getName());
BinaryTypeConfiguration binTypCfg4 = new BinaryTypeConfiguration(EntityBinarylizable.class.getName());
BinaryTypeConfiguration binTypCfg5 = new BinaryTypeConfiguration(EntityWriteReadObject.class.getName());
binTypCfg1.setSerializer(new BinaryReflectiveSerializer());
binTypCfg2.setSerializer(new BinaryReflectiveSerializer());
binTypCfg3.setSerializer(new BinaryReflectiveSerializer());
binTypCfg4.setSerializer(new BinaryReflectiveSerializer());
binTypCfg5.setSerializer(new BinaryReflectiveSerializer());
List<BinaryTypeConfiguration> binTypCfgs = new ArrayList<>();
binTypCfgs.add(binTypCfg1);
binTypCfgs.add(binTypCfg2);
binTypCfgs.add(binTypCfg3);
binTypCfgs.add(binTypCfg4);
binTypCfgs.add(binTypCfg5);
BinaryConfiguration binCfg = new BinaryConfiguration();
binCfg.setTypeConfigurations(binTypCfgs);
cfg.setBinaryConfiguration(binCfg);
}
CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
cacheCfg.setCacheMode(CacheMode.PARTITIONED);
cacheCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setRebalanceMode(CacheRebalanceMode.SYNC);
List<QueryEntity> queryEntities = new ArrayList<>();
queryEntities.add(entityForClass(EntityPlain.class));
queryEntities.add(entityForClass(EntitySerializable.class));
queryEntities.add(entityForClass(EntityExternalizable.class));
queryEntities.add(entityForClass(EntityBinarylizable.class));
queryEntities.add(entityForClass(EntityWriteReadObject.class));
cacheCfg.setQueryEntities(queryEntities);
cfg.setCacheConfiguration(cacheCfg);
ignite = Ignition.start(cfg);
cache = ignite.cache(DEFAULT_CACHE_NAME);
}
Aggregations