use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownAndTerminateSlaveMembers_concurrently.
@Test
public void shutdownAndTerminateSlaveMembers_concurrently() {
HazelcastInstance[] instances = factory.newInstances(new Config(), 5);
int shutdownIndex = RandomPicker.getInt(1, instances.length);
int terminateIndex;
do {
terminateIndex = RandomPicker.getInt(1, instances.length);
} while (terminateIndex == shutdownIndex);
shutdownAndTerminateMembers_concurrently(instances, shutdownIndex, terminateIndex);
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownMultipleMembers.
private void shutdownMultipleMembers(boolean includeMaster, boolean initializePartitions) {
final HazelcastInstance[] instances = factory.newInstances(new Config(), 6);
if (initializePartitions) {
warmUpPartitions(instances);
}
final CountDownLatch latch = new CountDownLatch(instances.length / 2);
int startIndex = includeMaster ? 0 : 1;
for (int i = startIndex; i < instances.length; i += 2) {
final int index = i;
new Thread() {
public void run() {
instances[index].shutdown();
latch.countDown();
}
}.start();
}
assertOpenEventually(latch);
if (initializePartitions) {
assertPartitionAssignments();
}
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownMasterMember_withoutPartitionInitialization.
@Test
public void shutdownMasterMember_withoutPartitionInitialization() {
HazelcastInstance hz1 = factory.newHazelcastInstance();
HazelcastInstance hz2 = factory.newHazelcastInstance();
HazelcastInstance hz3 = factory.newHazelcastInstance();
hz1.shutdown();
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownSingleMember_withPartitionInitialization.
@Test
public void shutdownSingleMember_withPartitionInitialization() {
HazelcastInstance hz = factory.newHazelcastInstance();
warmUpPartitions(hz);
hz.shutdown();
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownMasterLiteMember.
@Test
public void shutdownMasterLiteMember() {
HazelcastInstance hz1 = factory.newHazelcastInstance(new Config().setLiteMember(true));
HazelcastInstance hz2 = factory.newHazelcastInstance();
HazelcastInstance hz3 = factory.newHazelcastInstance();
warmUpPartitions(hz1, hz2, hz3);
hz1.shutdown();
assertPartitionAssignments();
}
Aggregations