use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class AddListConfigMessageTask method getConfig.
@Override
protected IdentifiedDataSerializable getConfig() {
ListConfig config = new ListConfig(parameters.name);
config.setAsyncBackupCount(parameters.asyncBackupCount);
config.setBackupCount(parameters.backupCount);
config.setMaxSize(parameters.maxSize);
config.setStatisticsEnabled(parameters.statisticsEnabled);
if (parameters.listenerConfigs != null && !parameters.listenerConfigs.isEmpty()) {
List<ItemListenerConfig> itemListenerConfigs = (List<ItemListenerConfig>) adaptListenerConfigs(parameters.listenerConfigs);
config.setItemListenerConfigs(itemListenerConfigs);
}
MergePolicyConfig mergePolicyConfig = mergePolicyConfig(parameters.mergePolicy, parameters.mergeBatchSize);
config.setMergePolicyConfig(mergePolicyConfig);
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class AddMultiMapConfigMessageTask method getConfig.
@Override
protected IdentifiedDataSerializable getConfig() {
MultiMapConfig multiMapConfig = new MultiMapConfig();
multiMapConfig.setName(parameters.name);
multiMapConfig.setValueCollectionType(parameters.collectionType);
multiMapConfig.setAsyncBackupCount(parameters.asyncBackupCount);
multiMapConfig.setBackupCount(parameters.backupCount);
multiMapConfig.setBinary(parameters.binary);
multiMapConfig.setStatisticsEnabled(parameters.statisticsEnabled);
if (parameters.listenerConfigs != null && !parameters.listenerConfigs.isEmpty()) {
for (ListenerConfigHolder configHolder : parameters.listenerConfigs) {
EntryListenerConfig entryListenerConfig = configHolder.asListenerConfig(serializationService);
multiMapConfig.addEntryListenerConfig(entryListenerConfig);
}
}
MergePolicyConfig mergePolicyConfig = mergePolicyConfig(parameters.mergePolicy, parameters.mergeBatchSize);
multiMapConfig.setMergePolicyConfig(mergePolicyConfig);
return multiMapConfig;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class AddQueueConfigMessageTask method getConfig.
@Override
protected IdentifiedDataSerializable getConfig() {
QueueConfig config = new QueueConfig(parameters.name);
config.setAsyncBackupCount(parameters.asyncBackupCount);
config.setBackupCount(parameters.backupCount);
config.setEmptyQueueTtl(parameters.emptyQueueTtl);
config.setMaxSize(parameters.maxSize);
config.setSplitBrainProtectionName(parameters.splitBrainProtectionName);
config.setStatisticsEnabled(parameters.statisticsEnabled);
if (parameters.queueStoreConfig != null) {
QueueStoreConfig storeConfig = parameters.queueStoreConfig.asQueueStoreConfig(serializationService);
config.setQueueStoreConfig(storeConfig);
}
if (parameters.listenerConfigs != null && !parameters.listenerConfigs.isEmpty()) {
List<ItemListenerConfig> itemListenerConfigs = (List<ItemListenerConfig>) adaptListenerConfigs(parameters.listenerConfigs);
config.setItemListenerConfigs(itemListenerConfigs);
}
MergePolicyConfig mergePolicyConfig = mergePolicyConfig(parameters.mergePolicy, parameters.mergeBatchSize);
config.setMergePolicyConfig(mergePolicyConfig);
if (parameters.isPriorityComparatorClassNameExists) {
config.setPriorityComparatorClassName(parameters.priorityComparatorClassName);
}
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class AddReplicatedMapConfigMessageTask method getConfig.
@Override
protected IdentifiedDataSerializable getConfig() {
ReplicatedMapConfig config = new ReplicatedMapConfig(parameters.name);
config.setAsyncFillup(parameters.asyncFillup);
config.setInMemoryFormat(InMemoryFormat.valueOf(parameters.inMemoryFormat));
MergePolicyConfig mergePolicyConfig = mergePolicyConfig(parameters.mergePolicy, parameters.mergeBatchSize);
config.setMergePolicyConfig(mergePolicyConfig);
config.setStatisticsEnabled(parameters.statisticsEnabled);
if (parameters.listenerConfigs != null && !parameters.listenerConfigs.isEmpty()) {
for (ListenerConfigHolder holder : parameters.listenerConfigs) {
config.addEntryListenerConfig((EntryListenerConfig) holder.asListenerConfig(serializationService));
}
} else {
config.setListenerConfigs(new ArrayList<ListenerConfig>());
}
return config;
}
use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.
the class AddScheduledExecutorConfigMessageTask method getConfig.
@Override
protected IdentifiedDataSerializable getConfig() {
// This is to handle 4.0 client versions. Those
// versions don't aware of `statisticsEnabled` parameter.
// The parameter was added at version 4.1 and its default value is true.
boolean statsEnabled = !parameters.isStatisticsEnabledExists || parameters.statisticsEnabled;
ScheduledExecutorConfig config = new ScheduledExecutorConfig();
config.setPoolSize(parameters.poolSize);
config.setDurability(parameters.durability);
config.setCapacity(parameters.capacity);
config.setName(parameters.name);
config.setStatisticsEnabled(statsEnabled);
MergePolicyConfig mergePolicyConfig = mergePolicyConfig(parameters.mergePolicy, parameters.mergeBatchSize);
config.setMergePolicyConfig(mergePolicyConfig);
return config;
}
Aggregations