Search in sources :

Example 6 with CRDTReplicationConfig

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

Example 7 with CRDTReplicationConfig

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);
}
Also used : Config(com.hazelcast.config.Config) PNCounterConfig(com.hazelcast.config.PNCounterConfig) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) TestHazelcastInstanceFactory(com.hazelcast.test.TestHazelcastInstanceFactory) PNCounterConfig(com.hazelcast.config.PNCounterConfig) Before(org.junit.Before)

Aggregations

CRDTReplicationConfig (com.hazelcast.config.CRDTReplicationConfig)7 Config (com.hazelcast.config.Config)4 Before (org.junit.Before)4 PNCounterConfig (com.hazelcast.config.PNCounterConfig)2 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)2 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1 Node (org.w3c.dom.Node)1