use of bio.terra.service.snapshot.Snapshot in project jade-data-repo by DataBiosphere.
the class DeleteSnapshotMetadataStep method doStep.
@Override
public StepResult doStep(FlightContext context) {
Snapshot snapshot = null;
boolean found = false;
try {
found = snapshotDao.delete(snapshotId);
} catch (SnapshotNotFoundException ex) {
found = false;
}
DeleteResponseModel.ObjectStateEnum stateEnum = (found) ? DeleteResponseModel.ObjectStateEnum.DELETED : DeleteResponseModel.ObjectStateEnum.NOT_FOUND;
DeleteResponseModel deleteResponseModel = new DeleteResponseModel().objectState(stateEnum);
FlightUtils.setResponse(context, deleteResponseModel, HttpStatus.OK);
return StepResult.getStepResultSuccess();
}
use of bio.terra.service.snapshot.Snapshot in project jade-data-repo by DataBiosphere.
the class CountSnapshotTableRowsStep method doStep.
@Override
public StepResult doStep(FlightContext flightContext) throws InterruptedException, RetryException {
Snapshot snapshot = snapshotDao.retrieveSnapshotByName(snapshotReq.getName());
Map<String, Long> tableRowCounts = bigQueryPdao.getSnapshotTableRowCounts(snapshot);
snapshotDao.updateSnapshotTableRowCounts(snapshot, tableRowCounts);
return StepResult.getStepResultSuccess();
}
use of bio.terra.service.snapshot.Snapshot in project jade-data-repo by DataBiosphere.
the class CreateSnapshotFireStoreComputeStep method doStep.
@Override
public StepResult doStep(FlightContext context) {
Snapshot snapshot = snapshotService.retrieveByName(snapshotReq.getName());
fileDao.snapshotCompute(snapshot);
return StepResult.getStepResultSuccess();
}
use of bio.terra.service.snapshot.Snapshot in project jade-data-repo by DataBiosphere.
the class CreateSnapshotFireStoreDataStep method undoStep.
@Override
public StepResult undoStep(FlightContext context) throws InterruptedException {
// Remove the snapshot file system and any file dependencies created
Snapshot snapshot = snapshotService.retrieveByName(snapshotReq.getName());
fileDao.deleteFilesFromSnapshot(snapshot);
for (SnapshotSource snapshotSource : snapshot.getSnapshotSources()) {
Dataset dataset = datasetService.retrieve(snapshotSource.getDataset().getId());
dependencyDao.deleteSnapshotFileDependencies(dataset, snapshot.getId().toString());
}
return StepResult.getStepResultSuccess();
}
Aggregations