Search in sources :

Example 1 with BucketLockException

use of bio.terra.service.resourcemanagement.exception.BucketLockException in project jade-data-repo by DataBiosphere.

the class IngestFilePrimaryDataLocationStep method doStep.

@Override
public StepResult doStep(FlightContext context) throws InterruptedException {
    FlightMap workingMap = context.getWorkingMap();
    Boolean loadComplete = workingMap.get(FileMapKeys.LOAD_COMPLETED, Boolean.class);
    if (loadComplete == null || !loadComplete) {
        try {
            GoogleBucketResource bucketForFile = locationService.getOrCreateBucketForFile(profileId, context.getFlightId());
            workingMap.put(FileMapKeys.BUCKET_INFO, bucketForFile);
        } catch (BucketLockException blEx) {
            return new StepResult(StepStatus.STEP_RESULT_FAILURE_RETRY, blEx);
        }
    }
    return StepResult.getStepResultSuccess();
}
Also used : GoogleBucketResource(bio.terra.service.resourcemanagement.google.GoogleBucketResource) FlightMap(bio.terra.stairway.FlightMap) StepResult(bio.terra.stairway.StepResult) BucketLockException(bio.terra.service.resourcemanagement.exception.BucketLockException)

Aggregations

BucketLockException (bio.terra.service.resourcemanagement.exception.BucketLockException)1 GoogleBucketResource (bio.terra.service.resourcemanagement.google.GoogleBucketResource)1 FlightMap (bio.terra.stairway.FlightMap)1 StepResult (bio.terra.stairway.StepResult)1