use of com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl in project hazelcast by hazelcast.
the class ClientPartitionLostListenerTest method test_partitionLostListener_invoked.
@Test
public void test_partitionLostListener_invoked() {
final HazelcastInstance instance = hazelcastFactory.newHazelcastInstance();
final HazelcastInstance client = hazelcastFactory.newHazelcastClient();
warmUpPartitions(instance, client);
final EventCollectingPartitionLostListener listener = new EventCollectingPartitionLostListener();
client.getPartitionService().addPartitionLostListener(listener);
assertRegistrationsSizeEventually(instance, 1);
final InternalPartitionServiceImpl partitionService = getNode(instance).getNodeEngine().getService(SERVICE_NAME);
final int partitionId = 5;
partitionService.onPartitionLost(new IPartitionLostEvent(partitionId, 0, null));
assertPartitionLostEventEventually(listener, partitionId);
}
use of com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl in project hazelcast by hazelcast.
the class AssignPartitions method run.
@Override
public void run() {
InternalPartitionServiceImpl service = getService();
service.firstArrangement();
}
use of com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl in project hazelcast by hazelcast.
the class BaseMigrationOperation method onMigrationStart.
void onMigrationStart() {
InternalPartitionServiceImpl partitionService = getService();
InternalMigrationListener migrationListener = partitionService.getInternalMigrationListener();
migrationListener.onMigrationStart(getMigrationParticipantType(), migrationInfo);
}
use of com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl in project hazelcast by hazelcast.
the class BaseMigrationOperation method setActiveMigration.
void setActiveMigration() {
InternalPartitionServiceImpl partitionService = getService();
MigrationManager migrationManager = partitionService.getMigrationManager();
MigrationInfo currentActiveMigration = migrationManager.setActiveMigration(migrationInfo);
if (currentActiveMigration != null) {
throw new RetryableHazelcastException("Cannot set active migration to " + migrationInfo + ". Current active migration is " + currentActiveMigration);
}
PartitionStateManager partitionStateManager = partitionService.getPartitionStateManager();
partitionStateManager.setMigratingFlag(migrationInfo.getPartitionId());
}
use of com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl in project hazelcast by hazelcast.
the class BaseMigrationOperation method onMigrationComplete.
void onMigrationComplete(boolean result) {
InternalPartitionServiceImpl partitionService = getService();
InternalMigrationListener migrationListener = partitionService.getInternalMigrationListener();
migrationListener.onMigrationComplete(getMigrationParticipantType(), migrationInfo, result);
}
Aggregations