use of com.ctrip.xpipe.redis.console.migration.model.MigrationEvent in project x-pipe by ctripcorp.
the class DefaultMigrationEventManager method loadAndAdd.
private MigrationEvent loadAndAdd(long eventId) {
try {
MigrationEvent migrationEvent = migrationEventDao.buildMigrationEvent(eventId);
addEvent(migrationEvent);
return migrationEvent;
} catch (Throwable th) {
logger.error("[load][event]" + eventId, th);
}
return null;
}
use of com.ctrip.xpipe.redis.console.migration.model.MigrationEvent in project x-pipe by ctripcorp.
the class MigrationApi method checkStatus.
@RequestMapping(value = "/checkstatus/{ticketId}", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_UTF8_VALUE })
public CheckStatusResponse checkStatus(@PathVariable int ticketId) {
logger.info("[checkStatus]{}", ticketId);
CheckStatusResponse response = new CheckStatusResponse();
MigrationEvent migrationEvent = migrationService.getMigrationEvent(ticketId);
if (migrationEvent == null) {
logger.error("[checkStatus][can not find eventId]{}", ticketId);
return response;
}
migrationEvent.getMigrationClusters().forEach(migrationCluster -> {
String clusterName = migrationCluster.clusterName();
MigrationStatus migrationStatus = migrationCluster.getStatus();
CheckStatusClusterResponse checkResponse = new CheckStatusClusterResponse(clusterName, DO_STATUS.fromMigrationStatus(migrationStatus), migrationStatus.getPercent(), migrationStatus.toString());
checkResponse.setFromIdc(migrationCluster.fromDc());
checkResponse.setToIdc(migrationCluster.destDc());
response.addResult(checkResponse);
});
mapResponseIdc(response.getResults());
return response;
}
Aggregations