use of com.hazelcast.internal.partition.PartitionReplica in project hazelcast by hazelcast.
the class MigrationPlannerCycleTest method testCycle3_fixed.
@Test
public void testCycle3_fixed() throws UnknownHostException {
final PartitionReplica[] oldReplicas = { new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), new PartitionReplica(new Address("localhost", 5703), uuids[2]), new PartitionReplica(new Address("localhost", 5704), uuids[3]), new PartitionReplica(new Address("localhost", 5705), uuids[4]), null, null };
final PartitionReplica[] newReplicas = { new PartitionReplica(new Address("localhost", 5705), uuids[4]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5704), uuids[3]), new PartitionReplica(new Address("localhost", 5703), uuids[2]), null, null };
assertTrue(migrationPlanner.fixCycle(oldReplicas, newReplicas));
assertArrayEquals(oldReplicas, newReplicas);
}
use of com.hazelcast.internal.partition.PartitionReplica in project hazelcast by hazelcast.
the class MigrationPlannerCycleTest method testCycle1_fixed.
@Test
public void testCycle1_fixed() throws UnknownHostException {
final PartitionReplica[] oldReplicas = { new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), null, null, null, null, null };
final PartitionReplica[] newReplicas = new PartitionReplica[] { new PartitionReplica(new Address("localhost", 5702), uuids[1]), new PartitionReplica(new Address("localhost", 5701), uuids[0]), null, null, null, null, null };
assertTrue(migrationPlanner.fixCycle(oldReplicas, newReplicas));
assertArrayEquals(oldReplicas, newReplicas);
}
use of com.hazelcast.internal.partition.PartitionReplica in project hazelcast by hazelcast.
the class MigrationPlannerCycleTest method testCycle2_fixed.
@Test
public void testCycle2_fixed() throws UnknownHostException {
final PartitionReplica[] oldReplicas = { new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), new PartitionReplica(new Address("localhost", 5703), uuids[2]), null, null, null, null };
final PartitionReplica[] newReplicas = { new PartitionReplica(new Address("localhost", 5703), uuids[2]), new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), null, null, null, null };
assertTrue(migrationPlanner.fixCycle(oldReplicas, newReplicas));
assertArrayEquals(oldReplicas, newReplicas);
}
use of com.hazelcast.internal.partition.PartitionReplica in project hazelcast by hazelcast.
the class MigrationPlannerCycleTest method testCycle4_fixed.
@Test
public void testCycle4_fixed() throws UnknownHostException {
final PartitionReplica[] oldReplicas = { new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), new PartitionReplica(new Address("localhost", 5703), uuids[2]), new PartitionReplica(new Address("localhost", 5704), uuids[3]), new PartitionReplica(new Address("localhost", 5705), uuids[4]), new PartitionReplica(new Address("localhost", 5706), uuids[5]), new PartitionReplica(new Address("localhost", 5707), uuids[6]) };
final PartitionReplica[] newReplicas = { new PartitionReplica(new Address("localhost", 5705), uuids[4]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5704), uuids[3]), new PartitionReplica(new Address("localhost", 5703), uuids[2]), new PartitionReplica(new Address("localhost", 5707), uuids[6]), new PartitionReplica(new Address("localhost", 5706), uuids[5]) };
assertTrue(migrationPlanner.fixCycle(oldReplicas, newReplicas));
assertArrayEquals(oldReplicas, newReplicas);
}
use of com.hazelcast.internal.partition.PartitionReplica in project hazelcast by hazelcast.
the class MigrationPlannerCycleTest method testCycle2.
@Test
public void testCycle2() throws UnknownHostException {
final PartitionReplica[] oldReplicas = { new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), new PartitionReplica(new Address("localhost", 5703), uuids[2]), null, null, null, null };
final PartitionReplica[] newReplicas = { new PartitionReplica(new Address("localhost", 5703), uuids[2]), new PartitionReplica(new Address("localhost", 5701), uuids[0]), new PartitionReplica(new Address("localhost", 5702), uuids[1]), null, null, null, null };
assertTrue(migrationPlanner.isCyclic(oldReplicas, newReplicas));
}
Aggregations