Skip to content

Commit d6e934f

Browse files
feat: publish CopyBackup protos to external customers (#1883)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 557192020 Source-Link: https://togithub.com/googleapis/googleapis/commit/b4c238feaa1097c53798ed77035bbfeb7fc72e96 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/feccb30e3177da8b7b7e68149ca4bb914f8faf2a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmVjY2IzMGUzMTc3ZGE4YjdiN2U2ODE0OWNhNGJiOTE0ZjhmYWYyYSJ9
1 parent decfe98 commit d6e934f

File tree

60 files changed

+5928
-1268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5928
-1268
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java

Lines changed: 342 additions & 7 deletions
Large diffs are not rendered by default.

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
import com.google.bigtable.admin.v2.Backup;
3737
import com.google.bigtable.admin.v2.CheckConsistencyRequest;
3838
import com.google.bigtable.admin.v2.CheckConsistencyResponse;
39+
import com.google.bigtable.admin.v2.CopyBackupMetadata;
40+
import com.google.bigtable.admin.v2.CopyBackupRequest;
3941
import com.google.bigtable.admin.v2.CreateBackupMetadata;
4042
import com.google.bigtable.admin.v2.CreateBackupRequest;
4143
import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata;
@@ -235,6 +237,17 @@ public UnaryCallSettings<RestoreTableRequest, Operation> restoreTableSettings()
235237
return ((BigtableTableAdminStubSettings) getStubSettings()).restoreTableOperationSettings();
236238
}
237239

240+
/** Returns the object with the settings used for calls to copyBackup. */
241+
public UnaryCallSettings<CopyBackupRequest, Operation> copyBackupSettings() {
242+
return ((BigtableTableAdminStubSettings) getStubSettings()).copyBackupSettings();
243+
}
244+
245+
/** Returns the object with the settings used for calls to copyBackup. */
246+
public OperationCallSettings<CopyBackupRequest, Backup, CopyBackupMetadata>
247+
copyBackupOperationSettings() {
248+
return ((BigtableTableAdminStubSettings) getStubSettings()).copyBackupOperationSettings();
249+
}
250+
238251
/** Returns the object with the settings used for calls to getIamPolicy. */
239252
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
240253
return ((BigtableTableAdminStubSettings) getStubSettings()).getIamPolicySettings();
@@ -501,6 +514,17 @@ public UnaryCallSettings.Builder<RestoreTableRequest, Operation> restoreTableSet
501514
return getStubSettingsBuilder().restoreTableOperationSettings();
502515
}
503516

517+
/** Returns the builder for the settings used for calls to copyBackup. */
518+
public UnaryCallSettings.Builder<CopyBackupRequest, Operation> copyBackupSettings() {
519+
return getStubSettingsBuilder().copyBackupSettings();
520+
}
521+
522+
/** Returns the builder for the settings used for calls to copyBackup. */
523+
public OperationCallSettings.Builder<CopyBackupRequest, Backup, CopyBackupMetadata>
524+
copyBackupOperationSettings() {
525+
return getStubSettingsBuilder().copyBackupOperationSettings();
526+
}
527+
504528
/** Returns the builder for the settings used for calls to getIamPolicy. */
505529
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
506530
return getStubSettingsBuilder().getIamPolicySettings();

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ public String toString() {
124124
.add("undeleteTableOperationSettings", stubSettings.undeleteTableOperationSettings())
125125
.add("updateTableSettings", stubSettings.updateTableSettings())
126126
.add("updateTableOperationSettings", stubSettings.updateTableOperationSettings())
127+
.add("copyBackupSettings", stubSettings.copyBackupSettings())
128+
.add("copyBackupOperationSettings", stubSettings.copyBackupOperationSettings())
127129
.toString();
128130
}
129131

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
"CheckConsistency": {
8686
"methods": ["checkConsistency", "checkConsistency", "checkConsistency", "checkConsistencyCallable"]
8787
},
88+
"CopyBackup": {
89+
"methods": ["copyBackupAsync", "copyBackupAsync", "copyBackupAsync", "copyBackupAsync", "copyBackupAsync", "copyBackupOperationCallable", "copyBackupCallable"]
90+
},
8891
"CreateBackup": {
8992
"methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"]
9093
},

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import com.google.bigtable.admin.v2.Backup;
2828
import com.google.bigtable.admin.v2.CheckConsistencyRequest;
2929
import com.google.bigtable.admin.v2.CheckConsistencyResponse;
30+
import com.google.bigtable.admin.v2.CopyBackupMetadata;
31+
import com.google.bigtable.admin.v2.CopyBackupRequest;
3032
import com.google.bigtable.admin.v2.CreateBackupMetadata;
3133
import com.google.bigtable.admin.v2.CreateBackupRequest;
3234
import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata;
@@ -210,6 +212,15 @@ public UnaryCallable<RestoreTableRequest, Operation> restoreTableCallable() {
210212
throw new UnsupportedOperationException("Not implemented: restoreTableCallable()");
211213
}
212214

