use of com.hazelcast.config.CRDTReplicationConfig in project hazelcast by hazelcast.
the class CRDTReplicationMigrationService method init.
@Override
public void init(NodeEngine nodeEngine, Properties properties) {
final CRDTReplicationConfig replicationConfig = nodeEngine.getConfig().getCRDTReplicationConfig();
final int replicationPeriod = replicationConfig != null ? replicationConfig.getReplicationPeriodMillis() : CRDTReplicationConfig.DEFAULT_REPLICATION_PERIOD_MILLIS;
this.nodeEngine = nodeEngine;
this.logger = nodeEngine.getLogger(getClass());
this.replicationVectorClocks = new ReplicatedVectorClocks();
int maxTargets = replicationConfig != null ? replicationConfig.getMaxConcurrentReplicationTargets() : CRDTReplicationConfig.DEFAULT_MAX_CONCURRENT_REPLICATION_TARGETS;
this.replicationTask = nodeEngine.getExecutionService().scheduleWithRepetition(CRDT_REPLICATION_MIGRATION_EXECUTOR, new CRDTReplicationTask(nodeEngine, maxTargets, this), replicationPeriod, replicationPeriod, TimeUnit.MILLISECONDS);
}
use of com.hazelcast.config.CRDTReplicationConfig in project hazelcast by hazelcast.
the class PNCounterBasicIntegrationTest method setup.
@Before
public void setup() {
final PNCounterConfig counterConfig = new PNCounterConfig().setName("default").setReplicaCount(replicaCount).setStatisticsEnabled(true);
final Config config = new Config().setProperty(ClusterProperty.PARTITION_COUNT.getName(), "5").setCRDTReplicationConfig(new CRDTReplicationConfig().setReplicationPeriodMillis(200).setMaxConcurrentReplicationTargets(Integer.MAX_VALUE)).addPNCounterConfig(counterConfig);
final TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
instances = factory.newInstances(config);
}
Aggregations