use of com.hazelcast.config.WanReplicationRef in project hazelcast by hazelcast.
the class WanReplicationTest method getConfig.
@Override
protected Config getConfig() {
Config config = new Config();
WanReplicationConfig wanConfig = new WanReplicationConfig();
wanConfig.setName("dummyWan");
wanConfig.addWanPublisherConfig(getPublisherConfig());
WanReplicationRef wanRef = new WanReplicationRef();
wanRef.setName("dummyWan");
wanRef.setMergePolicy(PassThroughMergePolicy.class.getName());
config.addWanReplicationConfig(wanConfig);
config.getMapConfig("default").setWanReplicationRef(wanRef);
return config;
}
use of com.hazelcast.config.WanReplicationRef in project hazelcast by hazelcast.
the class YamlMemberDomConfigProcessor method mapWanReplicationRefHandle.
@Override
protected void mapWanReplicationRefHandle(Node n, MapConfig mapConfig) {
for (Node mapNode : childElements(n)) {
WanReplicationRef wanReplicationRef = new WanReplicationRef();
wanReplicationRef.setName(mapNode.getNodeName());
handleMapWanReplicationRefNode(mapNode, mapConfig, wanReplicationRef);
}
}
use of com.hazelcast.config.WanReplicationRef in project hazelcast by hazelcast.
the class WanReplicationConfigurationTest method testWanReplicationAndWanRepublishing.
@Test
public void testWanReplicationAndWanRepublishing() {
isWanReplicationEnabled = true;
isWanRepublishingEnabled = true;
initInstanceAndMapContainer("withWanRepublishing");
assertTrue(mapContainer.isWanReplicationEnabled());
assertTrue(mapContainer.isWanRepublishingEnabled());
assertNotNull(mapContainer.getWanReplicationDelegate());
assertNotNull(mapContainer.getWanMergePolicy());
WanReplicationRef wanReplicationRef = mapContainer.getMapConfig().getWanReplicationRef();
assertNotNull(wanReplicationRef);
assertEquals(mapContainer.getWanMergePolicy().getClass().getName(), wanReplicationRef.getMergePolicyClassName());
assertTrue(wanReplicationRef.isRepublishingEnabled());
}
use of com.hazelcast.config.WanReplicationRef in project hazelcast by hazelcast.
the class WanPublisherMigrationTest method getConfig.
@Override
protected Config getConfig() {
WanCustomPublisherConfig publisherConfig = new WanCustomPublisherConfig().setPublisherId("dummyPublisherId").setClassName(MigrationCountingWanPublisher.class.getName());
publisherConfig.getProperties().put("failMigrations", failMigrations);
WanReplicationConfig wanReplicationConfig = new WanReplicationConfig().setName("dummyWan").addCustomPublisherConfig(publisherConfig);
WanReplicationRef wanRef = new WanReplicationRef().setName("dummyWan").setMergePolicyClassName(PassThroughMergePolicy.class.getName());
MapConfig mapConfig = new MapConfig("default").setWanReplicationRef(wanRef);
return smallInstanceConfig().addWanReplicationConfig(wanReplicationConfig).addMapConfig(mapConfig);
}
use of com.hazelcast.config.WanReplicationRef in project hazelcast by hazelcast.
the class DynamicConfigTest method getCacheConfig.
private CacheSimpleConfig getCacheConfig() {
CacheSimpleEntryListenerConfig entryListenerConfig = new CacheSimpleEntryListenerConfig();
entryListenerConfig.setCacheEntryListenerFactory("CacheEntryListenerFactory");
entryListenerConfig.setSynchronous(true);
entryListenerConfig.setOldValueRequired(true);
entryListenerConfig.setCacheEntryEventFilterFactory("CacheEntryEventFilterFactory");
CacheSimpleConfig config = new CacheSimpleConfig().setName(name).setSplitBrainProtectionName("split-brain-protection").setInMemoryFormat(InMemoryFormat.OBJECT).setBackupCount(3).setAsyncBackupCount(2).addEntryListenerConfig(entryListenerConfig).setStatisticsEnabled(true).setManagementEnabled(true).setKeyType("keyType").setValueType("valueType").setReadThrough(true).setWriteThrough(true).setHotRestartConfig(new HotRestartConfig().setEnabled(true).setFsync(true)).setEventJournalConfig(new EventJournalConfig().setEnabled(true).setCapacity(42).setTimeToLiveSeconds(52));
config.setWanReplicationRef(new WanReplicationRef(randomName(), "com.hazelcast.MergePolicy", Collections.singletonList("filter"), true));
config.getMergePolicyConfig().setPolicy("mergePolicy");
config.setDisablePerEntryInvalidationEvents(true);
return config;
}
Aggregations