215+
public OperationCallable<CopyBackupRequest, Backup, CopyBackupMetadata>
216+
copyBackupOperationCallable() {
217+
throw new UnsupportedOperationException("Not implemented: copyBackupOperationCallable()");
218+
}
219+
220+
public UnaryCallable<CopyBackupRequest, Operation> copyBackupCallable() {
221+
throw new UnsupportedOperationException("Not implemented: copyBackupCallable()");
222+
}
223+
213224
public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
214225
throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()");
215226
}

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
import com.google.bigtable.admin.v2.Backup;
5050
import com.google.bigtable.admin.v2.CheckConsistencyRequest;
5151
import com.google.bigtable.admin.v2.CheckConsistencyResponse;
52+
import com.google.bigtable.admin.v2.CopyBackupMetadata;
53+
import com.google.bigtable.admin.v2.CopyBackupRequest;
5254
import com.google.bigtable.admin.v2.CreateBackupMetadata;
5355
import com.google.bigtable.admin.v2.CreateBackupRequest;
5456
import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata;
@@ -189,6 +191,9 @@ public class BigtableTableAdminStubSettings extends StubSettings<BigtableTableAd
189191
private final UnaryCallSettings<RestoreTableRequest, Operation> restoreTableSettings;
190192
private final OperationCallSettings<RestoreTableRequest, Table, RestoreTableMetadata>
191193
restoreTableOperationSettings;
194+
private final UnaryCallSettings<CopyBackupRequest, Operation> copyBackupSettings;
195+
private final OperationCallSettings<CopyBackupRequest, Backup, CopyBackupMetadata>
196+
copyBackupOperationSettings;
192197
private final UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings;
193198
private final UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings;
194199
private final UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
@@ -501,6 +506,17 @@ public UnaryCallSettings<RestoreTableRequest, Operation> restoreTableSettings()
501506
return restoreTableOperationSettings;
502507
}
503508

