use of com.sequenceiq.sdx.api.model.SdxRestoreResponse in project cloudbreak by hortonworks.
the class SdxRestoreAction method action.
@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
String sdxName = testDto.getName();
Log.when(LOGGER, format(" SDX '%s' restore has been started to '%s' ", sdxName, backupLocation));
Log.whenJson(LOGGER, " SDX restore request: ", testDto.getRequest());
LOGGER.info(format(" SDX '%s' restore has been started to '%s'... ", sdxName, backupLocation));
SdxRestoreResponse sdxRestoreResponse = client.getDefaultClient().sdxRestoreEndpoint().restoreDatalakeByName(sdxName, backupId, backupLocation);
testDto.setFlow("SDX restore", sdxRestoreResponse.getFlowIdentifier());
SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(sdxName, Collections.emptySet());
testDto.setResponse(detailedResponse);
Log.whenJson(LOGGER, " SDX response after restore: ", client.getDefaultClient().sdxEndpoint().get(sdxName));
return testDto;
}
use of com.sequenceiq.sdx.api.model.SdxRestoreResponse in project cloudbreak by hortonworks.
the class SdxBackupRestoreService method triggerDatalakeRestoreFlow.
private SdxRestoreResponse triggerDatalakeRestoreFlow(SdxCluster cluster, String backupId, String backupLocation, String backupLocationOverride) {
String selector = DATALAKE_TRIGGER_RESTORE_EVENT.event();
String userId = ThreadBasedUserCrnProvider.getUserCrn();
DatalakeTriggerRestoreEvent startEvent = new DatalakeTriggerRestoreEvent(selector, cluster.getId(), null, userId, backupId, backupLocation, backupLocationOverride, DatalakeRestoreFailureReason.USER_TRIGGERED);
FlowIdentifier flowIdentifier = sdxReactorFlowManager.triggerDatalakeRestoreFlow(startEvent, cluster.getClusterName());
return new SdxRestoreResponse(startEvent.getDrStatus().getOperationId(), flowIdentifier);
}
use of com.sequenceiq.sdx.api.model.SdxRestoreResponse in project cloudbreak by hortonworks.
the class SdxRestoreInternalAction method action.
@Override
public SdxInternalTestDto action(TestContext testContext, SdxInternalTestDto testDto, SdxClient client) throws Exception {
String sdxName = testDto.getName();
testContext.waitingFor(Duration.ofMinutes(2), "Waiting for CM services to be synchronized has been interrupted");
Log.when(LOGGER, format(" Internal SDX '%s' restore has been started to '%s' ", sdxName, backupLocation));
Log.whenJson(LOGGER, " Internal SDX restore request: ", testDto.getRequest());
LOGGER.info(format(" Internal SDX '%s' restore has been started to '%s'... ", sdxName, backupLocation));
SdxRestoreResponse sdxRestoreResponse = client.getDefaultClient().sdxRestoreEndpoint().restoreDatalakeByName(sdxName, backupId, backupLocation);
testDto.setFlow("SDX restore", sdxRestoreResponse.getFlowIdentifier());
SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetail(sdxName, Collections.emptySet());
testDto.setResponse(detailedResponse);
Log.whenJson(LOGGER, " Internal SDX response after restore: ", client.getDefaultClient().sdxEndpoint().get(sdxName));
return testDto;
}
use of com.sequenceiq.sdx.api.model.SdxRestoreResponse in project cloudbreak by hortonworks.
the class SdxBackupRestoreService method triggerDatalakeRestoreFlow.
private SdxRestoreResponse triggerDatalakeRestoreFlow(Long clusterId, String backupId, String backupLocation, String backupLocationOverride) {
String selector = DATALAKE_TRIGGER_RESTORE_EVENT.event();
String userId = ThreadBasedUserCrnProvider.getUserCrn();
DatalakeTriggerRestoreEvent startEvent = new DatalakeTriggerRestoreEvent(selector, clusterId, null, userId, backupId, backupLocation, backupLocationOverride, DatalakeRestoreFailureReason.USER_TRIGGERED);
FlowIdentifier flowIdentifier = sdxReactorFlowManager.triggerDatalakeRestoreFlow(startEvent);
return new SdxRestoreResponse(startEvent.getDrStatus().getOperationId(), flowIdentifier);
}
Aggregations