use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class AntiEntropyCorrectnessTest method testPartitionData.
@Test
public void testPartitionData() throws InterruptedException {
HazelcastInstance[] instances = factory.newInstances(getConfig(true, true), nodeCount);
for (HazelcastInstance instance : instances) {
setBackupPacketDropFilter(instance, BACKUP_BLOCK_RATIO);
}
warmUpPartitions(instances);
for (HazelcastInstance instance : instances) {
fillData(instance);
}
assertSizeAndDataEventually();
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownMemberAndCluster_concurrently.
private void shutdownMemberAndCluster_concurrently(boolean initializePartitions) throws Exception {
Config config = new Config();
final HazelcastInstance master = factory.newHazelcastInstance(config);
final HazelcastInstance[] slaves = factory.newInstances(config, 3);
if (initializePartitions) {
warmUpPartitions(master);
}
Future f1 = spawn(new Runnable() {
@Override
public void run() {
master.shutdown();
}
});
Future f2 = spawn(new Runnable() {
@Override
public void run() {
changeClusterStateEventually(slaves[0], ClusterState.PASSIVE);
slaves[0].getCluster().shutdown();
}
});
f1.get();
f2.get();
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownMemberAndCluster.
private void shutdownMemberAndCluster(boolean initializePartitions) throws Exception {
Config config = new Config();
HazelcastInstance master = factory.newHazelcastInstance(config);
HazelcastInstance[] slaves = factory.newInstances(config, 3);
if (initializePartitions) {
warmUpPartitions(master);
}
master.shutdown();
changeClusterStateEventually(slaves[0], ClusterState.PASSIVE);
slaves[0].getCluster().shutdown();
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownSlaveAndTerminateMasterMember_concurrently.
@Test
public void shutdownSlaveAndTerminateMasterMember_concurrently() {
HazelcastInstance[] instances = factory.newInstances(new Config(), 5);
int shutdownIndex = RandomPicker.getInt(1, instances.length);
int terminateIndex = 0;
shutdownAndTerminateMembers_concurrently(instances, shutdownIndex, terminateIndex);
}
use of com.hazelcast.core.HazelcastInstance in project hazelcast by hazelcast.
the class GracefulShutdownTest method shutdownSlaveLiteMember.
@Test
public void shutdownSlaveLiteMember() {
HazelcastInstance hz1 = factory.newHazelcastInstance();
HazelcastInstance hz2 = factory.newHazelcastInstance(new Config().setLiteMember(true));
HazelcastInstance hz3 = factory.newHazelcastInstance();
warmUpPartitions(hz1, hz2, hz3);
hz2.shutdown();
assertPartitionAssignments();
}
Aggregations