use of com.hazelcast.config.QuorumConfig in project hazelcast by hazelcast.
the class ClientCacheReadQuorumTest method initialize.
@BeforeClass
public static void initialize() throws Exception {
QuorumConfig quorumConfig = new QuorumConfig();
quorumConfig.setName(QUORUM_ID);
quorumConfig.setType(QuorumType.READ);
quorumConfig.setEnabled(true);
quorumConfig.setSize(3);
CacheSimpleConfig cacheConfig = new CacheSimpleConfig();
cacheConfig.setName(CACHE_NAME_PREFIX + "*");
cacheConfig.setQuorumName(QUORUM_ID);
factory = new TestHazelcastFactory();
cluster = new PartitionedCluster(factory).createFiveMemberCluster(cacheConfig, quorumConfig);
initializeClients();
initializeCaches();
cluster.splitFiveMembersThreeAndTwo();
verifyClients();
}
use of com.hazelcast.config.QuorumConfig in project hazelcast by hazelcast.
the class ClientCacheReadWriteQuorumTest method initialize.
@BeforeClass
public static void initialize() throws Exception {
QuorumConfig quorumConfig = new QuorumConfig();
quorumConfig.setName(QUORUM_ID);
quorumConfig.setType(QuorumType.READ_WRITE);
quorumConfig.setEnabled(true);
quorumConfig.setSize(3);
CacheSimpleConfig cacheConfig = new CacheSimpleConfig();
cacheConfig.setName(CACHE_NAME_PREFIX + "*");
cacheConfig.setQuorumName(QUORUM_ID);
factory = new TestHazelcastFactory();
cluster = new PartitionedCluster(factory).createFiveMemberCluster(cacheConfig, quorumConfig);
initializeClients();
initializeCaches();
cluster.splitFiveMembersThreeAndTwo();
verifyClients();
}
use of com.hazelcast.config.QuorumConfig in project hazelcast by hazelcast.
the class ClientMapWriteQuorumTest method initialize.
@BeforeClass
public static void initialize() throws Exception {
QuorumConfig quorumConfig = new QuorumConfig();
quorumConfig.setName(QUORUM_ID);
quorumConfig.setEnabled(true);
quorumConfig.setSize(3);
quorumConfig.setType(QuorumType.WRITE);
MapConfig mapConfig = new MapConfig(MAP_NAME_PREFIX + "*");
mapConfig.setQuorumName(QUORUM_ID);
factory = new TestHazelcastFactory();
cluster = new PartitionedCluster(factory).partitionFiveMembersThreeAndTwo(mapConfig, quorumConfig);
initializeClients();
verifyClients();
}
use of com.hazelcast.config.QuorumConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testQuorumConfig.
@Test
public void testQuorumConfig() {
assertNotNull(config);
assertEquals(1, config.getQuorumConfigs().size());
QuorumConfig quorumConfig = config.getQuorumConfig("my-quorum");
assertNotNull(quorumConfig);
assertEquals("my-quorum", quorumConfig.getName());
assertEquals("com.hazelcast.spring.DummyQuorumFunction", quorumConfig.getQuorumFunctionClassName());
assertEquals(true, quorumConfig.isEnabled());
assertEquals(2, quorumConfig.getSize());
assertEquals(2, quorumConfig.getListenerConfigs().size());
assertEquals(QuorumType.READ, quorumConfig.getType());
assertEquals("com.hazelcast.spring.DummyQuorumListener", quorumConfig.getListenerConfigs().get(0).getClassName());
assertNotNull(quorumConfig.getListenerConfigs().get(1).getImplementation());
}
use of com.hazelcast.config.QuorumConfig in project hazelcast by hazelcast.
the class QuorumServiceImpl method initializeQuorums.
private void initializeQuorums() {
for (QuorumConfig quorumConfig : nodeEngine.getConfig().getQuorumConfigs().values()) {
QuorumImpl quorum = new QuorumImpl(quorumConfig, nodeEngine);
quorums.put(quorumConfig.getName(), quorum);
}
}
Aggregations