Skip to content

Commit

Permalink
added async gcs snapshoter PR review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kwadie committed Feb 14, 2023
1 parent 5be37aa commit 607e162
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.cloud.pso.bq_snapshot_manager.entities.backup_policy.BackupMethod;
import com.google.cloud.pso.bq_snapshot_manager.functions.f04_tagger.TaggerRequest;
import com.google.cloud.pso.bq_snapshot_manager.helpers.LoggingHelper;
import com.google.cloud.pso.bq_snapshot_manager.helpers.TrackingHelper;
import com.google.cloud.pso.bq_snapshot_manager.helpers.Utils;
import com.google.cloud.pso.bq_snapshot_manager.services.bq.BigQueryService;
import com.google.cloud.pso.bq_snapshot_manager.services.pubsub.FailedPubSubMessage;
Expand Down Expand Up @@ -141,7 +142,7 @@ public BigQuerySnapshoterResponse execute(SnapshoterRequest request, Timestamp o

if(!request.isDryRun()){
// API Call
String jobId = String.format("%s_%s_%s", Globals.APPLICATION_NAME, "snapshot", request.getTrackingId());
String jobId = TrackingHelper.generateBQSnapshotJobId(request.getTrackingId());

bqService.createSnapshot(
jobId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ public static String generateBQExportJobId(String trackingId){
public static String parseTrackingIdFromBQExportJobId(String bqExportJobId){
return Utils.tokenize(bqExportJobId,"_", true).get(0);
}

public static String generateBQSnapshotJobId(String trackingId){
return String.format("%s_%s_%s",trackingId, "snapshot", Globals.APPLICATION_NAME, trackingId);
}

}

0 comments on commit 607e162

Please sign in to comment.