Is there a way to wait for the completion status of a transfer?

Viewed 134

I am creating a S3 transfer to Big Query using Java and Google's Big Query Data Transfer package. My steps are:

  1. Create a TransferConfig with my S3 details/permissions
  2. Create a DataTransferServiceClient
  3. Use steps 1 and 2 to create a TransferConfigRequest on Big Query
  4. Create and start a StartManualTransferRunsRequest using the TransferConfig details
  5. WAIT for transfer to be completed, then do additional things

I'm unsure how to approach step 5 and whether or not the Big Query Data Transfer package has a way to return a status once the transfer is completed. Does anyone know a recommended way to solve this issue?

1 Answers

Based on the public documentation that Google offers, you could create a cloud monitoring alert following these steps:

  1. In the Cloud Console, go to the Monitoring page.
  2. In the navigation pane, select Alerting > Create policy.
  3. Click Add Condition and select a condition type. 4.Select metrics and filters. For metrics, the resource type is BigQuery DTS Config.
  4. Click Save Condition.
  5. Enter policy name, and then click Save Policy.

Here you can see more details on how to correctly define cloud monitoring alerts.

Related