Search in sources :

Example 16 with ReplicatedMapConfig

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

the class ReplicatedMapMergeRunnable method getBatchSize.

@Override
protected int getBatchSize(String dataStructureName) {
    ReplicatedMapConfig replicatedMapConfig = getReplicatedMapConfig(dataStructureName);
    MergePolicyConfig mergePolicyConfig = replicatedMapConfig.getMergePolicyConfig();
    return mergePolicyConfig.getBatchSize();
}
Also used : MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig)

Example 17 with ReplicatedMapConfig

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

the class PartitionContainer method buildConstructorFunction.

private ConstructorFunction<String, ReplicatedRecordStore> buildConstructorFunction() {
    return new ConstructorFunction<String, ReplicatedRecordStore>() {

        @Override
        public ReplicatedRecordStore createNew(String name) {
            ReplicatedMapConfig replicatedMapConfig = service.getReplicatedMapConfig(name);
            InMemoryFormat inMemoryFormat = replicatedMapConfig.getInMemoryFormat();
            AbstractReplicatedRecordStore replicatedRecordStorage = null;
            switch(inMemoryFormat) {
                case OBJECT:
                    replicatedRecordStorage = new ObjectReplicatedRecordStorage(name, service, partitionId);
                    break;
                case BINARY:
                    replicatedRecordStorage = new DataReplicatedRecordStore(name, service, partitionId);
                    break;
                case NATIVE:
                    throw new IllegalStateException("Native memory not yet supported for replicated map");
                default:
                    throw new IllegalStateException("Unhandled in memory format:" + inMemoryFormat);
            }
            return replicatedRecordStorage;
        }
    };
}
Also used : AbstractReplicatedRecordStore(com.hazelcast.replicatedmap.impl.record.AbstractReplicatedRecordStore) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ObjectReplicatedRecordStorage(com.hazelcast.replicatedmap.impl.record.ObjectReplicatedRecordStorage) ConstructorFunction(com.hazelcast.util.ConstructorFunction) InMemoryFormat(com.hazelcast.config.InMemoryFormat) DataReplicatedRecordStore(com.hazelcast.replicatedmap.impl.record.DataReplicatedRecordStore)

Example 18 with ReplicatedMapConfig

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

the class ClientReplicatedMapTest method buildConfig.

private Config buildConfig(InMemoryFormat inMemoryFormat, long replicationDelay) {
    Config config = new Config();
    ReplicatedMapConfig replicatedMapConfig = config.getReplicatedMapConfig("default");
    replicatedMapConfig.setReplicationDelayMillis(replicationDelay);
    replicatedMapConfig.setInMemoryFormat(inMemoryFormat);
    return config;
}
Also used : SerializationConfig(com.hazelcast.config.SerializationConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) Config(com.hazelcast.config.Config) NearCacheConfig(com.hazelcast.config.NearCacheConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig)

Example 19 with ReplicatedMapConfig

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

the class AddReplicatedMapConfigMessageTask method checkStaticConfigDoesNotExist.

@Override
protected boolean checkStaticConfigDoesNotExist(IdentifiedDataSerializable config) {
    DynamicConfigurationAwareConfig nodeConfig = (DynamicConfigurationAwareConfig) nodeEngine.getConfig();
    ReplicatedMapConfig replicatedMapConfig = (ReplicatedMapConfig) config;
    return nodeConfig.checkStaticConfigDoesNotExist(nodeConfig.getStaticConfig().getReplicatedMapConfigs(), replicatedMapConfig.getName(), replicatedMapConfig);
}
Also used : ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) DynamicConfigurationAwareConfig(com.hazelcast.internal.dynamicconfig.DynamicConfigurationAwareConfig)

Example 20 with ReplicatedMapConfig

use of com.hazelcast.config.ReplicatedMapConfig 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)

Aggregations

ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)36 Test (org.junit.Test)16 QuickTest (com.hazelcast.test.annotation.QuickTest)15 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)13 Config (com.hazelcast.config.Config)9 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)8 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)7 ListenerConfig (com.hazelcast.config.ListenerConfig)6 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)5 CacheSimpleEntryListenerConfig (com.hazelcast.config.CacheSimpleEntryListenerConfig)5 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)5 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)5 ExecutorConfig (com.hazelcast.config.ExecutorConfig)5 FlakeIdGeneratorConfig (com.hazelcast.config.FlakeIdGeneratorConfig)5 ListConfig (com.hazelcast.config.ListConfig)5 MapConfig (com.hazelcast.config.MapConfig)5 MultiMapConfig (com.hazelcast.config.MultiMapConfig)5 PNCounterConfig (com.hazelcast.config.PNCounterConfig)5 QueueConfig (com.hazelcast.config.QueueConfig)5 ReliableTopicConfig (com.hazelcast.config.ReliableTopicConfig)5