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();
}
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;
}
};
}
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;
}
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);
}
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;
}
Aggregations