509+
/** Returns the object with the settings used for calls to copyBackup. */
510+
public UnaryCallSettings<CopyBackupRequest, Operation> copyBackupSettings() {
511+
return copyBackupSettings;
512+
}
513+
514+
/** Returns the object with the settings used for calls to copyBackup. */
515+
public OperationCallSettings<CopyBackupRequest, Backup, CopyBackupMetadata>
516+
copyBackupOperationSettings() {
517+
return copyBackupOperationSettings;
518+
}
519+
504520
/** Returns the object with the settings used for calls to getIamPolicy. */
505521
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
506522
return getIamPolicySettings;
@@ -620,6 +636,8 @@ protected BigtableTableAdminStubSettings(Builder settingsBuilder) throws IOExcep
620636
listBackupsSettings = settingsBuilder.listBackupsSettings().build();
621637
restoreTableSettings = settingsBuilder.restoreTableSettings().build();
622638
restoreTableOperationSettings = settingsBuilder.restoreTableOperationSettings().build();
639+
copyBackupSettings = settingsBuilder.copyBackupSettings().build();
640+
copyBackupOperationSettings = settingsBuilder.copyBackupOperationSettings().build();
623641
getIamPolicySettings = settingsBuilder.getIamPolicySettings().build();
624642
setIamPolicySettings = settingsBuilder.setIamPolicySettings().build();
625643
testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build();
@@ -675,6 +693,9 @@ public static class Builder
675693
private final UnaryCallSettings.Builder<RestoreTableRequest, Operation> restoreTableSettings;
676694
private final OperationCallSettings.Builder<RestoreTableRequest, Table, RestoreTableMetadata>
677695
restoreTableOperationSettings;
696+
private final UnaryCallSettings.Builder<CopyBackupRequest, Operation> copyBackupSettings;
697+
private final OperationCallSettings.Builder<CopyBackupRequest, Backup, CopyBackupMetadata>
698+
copyBackupOperationSettings;
678699
private final UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings;
679700
private final UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings;
680701
private final UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
@@ -795,6 +816,8 @@ protected Builder(ClientContext clientContext) {
795816
listBackupsSettings = PagedCallSettings.newBuilder(LIST_BACKUPS_PAGE_STR_FACT);
796817
restoreTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
797818
restoreTableOperationSettings = OperationCallSettings.newBuilder();
819+
copyBackupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
820+
copyBackupOperationSettings = OperationCallSettings.newBuilder();
798821
getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
799822
setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
800823
testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -822,6 +845,7 @@ protected Builder(ClientContext clientContext) {
822845
deleteBackupSettings,
823846
listBackupsSettings,
824847
restoreTableSettings,
848+
copyBackupSettings,
825849
getIamPolicySettings,
826850
setIamPolicySettings,
827851
testIamPermissionsSettings);
@@ -859,6 +883,8 @@ protected Builder(BigtableTableAdminStubSettings settings) {
859883
listBackupsSettings = settings.listBackupsSettings.toBuilder();
860884
restoreTableSettings = settings.restoreTableSettings.toBuilder();
861885
restoreTableOperationSettings = settings.restoreTableOperationSettings.toBuilder();
886+
copyBackupSettings = settings.copyBackupSettings.toBuilder();
887+
copyBackupOperationSettings = settings.copyBackupOperationSettings.toBuilder();
862888
getIamPolicySettings = settings.getIamPolicySettings.toBuilder();
863889
setIamPolicySettings = settings.setIamPolicySettings.toBuilder();
864890
testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder();
@@ -886,6 +912,7 @@ protected Builder(BigtableTableAdminStubSettings settings) {
886912
deleteBackupSettings,
887913
listBackupsSettings,
888914
restoreTableSettings,
915+
copyBackupSettings,
889916
getIamPolicySettings,
890917
setIamPolicySettings,
891918
testIamPermissionsSettings);
@@ -1010,6 +1037,11 @@ private static Builder initDefaults(Builder builder) {
10101037
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
10111038
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
10121039

1040+
builder
1041+
.copyBackupSettings()
1042+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
1043+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
1044+
10131045
builder
10141046
.getIamPolicySettings()
10151047
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
@@ -1169,6 +1201,29 @@ private static Builder initDefaults(Builder builder) {
11691201
.setTotalTimeout(Duration.ofMillis(600000L))
11701202
.build()));
11711203

1204+
builder
1205+
.copyBackupOperationSettings()
1206+
.setInitialCallSettings(
1207+
UnaryCallSettings.<CopyBackupRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
1208+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
1209+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"))
1210+
.build())
1211+
.setResponseTransformer(
1212+
ProtoOperationTransformers.ResponseTransformer.create(Backup.class))
1213+
.setMetadataTransformer(
1214+
ProtoOperationTransformers.MetadataTransformer.create(CopyBackupMetadata.class))
1215+
.setPollingAlgorithm(
1216+
OperationTimedPollAlgorithm.create(
1217+
RetrySettings.newBuilder()
1218+
.setInitialRetryDelay(Duration.ofMillis(5000L))
1219+
.setRetryDelayMultiplier(1.5)
1220+
.setMaxRetryDelay(Duration.ofMillis(45000L))
1221+
.setInitialRpcTimeout(Duration.ZERO)
1222+
.setRpcTimeoutMultiplier(1.0)
1223+
.setMaxRpcTimeout(Duration.ZERO)
1224+
.setTotalTimeout(Duration.ofMillis(300000L))
1225+
.build()));
1226+
11721227
return builder;
11731228
}
11741229

@@ -1351,6 +1406,19 @@ public UnaryCallSettings.Builder<RestoreTableRequest, Operation> restoreTableSet
13511406
return restoreTableOperationSettings;
13521407
}
13531408

