Search in sources :

Example 1 with PartitionStateVersionMismatchException

use of com.hazelcast.internal.partition.PartitionStateVersionMismatchException in project hazelcast by hazelcast.

the class BaseMigrationOperation method verifyPartitionStateVersion.

private void verifyPartitionStateVersion() {
    InternalPartitionService partitionService = getService();
    int localPartitionStateVersion = partitionService.getPartitionStateVersion();
    if (partitionStateVersion != localPartitionStateVersion) {
        if (getNodeEngine().getThisAddress().equals(migrationInfo.getMaster())) {
            return;
        }
        // this is expected when cluster member list changes during migration
        throw new PartitionStateVersionMismatchException(partitionStateVersion, localPartitionStateVersion);
    }
}
Also used : InternalPartitionService(com.hazelcast.internal.partition.InternalPartitionService) PartitionStateVersionMismatchException(com.hazelcast.internal.partition.PartitionStateVersionMismatchException)

Aggregations

InternalPartitionService (com.hazelcast.internal.partition.InternalPartitionService)1 PartitionStateVersionMismatchException (com.hazelcast.internal.partition.PartitionStateVersionMismatchException)1