Search in sources :

Example 36 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) List(java.util.List) ListConfig(com.hazelcast.config.ListConfig)

Example 37 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig)

Example 38 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) QueueConfig(com.hazelcast.config.QueueConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) List(java.util.List)

Example 39 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig)

Example 40 with MergePolicyConfig

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;
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig)

Aggregations

MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)65 Config (com.hazelcast.config.Config)21 Test (org.junit.Test)20 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)18 MapConfig (com.hazelcast.config.MapConfig)17 MultiMapConfig (com.hazelcast.config.MultiMapConfig)17 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)16 ItemListenerConfig (com.hazelcast.config.ItemListenerConfig)16 QueueStoreConfig (com.hazelcast.config.QueueStoreConfig)15 RingbufferStoreConfig (com.hazelcast.config.RingbufferStoreConfig)15 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)15 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)13 EvictionConfig (com.hazelcast.config.EvictionConfig)13 ListenerConfig (com.hazelcast.config.ListenerConfig)13 QueueConfig (com.hazelcast.config.QueueConfig)13 RingbufferConfig (com.hazelcast.config.RingbufferConfig)13 EventJournalConfig (com.hazelcast.config.EventJournalConfig)12 ListConfig (com.hazelcast.config.ListConfig)12 MapPartitionLostListenerConfig (com.hazelcast.config.MapPartitionLostListenerConfig)12 SetConfig (com.hazelcast.config.SetConfig)12