use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class RingbufferSplitBrainTest method config.
@Override
protected Config config() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(mergePolicyClass.getName()).setBatchSize(10);
Config config = super.config();
config.getRingbufferConfig(ringbufferNameA).setInMemoryFormat(inMemoryFormat).setMergePolicyConfig(mergePolicyConfig).setRingbufferStoreConfig(new RingbufferStoreConfig().setStoreImplementation(ringbufferStoreA)).setBackupCount(1).setAsyncBackupCount(0).setTimeToLiveSeconds(0);
config.getRingbufferConfig(ringbufferNameB).setInMemoryFormat(inMemoryFormat).setMergePolicyConfig(mergePolicyConfig).setRingbufferStoreConfig(new RingbufferStoreConfig().setStoreImplementation(ringbufferStoreB)).setBackupCount(1).setAsyncBackupCount(0).setTimeToLiveSeconds(0);
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class ReplicatedMapSplitBrainTest method config.
@Override
protected Config config() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(mergePolicyClass.getName()).setBatchSize(10);
Config config = super.config();
config.getReplicatedMapConfig(replicatedMapNameA).setInMemoryFormat(inMemoryFormat).setMergePolicyConfig(mergePolicyConfig).setStatisticsEnabled(false);
config.getReplicatedMapConfig(replicatedMapNameB).setInMemoryFormat(inMemoryFormat).setMergePolicyConfig(mergePolicyConfig).setStatisticsEnabled(false);
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class TestContainerMerger method runInternal.
@Override
protected void runInternal() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig();
SplitBrainMergePolicy mergePolicy = getMergePolicy(mergePolicyConfig);
assertNotNull("Expected to retrieve a merge policy, but was null", mergePolicy);
if (mergeOperation != null) {
invoke(MapService.SERVICE_NAME, mergeOperation, 1);
}
}
use of com.hazelcast.config.MergePolicyConfig in project spring-boot-admin by codecentric.
the class SpringBootAdminHazelcastApplication method hazelcastConfig.
// tag::application-hazelcast[]
@Bean
public Config hazelcastConfig() {
// This map is used to store the events.
// It should be configured to reliably hold all the data,
// Spring Boot Admin will compact the events, if there are too many
MapConfig eventStoreMap = new MapConfig(DEFAULT_NAME_EVENT_STORE_MAP).setInMemoryFormat(InMemoryFormat.OBJECT).setBackupCount(1).setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
// This map is used to deduplicate the notifications.
// If data in this map gets lost it should not be a big issue as it will atmost
// lead to
// the same notification to be sent by multiple instances
MapConfig sentNotificationsMap = new MapConfig(DEFAULT_NAME_SENT_NOTIFICATIONS_MAP).setInMemoryFormat(InMemoryFormat.OBJECT).setBackupCount(1).setEvictionConfig(new EvictionConfig().setEvictionPolicy(EvictionPolicy.LRU).setMaxSizePolicy(MaxSizePolicy.PER_NODE)).setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
Config config = new Config();
config.addMapConfig(eventStoreMap);
config.addMapConfig(sentNotificationsMap);
config.setProperty("hazelcast.jmx", "true");
// WARNING: This setups a local cluster, you change it to fit your needs.
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
TcpIpConfig tcpIpConfig = config.getNetworkConfig().getJoin().getTcpIpConfig();
tcpIpConfig.setEnabled(true);
tcpIpConfig.setMembers(singletonList("127.0.0.1"));
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project spring-boot-admin by codecentric.
the class HazelcastEventStoreWithServerConfigTest method createHazelcastConfig.
// config from sample project
private Config createHazelcastConfig() {
// This map is used to store the events.
// It should be configured to reliably hold all the data,
// Spring Boot Admin will compact the events, if there are too many
MapConfig eventStoreMap = new MapConfig(DEFAULT_NAME_EVENT_STORE_MAP).setInMemoryFormat(InMemoryFormat.OBJECT).setBackupCount(1).setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
// This map is used to deduplicate the notifications.
// If data in this map gets lost it should not be a big issue as it will atmost
// lead to
// the same notification to be sent by multiple instances
MapConfig sentNotificationsMap = new MapConfig(DEFAULT_NAME_SENT_NOTIFICATIONS_MAP).setInMemoryFormat(InMemoryFormat.OBJECT).setBackupCount(1).setEvictionConfig(new EvictionConfig().setEvictionPolicy(EvictionPolicy.LRU)).setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
Config config = new Config();
config.addMapConfig(eventStoreMap);
config.addMapConfig(sentNotificationsMap);
config.setProperty("hazelcast.jmx", "true");
// WARNING: This setups a local cluster, you change it to fit your needs.
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
TcpIpConfig tcpIpConfig = config.getNetworkConfig().getJoin().getTcpIpConfig();
tcpIpConfig.setEnabled(true);
tcpIpConfig.setMembers(singletonList("127.0.0.1"));
return config;
}
Aggregations