Search in sources :

Example 1 with CRDTReplicationConfig

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

the class TestFullApplicationContext method testCRDTReplicationConfig.

@Test
public void testCRDTReplicationConfig() {
    CRDTReplicationConfig replicationConfig = config.getCRDTReplicationConfig();
    assertEquals(10, replicationConfig.getMaxConcurrentReplicationTargets());
    assertEquals(2000, replicationConfig.getReplicationPeriodMillis());
}
Also used : CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) Test(org.junit.Test) QuickTest(com.hazelcast.test.annotation.QuickTest)

Example 2 with CRDTReplicationConfig

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

the class PNCounterConsistencyLostTest method setup.

@Before
public void setup() {
    final Config dataConfig = new Config().setProperty(ClusterProperty.PARTITION_COUNT.getName(), "5").setCRDTReplicationConfig(new CRDTReplicationConfig().setReplicationPeriodMillis(Integer.MAX_VALUE).setMaxConcurrentReplicationTargets(Integer.MAX_VALUE));
    final Config liteConfig = new Config().setProperty(ClusterProperty.PARTITION_COUNT.getName(), "5").setLiteMember(true);
    TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(3);
    members = factory.newInstances(dataConfig, 2);
    liteMember = factory.newHazelcastInstance(liteConfig);
}
Also used : Config(com.hazelcast.config.Config) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) TestHazelcastInstanceFactory(com.hazelcast.test.TestHazelcastInstanceFactory) Before(org.junit.Before)

Example 3 with CRDTReplicationConfig

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

the class ClientPNCounterBasicIntegrationTest 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);
    members = hazelcastFactory.newInstances(config, 2);
    clients = new HazelcastInstance[] { hazelcastFactory.newHazelcastClient(), hazelcastFactory.newHazelcastClient() };
}
Also used : Config(com.hazelcast.config.Config) PNCounterConfig(com.hazelcast.config.PNCounterConfig) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) Before(org.junit.Before)

Example 4 with CRDTReplicationConfig

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

the class ClientPNCounterConsistencyLostTest method setup.

@Before
public void setup() {
    final Config config = new Config().setProperty(ClusterProperty.PARTITION_COUNT.getName(), "5").setCRDTReplicationConfig(new CRDTReplicationConfig().setReplicationPeriodMillis(Integer.MAX_VALUE).setMaxConcurrentReplicationTargets(Integer.MAX_VALUE));
    members = hazelcastFactory.newInstances(config, 2);
    client = hazelcastFactory.newHazelcastClient();
}
Also used : Config(com.hazelcast.config.Config) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) Before(org.junit.Before)

Example 5 with CRDTReplicationConfig

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

the class MemberDomConfigProcessor method handleCRDTReplication.

private void handleCRDTReplication(Node root) {
    final CRDTReplicationConfig replicationConfig = new CRDTReplicationConfig();
    final String replicationPeriodMillisName = "replication-period-millis";
    final String maxConcurrentReplicationTargetsName = "max-concurrent-replication-targets";
    for (Node n : childElements(root)) {
        final String name = cleanNodeName(n);
        if (matches(replicationPeriodMillisName, name)) {
            replicationConfig.setReplicationPeriodMillis(getIntegerValue(replicationPeriodMillisName, getTextContent(n)));
        } else if (matches(maxConcurrentReplicationTargetsName, name)) {
            replicationConfig.setMaxConcurrentReplicationTargets(getIntegerValue(maxConcurrentReplicationTargetsName, getTextContent(n)));
        }
    }
    this.config.setCRDTReplicationConfig(replicationConfig);
}
Also used : CRDTReplicationConfig(com.hazelcast.config.CRDTReplicationConfig) Node(org.w3c.dom.Node)

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