Search in sources :

Example 1 with MigrationManager

use of com.hazelcast.internal.partition.impl.MigrationManager 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());
}
Also used : MigrationInfo(com.hazelcast.internal.partition.MigrationInfo) RetryableHazelcastException(com.hazelcast.spi.exception.RetryableHazelcastException) InternalPartitionServiceImpl(com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl) MigrationManager(com.hazelcast.internal.partition.impl.MigrationManager) PartitionStateManager(com.hazelcast.internal.partition.impl.PartitionStateManager)

Aggregations

MigrationInfo (com.hazelcast.internal.partition.MigrationInfo)1 InternalPartitionServiceImpl (com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl)1 MigrationManager (com.hazelcast.internal.partition.impl.MigrationManager)1 PartitionStateManager (com.hazelcast.internal.partition.impl.PartitionStateManager)1 RetryableHazelcastException (com.hazelcast.spi.exception.RetryableHazelcastException)1