Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9a482e

Browse files
Google APIscopybara-github
authored andcommitted
feat!: Consolidate task details into service API and add orchestration result details
BREAKING CHANGE: This change relocates some task proto definitions and updates message fields, necessitating updates to imports. PiperOrigin-RevId: 423360094
1 parent ada32e9 commit c9a482e

File tree

9 files changed

+104
-102
lines changed

9 files changed

+104
-102
lines changed

google/cloud/bigquery/migration/tasks/assessment/v2alpha/bigquerymigration_v2alpha.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.

google/cloud/bigquery/migration/tasks/translation/v2alpha/dataset_reference.proto

Lines changed: 0 additions & 36 deletions
This file was deleted.

google/cloud/bigquery/migration/v2alpha/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
2121
proto_library(
2222
name = "migration_proto",
2323
srcs = [
24+
"assessment_task.proto",
2425
"migration_entities.proto",
2526
"migration_error_details.proto",
2627
"migration_metrics.proto",
2728
"migration_service.proto",
29+
"translation_task.proto",
2830
],
2931
deps = [
3032
"//google/api:annotations_proto",

google/cloud/bigquery/migration/tasks/assessment/v2alpha/assessment.proto renamed to google/cloud/bigquery/migration/v2alpha/assessment_task.proto

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,36 @@
1414

1515
syntax = "proto3";
1616

17-
package google.cloud.bigquery.migration.tasks.assessment.v2alpha;
17+
package google.cloud.bigquery.migration.v2alpha;
1818

1919
import "google/api/field_behavior.proto";
2020

21-
option csharp_namespace = "Google.Cloud.BigQuery.Migration.Tasks.Assessment.V2Alpha";
22-
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/migration/tasks/assessment/v2alpha;assessment";
21+
option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2Alpha";
22+
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/migration/v2alpha;migration";
2323
option java_multiple_files = true;
24-
option java_outer_classname = "AssessmentProto";
25-
option java_package = "com.google.cloud.bigquery.migration.tasks.assessment.v2alpha";
26-
option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\Tasks\\Assessment\\V2alpha";
24+
option java_outer_classname = "AssessmentTaskProto";
25+
option java_package = "com.google.cloud.bigquery.migration.v2alpha";
26+
option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2alpha";
2727

28-
// Assessment task details.
28+
// Assessment task config.
2929
message AssessmentTaskDetails {
3030
// Required. The Cloud Storage path for assessment input files.
3131
string input_path = 1 [(google.api.field_behavior) = REQUIRED];
3232

3333
// Required. The BigQuery dataset for output.
3434
string output_dataset = 2 [(google.api.field_behavior) = REQUIRED];
3535

36-
// Optional. An optional Cloud Storage path to write the query logs (which is then used
37-
// as an input path on the translation task)
36+
// Optional. An optional Cloud Storage path to write the query logs (which is
37+
// then used as an input path on the translation task)
3838
string querylogs_path = 3 [(google.api.field_behavior) = OPTIONAL];
3939

40-
// Required. The data source or data warehouse type (eg: TERADATA/REDSHIFT) from which
41-
// the input data is extracted.
40+
// Required. The data source or data warehouse type (eg: TERADATA/REDSHIFT)
41+
// from which the input data is extracted.
4242
string data_source = 4 [(google.api.field_behavior) = REQUIRED];
4343
}
44+
45+
// Details for an assessment task orchestration result.
46+
message AssessmentOrchestrationResultDetails {
47+
// Optional. The version used for the output table schemas.
48+
string output_tables_schema_version = 1 [(google.api.field_behavior) = OPTIONAL];
49+
}

google/cloud/bigquery/migration/v2alpha/bigquerymigration_v2alpha.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,27 @@ title: BigQuery Migration API
55

66
apis:
77
- name: google.cloud.bigquery.migration.v2alpha.MigrationService
8+
- name: google.cloud.bigquery.migration.v2alpha.SqlTranslationService
89

910
documentation:
1011
summary: |-
11-
The BigQuery migration service, exposing apis for migration jobs operations, and
12+
The migration service, exposing apis for migration jobs operations, and
1213
agent management.
1314
1415
backend:
1516
rules:
1617
- selector: 'google.cloud.bigquery.migration.v2alpha.MigrationService.*'
1718
deadline: 60.0
19+
- selector: google.cloud.bigquery.migration.v2alpha.SqlTranslationService.TranslateQuery
20+
deadline: 60.0
1821

1922
authentication:
2023
rules:
2124
- selector: 'google.cloud.bigquery.migration.v2alpha.MigrationService.*'
2225
oauth:
2326
canonical_scopes: |-
2427
https://www.googleapis.com/auth/cloud-platform
28+
- selector: google.cloud.bigquery.migration.v2alpha.SqlTranslationService.TranslateQuery
29+
oauth:
30+
canonical_scopes: |-
31+
https://www.googleapis.com/auth/cloud-platform

google/cloud/bigquery/migration/v2alpha/migration_entities.proto

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ package google.cloud.bigquery.migration.v2alpha;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
21+
import "google/cloud/bigquery/migration/v2alpha/assessment_task.proto";
2122
import "google/cloud/bigquery/migration/v2alpha/migration_error_details.proto";
2223
import "google/cloud/bigquery/migration/v2alpha/migration_metrics.proto";
24+
import "google/cloud/bigquery/migration/v2alpha/translation_task.proto";
2325
import "google/protobuf/any.proto";
2426
import "google/protobuf/timestamp.proto";
2527
import "google/rpc/error_details.proto";
@@ -117,6 +119,15 @@ message MigrationTask {
117119
FAILED = 6;
118120
}
119121

122+
// The details of the task.
123+
oneof task_details {
124+
// Task configuration for Assessment.
125+
AssessmentTaskDetails assessment_task_details = 12;
126+
127+
// Task configuration for Batch/Offline SQL Translation.
128+
TranslationTaskDetails translation_task_details = 13;
129+
}
130+
120131
// Output only. Immutable. The unique identifier for the migration task. The ID is server-generated.
121132
string id = 1 [
122133
(google.api.field_behavior) = OUTPUT_ONLY,
@@ -126,6 +137,7 @@ message MigrationTask {
126137
// The type of the task. This must be a supported task type.
127138
string type = 2;
128139

140+
// DEPRECATED! Use one of the task_details below.
129141
// The details of the task. The type URL must be one of the supported task
130142
// details messages and correspond to the Task's type.
131143
google.protobuf.Any details = 3;
@@ -141,6 +153,9 @@ message MigrationTask {
141153

142154
// Time when the task was last updated.
143155
google.protobuf.Timestamp last_update_time = 7;
156+
157+
// Output only. Additional information about the orchestration.
158+
MigrationTaskOrchestrationResult orchestration_result = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
144159
}
145160

146161
// A subtask for a migration which carries details about the configuration of
@@ -217,3 +232,13 @@ message MigrationSubtask {
217232
// The metrics for the subtask.
218233
repeated TimeSeries metrics = 11;
219234
}
235+
236+
// Additional information from the orchestrator when it is done with the
237+
// task orchestration.
238+
message MigrationTaskOrchestrationResult {
239+
// Details specific to the task type.
240+
oneof details {
241+
// Details specific to assessment task types.
242+
AssessmentOrchestrationResultDetails assessment_details = 1;
243+
}
244+
}

google/cloud/bigquery/migration/v2alpha/translation_service.proto

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ message TranslateQueryRequest {
5454
TERADATA = 1;
5555
}
5656

57-
// Required. Project ID of the project that will be charged for the quota.
57+
// Required. The name of the project to which this translation request belongs.
58+
// Example: `projects/foo/locations/bar`
5859
string parent = 1 [
5960
(google.api.field_behavior) = REQUIRED,
6061
(google.api.resource_reference) = {
@@ -71,6 +72,13 @@ message TranslateQueryRequest {
7172

7273
// The response of translating a SQL query to Standard SQL.
7374
message TranslateQueryResponse {
75+
// Output only. Immutable. The unique identifier for the SQL translation job.
76+
// Example: `projects/123/locations/us/translation/1234`
77+
string translation_job = 4 [
78+
(google.api.field_behavior) = OUTPUT_ONLY,
79+
(google.api.field_behavior) = IMMUTABLE
80+
];
81+
7482
// The translated result. This will be empty if the translation fails.
7583
string translated_query = 1;
7684

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@
1414

1515
syntax = "proto3";
1616

17-
package google.cloud.bigquery.migration.tasks.translation.v2alpha;
17+
package google.cloud.bigquery.migration.v2alpha;
1818

19-
import "google/cloud/bigquery/migration/tasks/translation/v2alpha/dataset_reference.proto";
20-
21-
option csharp_namespace = "Google.Cloud.BigQuery.Migration.Tasks.Translation.V2Alpha";
22-
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/migration/tasks/translation/v2alpha;translation";
19+
option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2Alpha";
20+
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/migration/v2alpha;migration";
2321
option java_multiple_files = true;
24-
option java_outer_classname = "TranslationProto";
25-
option java_package = "com.google.cloud.bigquery.migration.tasks.translation.v2alpha";
26-
option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\Tasks\\Translation\\V2alpha";
22+
option java_outer_classname = "TranslationTaskProto";
23+
option java_package = "com.google.cloud.bigquery.migration.v2alpha";
24+
option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2alpha";
2725

2826
// Mapping between an input and output file to be translated in a subtask.
2927
message TranslationFileMapping {
@@ -34,7 +32,7 @@ message TranslationFileMapping {
3432
string output_path = 2;
3533
}
3634

37-
// The translation task details to capture necessary settings for a translation
35+
// The translation task config to capture necessary settings for a translation
3836
// task and subtask.
3937
message TranslationTaskDetails {
4038
// The file encoding types.
@@ -88,6 +86,15 @@ message TranslationTaskDetails {
8886
TIMESTAMP = 7;
8987
}
9088

89+
// The language specific settings for the translation task.
90+
oneof language_options {
91+
// The Teradata SQL specific settings for the translation task.
92+
TeradataOptions teradata_options = 10;
93+
94+
// The BTEQ specific settings for the translation task.
95+
BteqOptions bteq_options = 11;
96+
}
97+
9198
// The Cloud Storage path for translation input files.
9299
string input_path = 1;
93100

@@ -118,15 +125,6 @@ message TranslationTaskDetails {
118125
// The filter applied to translation details.
119126
Filter filter = 7;
120127

121-
// The language specific settings for the translation task.
122-
oneof language_options {
123-
// The Teradata SQL specific settings for the translation task.
124-
TeradataOptions teradata_options = 10;
125-
126-
// The BTEQ specific settings for the translation task.
127-
BteqOptions bteq_options = 11;
128-
}
129-
130128
// Specifies the exact name of the bigquery table ("dataset.table") to be used
131129
// for surfacing raw translation errors. If the table does not exist, we will
132130
// create it. If it already exists and the schema is the same, we will re-use.
@@ -196,3 +194,14 @@ message BteqOptions {
196194
// value).
197195
map<string, string> file_replacement_map = 3;
198196
}
197+
198+
// Reference to a BigQuery dataset.
199+
message DatasetReference {
200+
// A unique ID for this dataset, without the project name. The ID
201+
// must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
202+
// The maximum length is 1,024 characters.
203+
string dataset_id = 1;
204+
205+
// The ID of the project containing this dataset.
206+
string project_id = 2;
207+
}

google/cloud/bigquerymigration/v2alpha/bigquerymigration_grpc_service_config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,21 @@
4343
}
4444
],
4545
"timeout": "60s"
46+
},
47+
{
48+
"name": [
49+
{
50+
"service": "google.cloud.bigquery.migration.v2alpha.SqlTranslationService",
51+
"method": "Translate"
52+
}
53+
],
54+
"timeout": "30s",
55+
"retryPolicy": {
56+
"maxAttempts": 3,
57+
"initialBackoff": "0.100s",
58+
"maxBackoff": "1s",
59+
"backoffMultiplier": 1.3,
60+
"retryableStatusCodes": ["UNAVAILABLE"]
61+
}
4662
}]
4763
}

0 commit comments

Comments
 (0)