Search in sources :

Example 6 with MergePolicyConfig

use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.

the class DynamicConfigXmlGenerator method cardinalityEstimatorXmlGenerator.

public static void cardinalityEstimatorXmlGenerator(ConfigXmlGenerator.XmlGenerator gen, Config config) {
    for (CardinalityEstimatorConfig ex : config.getCardinalityEstimatorConfigs().values()) {
        MergePolicyConfig mergePolicyConfig = ex.getMergePolicyConfig();
        gen.open("cardinality-estimator", "name", ex.getName()).node("backup-count", ex.getBackupCount()).node("async-backup-count", ex.getAsyncBackupCount()).node("split-brain-protection-ref", ex.getSplitBrainProtectionName()).node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()).close();
    }
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig)

Example 7 with MergePolicyConfig

use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.

the class DynamicConfigXmlGenerator method ringbufferXmlGenerator.

public static void ringbufferXmlGenerator(ConfigXmlGenerator.XmlGenerator gen, Config config) {
    Collection<RingbufferConfig> configs = config.getRingbufferConfigs().values();
    for (RingbufferConfig rbConfig : configs) {
        gen.open("ringbuffer", "name", rbConfig.getName()).node("capacity", rbConfig.getCapacity()).node("time-to-live-seconds", rbConfig.getTimeToLiveSeconds()).node("backup-count", rbConfig.getBackupCount()).node("async-backup-count", rbConfig.getAsyncBackupCount()).node("split-brain-protection-ref", rbConfig.getSplitBrainProtectionName()).node("in-memory-format", rbConfig.getInMemoryFormat());
        RingbufferStoreConfig storeConfig = rbConfig.getRingbufferStoreConfig();
        if (storeConfig != null) {
            gen.open("ringbuffer-store", "enabled", storeConfig.isEnabled()).node("class-name", classNameOrImplClass(storeConfig.getClassName(), storeConfig.getStoreImplementation())).node("factory-class-name", classNameOrImplClass(storeConfig.getFactoryClassName(), storeConfig.getFactoryImplementation())).appendProperties(storeConfig.getProperties());
            gen.close();
        }
        MergePolicyConfig mergePolicyConfig = rbConfig.getMergePolicyConfig();
        gen.node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()).close();
    }
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) RingbufferStoreConfig(com.hazelcast.config.RingbufferStoreConfig)

Example 8 with MergePolicyConfig

use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.

the class DynamicConfigXmlGenerator method replicatedMapXmlGenerator.

public static void replicatedMapXmlGenerator(ConfigXmlGenerator.XmlGenerator gen, Config config) {
    for (ReplicatedMapConfig r : config.getReplicatedMapConfigs().values()) {
        MergePolicyConfig mergePolicyConfig = r.getMergePolicyConfig();
        gen.open("replicatedmap", "name", r.getName()).node("in-memory-format", r.getInMemoryFormat()).node("async-fillup", r.isAsyncFillup()).node("statistics-enabled", r.isStatisticsEnabled()).node("split-brain-protection-ref", r.getSplitBrainProtectionName()).node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize());
        if (!r.getListenerConfigs().isEmpty()) {
            gen.open("entry-listeners");
            for (ListenerConfig lc : r.getListenerConfigs()) {
                gen.node("entry-listener", classNameOrImplClass(lc.getClassName(), lc.getImplementation()), "include-value", lc.isIncludeValue(), "local", lc.isLocal());
            }
            gen.close();
        }
        gen.close();
    }
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig)

Example 9 with MergePolicyConfig

use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.

the class DynamicConfigXmlGenerator method queueXmlGenerator.

public static void queueXmlGenerator(ConfigXmlGenerator.XmlGenerator gen, Config config) {
    Collection<QueueConfig> qCfgs = config.getQueueConfigs().values();
    for (QueueConfig q : qCfgs) {
        gen.open("queue", "name", q.getName()).node("priority-comparator-class-name", q.getPriorityComparatorClassName()).node("statistics-enabled", q.isStatisticsEnabled()).node("max-size", q.getMaxSize()).node("backup-count", q.getBackupCount()).node("async-backup-count", q.getAsyncBackupCount()).node("empty-queue-ttl", q.getEmptyQueueTtl());
        appendItemListenerConfigs(gen, q.getItemListenerConfigs());
        QueueStoreConfig storeConfig = q.getQueueStoreConfig();
        if (storeConfig != null) {
            gen.open("queue-store", "enabled", storeConfig.isEnabled()).node("class-name", classNameOrImplClass(storeConfig.getClassName(), storeConfig.getStoreImplementation())).node("factory-class-name", classNameOrImplClass(storeConfig.getFactoryClassName(), storeConfig.getFactoryImplementation())).appendProperties(storeConfig.getProperties()).close();
        }
        MergePolicyConfig mergePolicyConfig = q.getMergePolicyConfig();
        gen.node("split-brain-protection-ref", q.getSplitBrainProtectionName()).node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()).close();
    }
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) QueueConfig(com.hazelcast.config.QueueConfig)

Example 10 with MergePolicyConfig

use of com.hazelcast.config.MergePolicyConfig in project hazelcast by hazelcast.

the class DynamicConfigXmlGenerator method scheduledExecutorXmlGenerator.

public static void scheduledExecutorXmlGenerator(ConfigXmlGenerator.XmlGenerator gen, Config config) {
    for (ScheduledExecutorConfig ex : config.getScheduledExecutorConfigs().values()) {
        MergePolicyConfig mergePolicyConfig = ex.getMergePolicyConfig();
        gen.open("scheduled-executor-service", "name", ex.getName()).node("pool-size", ex.getPoolSize()).node("durability", ex.getDurability()).node("capacity", ex.getCapacity()).node("capacity-policy", ex.getCapacityPolicy().name()).node("split-brain-protection-ref", ex.getSplitBrainProtectionName()).node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()).node("statistics-enabled", ex.isStatisticsEnabled()).close();
    }
}
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