1409+
/** Returns the builder for the settings used for calls to copyBackup. */
1410+
public UnaryCallSettings.Builder<CopyBackupRequest, Operation> copyBackupSettings() {
1411+
return copyBackupSettings;
1412+
}
1413+
1414+
/** Returns the builder for the settings used for calls to copyBackup. */
1415+
@BetaApi(
1416+
"The surface for use by generated code is not stable yet and may change in the future.")
1417+
public OperationCallSettings.Builder<CopyBackupRequest, Backup, CopyBackupMetadata>
1418+
copyBackupOperationSettings() {
1419+
return copyBackupOperationSettings;
1420+
}
1421+
13541422
/** Returns the builder for the settings used for calls to getIamPolicy. */
13551423
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
13561424
return getIamPolicySettings;

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import com.google.bigtable.admin.v2.Backup;
3333
import com.google.bigtable.admin.v2.CheckConsistencyRequest;
3434
import com.google.bigtable.admin.v2.CheckConsistencyResponse;
35+
import com.google.bigtable.admin.v2.CopyBackupMetadata;
36+
import com.google.bigtable.admin.v2.CopyBackupRequest;
3537
import com.google.bigtable.admin.v2.CreateBackupMetadata;
3638
import com.google.bigtable.admin.v2.CreateBackupRequest;
3739
import com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata;
@@ -279,6 +281,14 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub {
279281
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
280282
.build();
281283

284+
private static final MethodDescriptor<CopyBackupRequest, Operation> copyBackupMethodDescriptor =
285+
MethodDescriptor.<CopyBackupRequest, Operation>newBuilder()
286+
.setType(MethodDescriptor.MethodType.UNARY)
287+
.setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/CopyBackup")
288+
.setRequestMarshaller(ProtoUtils.marshaller(CopyBackupRequest.getDefaultInstance()))
289+
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
290+
.build();
291+
282292
private static final MethodDescriptor<GetIamPolicyRequest, Policy> getIamPolicyMethodDescriptor =
283293
MethodDescriptor.<GetIamPolicyRequest, Policy>newBuilder()
284294
.setType(MethodDescriptor.MethodType.UNARY)
@@ -348,6 +358,9 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub {
348358
private final UnaryCallable<RestoreTableRequest, Operation> restoreTableCallable;
349359
private final OperationCallable<RestoreTableRequest, Table, RestoreTableMetadata>
350360
restoreTableOperationCallable;
361+
private final UnaryCallable<CopyBackupRequest, Operation> copyBackupCallable;
362+
private final OperationCallable<CopyBackupRequest, Backup, CopyBackupMetadata>
363+
copyBackupOperationCallable;
351364
private final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable;
352365
private final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable;
353366
private final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
@@ -611,6 +624,16 @@ protected GrpcBigtableTableAdminStub(
611624
return builder.build();
612625
})
613626
.build();
627+
GrpcCallSettings<CopyBackupRequest, Operation> copyBackupTransportSettings =
628+
GrpcCallSettings.<CopyBackupRequest, Operation>newBuilder()
629+
.setMethodDescriptor(copyBackupMethodDescriptor)
630+
.setParamsExtractor(
631+
request -> {
632+
RequestParamsBuilder builder = RequestParamsBuilder.create();
633+
builder.add("parent", String.valueOf(request.getParent()));
634+
return builder.build();
635+
})
636+
.build();
614637
GrpcCallSettings<GetIamPolicyRequest, Policy> getIamPolicyTransportSettings =
615638
GrpcCallSettings.<GetIamPolicyRequest, Policy>newBuilder()
616639
.setMethodDescriptor(getIamPolicyMethodDescriptor)
@@ -757,6 +780,15 @@ protected GrpcBigtableTableAdminStub(
757780
settings.restoreTableOperationSettings(),
758781
clientContext,
759782
operationsStub);
783+
this.copyBackupCallable =
784+
callableFactory.createUnaryCallable(
785+
copyBackupTransportSettings, settings.copyBackupSettings(), clientContext);
786+
this.copyBackupOperationCallable =
787+
callableFactory.createOperationCallable(
788+
copyBackupTransportSettings,
789+
settings.copyBackupOperationSettings(),
790+
clientContext,
791+
operationsStub);
760792
this.getIamPolicyCallable =
761793
callableFactory.createUnaryCallable(
762794
getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
@@ -937,6 +969,17 @@ public UnaryCallable<RestoreTableRequest, Operation> restoreTableCallable() {
937969
return restoreTableOperationCallable;
938970
}
939971

972+
@Override
973+
public UnaryCallable<CopyBackupRequest, Operation> copyBackupCallable() {
974+
return copyBackupCallable;
975+
}
976+
977+
@Override
978+
public OperationCallable<CopyBackupRequest, Backup, CopyBackupMetadata>
979+
copyBackupOperationCallable() {
980+
return copyBackupOperationCallable;
981+
}
982+
940983
@Override
941984
public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
942985
return getIamPolicyCallable;

google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,42 @@
665665
"allDeclaredClasses": true,
666666
"allPublicClasses": true
667667
},
668+
{
669+
"name": "com.google.bigtable.admin.v2.CopyBackupMetadata",
670+
"queryAllDeclaredConstructors": true,
671+
"queryAllPublicConstructors": true,
672+
"queryAllDeclaredMethods": true,
673+
"allPublicMethods": true,
674+
"allDeclaredClasses": true,
675+
"allPublicClasses": true
676+
},
677+
{
678+
"name": "com.google.bigtable.admin.v2.CopyBackupMetadata$Builder",
679+
"queryAllDeclaredConstructors": true,
680+
"queryAllPublicConstructors": true,
681+
"queryAllDeclaredMethods": true,
682+
"allPublicMethods": true,
683+
"allDeclaredClasses": true,
684+
"allPublicClasses": true
685+
},
686+
{
687+
"name": "com.google.bigtable.admin.v2.CopyBackupRequest",
688+
"queryAllDeclaredConstructors": true,
689+
"queryAllPublicConstructors": true,
690+
"queryAllDeclaredMethods": true,
691+
"allPublicMethods": true,
692+
"allDeclaredClasses": true,
693+
"allPublicClasses": true
694+
},
695+
{
696+
"name": "com.google.bigtable.admin.v2.CopyBackupRequest$Builder",
697+
"queryAllDeclaredConstructors": true,
698+
"queryAllPublicConstructors": true,
699+
"queryAllDeclaredMethods": true,
700+
"allPublicMethods": true,
701+
"allDeclaredClasses": true,
702+
"allPublicClasses": true
703+
},
668704
{
669705
"name": "com.google.bigtable.admin.v2.CreateAppProfileRequest",
670706
"queryAllDeclaredConstructors": true,

0 commit comments

Comments
 (0)