use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method handleRingBufferNode.
void handleRingBufferNode(Node node, RingbufferConfig rbConfig) {
for (Node n : childElements(node)) {
String nodeName = cleanNodeName(n);
if (matches("capacity", nodeName)) {
int capacity = getIntegerValue("capacity", getTextContent(n));
rbConfig.setCapacity(capacity);
} else if (matches("backup-count", nodeName)) {
int backupCount = getIntegerValue("backup-count", getTextContent(n));
rbConfig.setBackupCount(backupCount);
} else if (matches("async-backup-count", nodeName)) {
int asyncBackupCount = getIntegerValue("async-backup-count", getTextContent(n));
rbConfig.setAsyncBackupCount(asyncBackupCount);
} else if (matches("time-to-live-seconds", nodeName)) {
int timeToLiveSeconds = getIntegerValue("time-to-live-seconds", getTextContent(n));
rbConfig.setTimeToLiveSeconds(timeToLiveSeconds);
} else if (matches("in-memory-format", nodeName)) {
InMemoryFormat inMemoryFormat = InMemoryFormat.valueOf(upperCaseInternal(getTextContent(n)));
rbConfig.setInMemoryFormat(inMemoryFormat);
} else if (matches("ringbuffer-store", nodeName)) {
RingbufferStoreConfig ringbufferStoreConfig = createRingbufferStoreConfig(n);
rbConfig.setRingbufferStoreConfig(ringbufferStoreConfig);
} else if (matches("split-brain-protection-ref", nodeName)) {
rbConfig.setSplitBrainProtectionName(getTextContent(n));
} else if (matches("merge-policy", nodeName)) {
MergePolicyConfig mpConfig = createMergePolicyConfig(n, rbConfig.getMergePolicyConfig());
rbConfig.setMergePolicyConfig(mpConfig);
}
}
config.addRingBufferConfig(rbConfig);
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method handleSetNode.
void handleSetNode(Node node, final SetConfig sConfig) {
for (Node n : childElements(node)) {
String nodeName = cleanNodeName(n);
if (matches("max-size", nodeName)) {
sConfig.setMaxSize(getIntegerValue("max-size", getTextContent(n)));
} else if (matches("backup-count", nodeName)) {
sConfig.setBackupCount(getIntegerValue("backup-count", getTextContent(n)));
} else if (matches("async-backup-count", nodeName)) {
sConfig.setAsyncBackupCount(getIntegerValue("async-backup-count", getTextContent(n)));
} else if (matches("item-listeners", nodeName)) {
handleItemListeners(n, sConfig::addItemListenerConfig);
} else if (matches("statistics-enabled", nodeName)) {
sConfig.setStatisticsEnabled(getBooleanValue(getTextContent(n)));
} else if (matches("split-brain-protection-ref", nodeName)) {
sConfig.setSplitBrainProtectionName(getTextContent(n));
} else if (matches("merge-policy", nodeName)) {
MergePolicyConfig mpConfig = createMergePolicyConfig(n, sConfig.getMergePolicyConfig());
sConfig.setMergePolicyConfig(mpConfig);
}
}
config.addSetConfig(sConfig);
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class MapSplitBrainTest method config.
@Override
protected Config config() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(mergePolicyClass.getName()).setBatchSize(10);
Config config = super.config();
config.getMapConfig(mapNameA).setInMemoryFormat(inMemoryFormat).setMergePolicyConfig(mergePolicyConfig).setBackupCount(1).setAsyncBackupCount(0).setStatisticsEnabled(true).setPerEntryStatsEnabled(true);
config.getMapConfig(mapNameB).setInMemoryFormat(inMemoryFormat).setMergePolicyConfig(mergePolicyConfig).setBackupCount(1).setAsyncBackupCount(0).setStatisticsEnabled(true).setPerEntryStatsEnabled(true);
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class MultiMapSplitBrainTest method config.
@Override
protected Config config() {
MergePolicyConfig mergePolicyConfig = new MergePolicyConfig().setPolicy(mergePolicyClass.getName()).setBatchSize(10);
Config config = super.config();
config.getMultiMapConfig(multiMapNameA).setBinary(isBinary).setMergePolicyConfig(mergePolicyConfig).setStatisticsEnabled(true).setBackupCount(1).setAsyncBackupCount(0);
config.getMultiMapConfig(multiMapNameB).setBinary(isBinary).setMergePolicyConfig(mergePolicyConfig).setStatisticsEnabled(true).setBackupCount(1).setAsyncBackupCount(0);
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class MergePolicyValidatorCachingProviderIntegrationTest method testCache_withLegacyPutIfAbsentMergePolicy.
@Test
public void testCache_withLegacyPutIfAbsentMergePolicy() {
MergePolicyConfig legacyMergePolicyConfig = new MergePolicyConfig().setPolicy(PutIfAbsentMergePolicy.class.getName());
getCache("legacyPutIfAbsent", legacyMergePolicyConfig);
}
Aggregations