use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class H2DynamicTableSelfTest method commonConfiguration.
/**
* Create common node configuration.
*
* @param idx Index.
* @return Configuration.
* @throws Exception If failed.
*/
private IgniteConfiguration commonConfiguration(int idx) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(getTestIgniteInstanceName(idx));
cfg.setMarshaller(new BinaryMarshaller());
return optimize(cfg);
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridComputationBinarylizableClosuresSelfTest 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 GridCacheReplicatedPreloadSelfTest 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.setDeploymentMode(CONTINUOUS);
cfg.setUserAttributes(F.asMap("EVEN", !igniteInstanceName.endsWith("0") && !igniteInstanceName.endsWith("2")));
MemoryEventStorageSpi spi = new MemoryEventStorageSpi();
spi.setExpireCount(50_000);
cfg.setEventStorageSpi(spi);
if (disableP2p)
cfg.setPeerClassLoadingEnabled(false);
if (getTestIgniteInstanceName(1).equals(igniteInstanceName) || useExtClassLoader || cfg.getMarshaller() instanceof BinaryMarshaller)
cfg.setClassLoader(getExternalClassLoader());
if (isClient)
cfg.setClientMode(true);
if (cutromEvt) {
int[] evts = new int[EVTS_ALL.length + 1];
evts[0] = Integer.MAX_VALUE - 1;
System.arraycopy(EVTS_ALL, 0, evts, 1, EVTS_ALL.length);
cfg.setIncludeEventTypes(evts);
}
return cfg;
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class GridCacheReplicatedPreloadSelfTest method testDeployment.
/**
* @throws Exception If test failed.
*/
public void testDeployment() throws Exception {
// TODO GG-11141.
if (true)
return;
preloadMode = SYNC;
try {
Ignite g1 = startGrid(1);
Ignite g2 = startGrid(2);
IgniteCache<Integer, Object> cache1 = g1.cache(DEFAULT_CACHE_NAME);
IgniteCache<Integer, Object> cache2 = g2.cache(DEFAULT_CACHE_NAME);
ClassLoader ldr = grid(1).configuration().getClassLoader();
Object v1 = ldr.loadClass("org.apache.ignite.tests.p2p.CacheDeploymentTestValue3").newInstance();
cache1.put(1, v1);
info("Stored value in cache1 [v=" + v1 + ", ldr=" + v1.getClass().getClassLoader() + ']');
Object v2 = cache2.get(1);
info("Read value from cache2 [v=" + v2 + ", ldr=" + v2.getClass().getClassLoader() + ']');
assert v2 != null;
assert v2.toString().equals(v1.toString());
assert !v2.getClass().getClassLoader().equals(getClass().getClassLoader());
assert v2.getClass().getClassLoader().getClass().getName().contains("GridDeploymentClassLoader") || grid(2).configuration().getMarshaller() instanceof BinaryMarshaller;
Object e1 = ldr.loadClass("org.apache.ignite.tests.p2p.CacheDeploymentTestEnumValue").getEnumConstants()[0];
cache1.put(2, e1);
Object e2 = cache2.get(2);
if (g1.configuration().getMarshaller() instanceof BinaryMarshaller) {
BinaryObject enumObj = (BinaryObject) cache2.withKeepBinary().get(2);
assertEquals(0, enumObj.enumOrdinal());
assertTrue(enumObj.type().isEnum());
assertTrue(enumObj instanceof BinaryEnumObjectImpl);
}
assert e2 != null;
assert e2.toString().equals(e1.toString());
assert !e2.getClass().getClassLoader().equals(getClass().getClassLoader());
assert e2.getClass().getClassLoader().getClass().getName().contains("GridDeploymentClassLoader") || grid(2).configuration().getMarshaller() instanceof BinaryMarshaller;
stopGrid(1);
Ignite g3 = startGrid(3);
IgniteCache<Integer, Object> cache3 = g3.cache(DEFAULT_CACHE_NAME);
Object v3 = cache3.localPeek(1, CachePeekMode.ONHEAP);
assert v3 != null;
info("Read value from cache3 [v=" + v3 + ", ldr=" + v3.getClass().getClassLoader() + ']');
assert v3 != null;
assert v3.toString().equals(v1.toString());
assert !v3.getClass().getClassLoader().equals(getClass().getClassLoader());
assert v3.getClass().getClassLoader().getClass().getName().contains("GridDeploymentClassLoader") || grid(3).configuration().getMarshaller() instanceof BinaryMarshaller;
} finally {
stopAllGrids();
}
}
use of org.apache.ignite.internal.binary.BinaryMarshaller in project ignite by apache.
the class PublicThreadpoolStarvationTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setPublicThreadPoolSize(1);
((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
cfg.setMarshaller(new BinaryMarshaller());
return cfg;
}
Aggregations