use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class BinaryMetadataUpdatesFlowTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setPeerClassLoadingEnabled(false);
if (applyDiscoveryHook) {
final DiscoveryHook hook = discoveryHook != null ? discoveryHook : new DiscoveryHook();
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi() {
@Override
public void setListener(@Nullable DiscoverySpiListener lsnr) {
super.setListener(GridTestUtils.DiscoverySpiListenerWrapper.wrap(lsnr, hook));
}
};
cfg.setDiscoverySpi(discoSpi);
cfg.setMetricsUpdateFrequency(1000);
}
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
cfg.setMarshaller(new BinaryMarshaller());
cfg.setClientMode(clientMode);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(CacheMode.REPLICATED);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridCacheBinaryObjectUserClassloaderSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
cfg.setCacheConfiguration(cacheConfiguration(igniteInstanceName));
cfg.setMarshaller(new BinaryMarshaller());
cfg.setClassLoader(useWrappingLoader ? new WrappingClassLoader(getExternalClassLoader()) : getExternalClassLoader());
if (customBinaryConf) {
BinarySerializer bs = new BinarySerializer() {
/**
* {@inheritDoc}
*/
@Override
public void writeBinary(Object obj, BinaryWriter writer) throws BinaryObjectException {
// No-op.
}
/**
* {@inheritDoc}
*/
@Override
public void readBinary(Object obj, BinaryReader reader) throws BinaryObjectException {
deserialized = true;
}
};
BinaryTypeConfiguration btcfg1 = new BinaryTypeConfiguration();
btcfg1.setTypeName("org.apache.ignite.tests.p2p.CacheDeploymentTestValue");
btcfg1.setSerializer(bs);
BinaryTypeConfiguration btcfg2 = new BinaryTypeConfiguration();
btcfg2.setTypeName("org.apache.ignite.internal.processors.cache.binary." + "GridCacheBinaryObjectUserClassloaderSelfTest$TestValue1");
btcfg2.setSerializer(bs);
BinaryConfiguration bcfg = new BinaryConfiguration();
Set<BinaryTypeConfiguration> set = new HashSet<>();
set.add(btcfg1);
set.add(btcfg2);
bcfg.setTypeConfigurations(set);
cfg.setBinaryConfiguration(bcfg);
}
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridCacheBinaryObjectsAbstractMultiThreadedSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
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;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridCacheClientNodeBinaryObjectMetadataTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
BinaryMarshaller marsh = new BinaryMarshaller();
BinaryConfiguration bCfg = new BinaryConfiguration();
bCfg.setClassNames(Arrays.asList(TestObject1.class.getName(), TestObject2.class.getName()));
BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
typeCfg.setTypeName(TestObject1.class.getName());
CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestObject1.class.getName(), "val2");
cfg.setCacheKeyConfiguration(keyCfg);
bCfg.setTypeConfigurations(Arrays.asList(typeCfg));
cfg.setBinaryConfiguration(bCfg);
if (igniteInstanceName.equals(getTestIgniteInstanceName(gridCount() - 1)))
cfg.setClientMode(true);
cfg.setMarshaller(marsh);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setForceServerMode(true);
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class DataStreamProcessorBinarySelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
BinaryMarshaller marsh = new BinaryMarshaller();
cfg.setMarshaller(marsh);
return cfg;
}
Aggregations