private boolean migrate(CRDTReplicationAwareService service, Member target, int maxConfiguredReplicaCount) {
        if (Thread.currentThread().isInterrupted()) {
            return false;
        }
        final OperationService operationService = nodeEngine.getOperationService();
        final CRDTReplicationContainer migrationOperation = service.prepareMigrationOperation(maxConfiguredReplicaCount);

        if (migrationOperation == null) {
            logger.finest("Skipping migration of " + service.getName() + " for target " + target);
            return true;
        }
        try {
            logger.finest("Migrating " + service.getName() + " to " + target);
            operationService.invokeOnTarget(null, migrationOperation.getOperation(), target.getAddress()).join();
            final boolean allMigrated = service.clearCRDTState(migrationOperation.getVectorClocks());
            if (!allMigrated) {
                logger.fine(service.getName() + " CRDTs have been mutated since migrated to target " + target
                        + ". Rescheduling migration in " + MIGRATION_RETRY_DELAY_SECONDS + " second(s).");
            }
            return allMigrated;
        } catch (Exception e) {
            if (logger.isFineEnabled()) {
                logger.fine("Failed migration of " + service.getName() + " for target " + target
                        + ". Rescheduling migration in " + MIGRATION_RETRY_DELAY_SECONDS + " second(s).", e);
            } else {
                logger.info("Failed migration of " + service.getName() + " for target " + target
                        + ". Rescheduling migration in " + MIGRATION_RETRY_DELAY_SECONDS + " second(s).");
            }
            return false;
        }
    }
private boolean migrate ( CRDTReplicationAwareService service , Member target , int maxConfiguredReplicaCount ) { if ( Thread . currentThread ( ) . isInterrupted ( ) ) { return false ; } final OperationService operationService = nodeEngine . getOperationService ( ) ; final CRDTReplicationContainer migrationOperation = service . prepareMigrationOperation ( maxConfiguredReplicaCount ) ; if ( migrationOperation == null ) { logger . finest ( "Skipping migration of " + service . getName ( ) + " for target " + target ) ; return true ; } try { logger . finest ( "Migrating " + service . getName ( ) + " to " + target ) ; operationService . invokeOnTarget ( null , migrationOperation . getOperation ( ) , target . getAddress ( ) ) . join ( ) ; final boolean allMigrated = service . clearCRDTState ( migrationOperation . getVectorClocks ( ) ) ; if ( ! allMigrated ) { logger . fine ( service . getName ( ) + " CRDTs have been mutated since migrated to target " + target + ". Rescheduling migration in " + MIGRATION_RETRY_DELAY_SECONDS + " second(s)." ) ; } return allMigrated ; } catch ( Exception e ) { if ( logger . isFineEnabled ( ) ) { logger . fine ( "Failed migration of " + service . getName ( ) + " for target " + target + ". Rescheduling migration in " + MIGRATION_RETRY_DELAY_SECONDS + " second(s)." , e ) ; } else { logger . info ( "Failed migration of " + service . getName ( ) + " for target " + target + ". Rescheduling migration in " + MIGRATION_RETRY_DELAY_SECONDS + " second(s)." ) ; } return false ; } }
Performs migration of a {@link CRDTReplicationAwareService} to the
given target.

@param service                   the service to migrate
@param target                    the target to migrate to
@param maxConfiguredReplicaCount the maximum configured replica count
for the CRDTs to be migrated (excluding)
@see CRDTReplicationAwareService