use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridDataStreamerImplSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
if (binaries) {
BinaryMarshaller marsh = new BinaryMarshaller();
cfg.setMarshaller(marsh);
}
cfg.setCacheConfiguration(cacheConfiguration());
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridCacheAffinityRoutingBinarySelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
typeCfg.setTypeName(AffinityTestKey.class.getName());
CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(AffinityTestKey.class.getName(), "affKey");
cfg.setCacheKeyConfiguration(keyCfg);
BinaryConfiguration bCfg = new BinaryConfiguration();
bCfg.setTypeConfigurations(Collections.singleton(typeCfg));
cfg.setBinaryConfiguration(bCfg);
cfg.setMarshaller(new BinaryMarshaller());
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class IgniteCacheGroupsTest method checkAffinityMappers.
/**
* @param node Node.
*/
private void checkAffinityMappers(Ignite node) {
Affinity aff1 = node.affinity("c1");
Affinity aff2 = node.affinity("c2");
Affinity aff3 = node.affinity("c3");
Affinity aff4 = node.affinity("c4");
Affinity aff5 = node.affinity("c5");
Affinity aff6 = node.affinity("c6");
RendezvousAffinityFunction func = new RendezvousAffinityFunction();
for (int i = 0; i < 100; i++) {
MapperTestKey1 k = new MapperTestKey1(i, i + 10);
assertEquals(i, aff1.partition(k));
assertEquals(i, aff3.partition(k));
assertEquals(i + 10, aff2.partition(k));
assertEquals(i + 10, aff4.partition(k));
int part;
if (node.configuration().getMarshaller() instanceof BinaryMarshaller)
part = func.partition(node.binary().toBinary(k));
else
part = func.partition(k);
assertEquals(part, aff5.partition(k));
assertEquals(part, aff6.partition(k));
}
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class IgniteCacheCreatePutMultiNodeSelfTest 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.setMarshaller(new BinaryMarshaller());
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class IgniteCacheCreatePutTest method getConfiguration.
/**
* {@inheritDoc}
*/
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
cfg.setPeerClassLoadingEnabled(false);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
cfg.setMarshaller(new BinaryMarshaller());
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setName("cache*");
ccfg.setCacheMode(PARTITIONED);
ccfg.setBackups(1);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setCacheConfiguration(ccfg);
cfg.setClientMode(client);
return cfg;
}
Aggregations