Class IcebergCatalogServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
The API is defined as OpenAPI 3.1.1 spec.
Currently we only support the following methods: - GetConfig/GetIcebergCatalogConfig - ListIcebergNamespaces - CheckIcebergNamespaceExists - GetIcebergNamespace - CreateIcebergNamespace (only supports single level) - DeleteIcebergNamespace - UpdateIcebergNamespace properties - ListTableIdentifiers - CreateIcebergTable - DeleteIcebergTable - GetIcebergTable - UpdateIcebergTable (CommitTable) - LoadIcebergTableCredentials - RegisterTable
Users are required to provided the `X-Goog-User-Project` header with the project id or number which can be different from the bucket project id. That project will be charged for the API calls and the calling user must have access to that project. The caller must have `serviceusage.services.use` permission on the project.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (IcebergCatalogServiceClient icebergCatalogServiceClient =
IcebergCatalogServiceClient.create()) {
CatalogName name = CatalogName.of("[PROJECT]", "[CATALOG]");
IcebergCatalog response = icebergCatalogServiceClient.getIcebergCatalog(name);
}
Note: close() needs to be called on the IcebergCatalogServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
GetIcebergCatalog |
Returns the Iceberg REST Catalog configuration options. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListIcebergCatalogs |
Lists the Iceberg REST Catalogs. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateIcebergCatalog |
Update the Iceberg REST Catalog configuration options. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateIcebergCatalog |
Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs. Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`). If the bucket does not exist, of the caller does not have bucket metadata permissions, the catalog will not be created. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FailoverIcebergCatalog |
Failover the catalog to a new primary replica region. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of IcebergCatalogServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
IcebergCatalogServiceSettings icebergCatalogServiceSettings =
IcebergCatalogServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
IcebergCatalogServiceClient icebergCatalogServiceClient =
IcebergCatalogServiceClient.create(icebergCatalogServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
IcebergCatalogServiceSettings icebergCatalogServiceSettings =
IcebergCatalogServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
IcebergCatalogServiceClient icebergCatalogServiceClient =
IcebergCatalogServiceClient.create(icebergCatalogServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
IcebergCatalogServiceSettings icebergCatalogServiceSettings =
IcebergCatalogServiceSettings.newHttpJsonBuilder().build();
IcebergCatalogServiceClient icebergCatalogServiceClient =
IcebergCatalogServiceClient.create(icebergCatalogServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of IcebergCatalogServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final IcebergCatalogServiceClientcreate()Constructs an instance of IcebergCatalogServiceClient with default settings.static final IcebergCatalogServiceClientcreate(IcebergCatalogServiceSettings settings) Constructs an instance of IcebergCatalogServiceClient, using the given settings.static final IcebergCatalogServiceClientConstructs an instance of IcebergCatalogServiceClient, using the given stub for making calls.final IcebergCatalogCreates the Iceberg REST Catalog.final IcebergCatalogcreateIcebergCatalog(ProjectName parent, IcebergCatalog icebergCatalog, String icebergCatalogId) Creates the Iceberg REST Catalog.final IcebergCatalogcreateIcebergCatalog(String parent, IcebergCatalog icebergCatalog, String icebergCatalogId) Creates the Iceberg REST Catalog.Creates the Iceberg REST Catalog.Failover the catalog to a new primary replica region.failoverIcebergCatalog(String name, String primaryReplica) Failover the catalog to a new primary replica region.Failover the catalog to a new primary replica region.final IcebergCataloggetIcebergCatalog(CatalogName name) Returns the Iceberg REST Catalog configuration options.final IcebergCatalogReturns the Iceberg REST Catalog configuration options.final IcebergCataloggetIcebergCatalog(String name) Returns the Iceberg REST Catalog configuration options.Returns the Iceberg REST Catalog configuration options.getStub()booleanbooleanLists the Iceberg REST Catalogs.listIcebergCatalogs(ProjectName parent) Lists the Iceberg REST Catalogs.listIcebergCatalogs(String parent) Lists the Iceberg REST Catalogs.Lists the Iceberg REST Catalogs.final UnaryCallable<ListIcebergCatalogsRequest,IcebergCatalogServiceClient.ListIcebergCatalogsPagedResponse> Lists the Iceberg REST Catalogs.voidshutdown()voidfinal IcebergCatalogupdateIcebergCatalog(IcebergCatalog icebergCatalog, com.google.protobuf.FieldMask updateMask) Update the Iceberg REST Catalog configuration options.final IcebergCatalogUpdate the Iceberg REST Catalog configuration options.Update the Iceberg REST Catalog configuration options.
-
Constructor Details
-
IcebergCatalogServiceClient
Constructs an instance of IcebergCatalogServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
IcebergCatalogServiceClient
-
-
Method Details
-
create
Constructs an instance of IcebergCatalogServiceClient with default settings.- Throws:
IOException
-
create
public static final IcebergCatalogServiceClient create(IcebergCatalogServiceSettings settings) throws IOException Constructs an instance of IcebergCatalogServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of IcebergCatalogServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(IcebergCatalogServiceSettings). -
getSettings
-
getStub
-
getIcebergCatalog
Returns the Iceberg REST Catalog configuration options.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { CatalogName name = CatalogName.of("[PROJECT]", "[CATALOG]"); IcebergCatalog response = icebergCatalogServiceClient.getIcebergCatalog(name); }- Parameters:
name- Required. The catalog to get.- Throws:
ApiException- if the remote call fails
-
getIcebergCatalog
Returns the Iceberg REST Catalog configuration options.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { String name = CatalogName.of("[PROJECT]", "[CATALOG]").toString(); IcebergCatalog response = icebergCatalogServiceClient.getIcebergCatalog(name); }- Parameters:
name- Required. The catalog to get.- Throws:
ApiException- if the remote call fails
-
getIcebergCatalog
Returns the Iceberg REST Catalog configuration options.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { GetIcebergCatalogRequest request = GetIcebergCatalogRequest.newBuilder() .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .build(); IcebergCatalog response = icebergCatalogServiceClient.getIcebergCatalog(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIcebergCatalogCallable
Returns the Iceberg REST Catalog configuration options.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { GetIcebergCatalogRequest request = GetIcebergCatalogRequest.newBuilder() .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .build(); ApiFuture<IcebergCatalog> future = icebergCatalogServiceClient.getIcebergCatalogCallable().futureCall(request); // Do something. IcebergCatalog response = future.get(); } -
listIcebergCatalogs
public final IcebergCatalogServiceClient.ListIcebergCatalogsPagedResponse listIcebergCatalogs(ProjectName parent) Lists the Iceberg REST Catalogs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); for (IcebergCatalog element : icebergCatalogServiceClient.listIcebergCatalogs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource where this catalog will be created. Format: projects/{project_id}- Throws:
ApiException- if the remote call fails
-
listIcebergCatalogs
public final IcebergCatalogServiceClient.ListIcebergCatalogsPagedResponse listIcebergCatalogs(String parent) Lists the Iceberg REST Catalogs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); for (IcebergCatalog element : icebergCatalogServiceClient.listIcebergCatalogs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource where this catalog will be created. Format: projects/{project_id}- Throws:
ApiException- if the remote call fails
-
listIcebergCatalogs
public final IcebergCatalogServiceClient.ListIcebergCatalogsPagedResponse listIcebergCatalogs(ListIcebergCatalogsRequest request) Lists the Iceberg REST Catalogs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { ListIcebergCatalogsRequest request = ListIcebergCatalogsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (IcebergCatalog element : icebergCatalogServiceClient.listIcebergCatalogs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listIcebergCatalogsPagedCallable
public final UnaryCallable<ListIcebergCatalogsRequest,IcebergCatalogServiceClient.ListIcebergCatalogsPagedResponse> listIcebergCatalogsPagedCallable()Lists the Iceberg REST Catalogs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { ListIcebergCatalogsRequest request = ListIcebergCatalogsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<IcebergCatalog> future = icebergCatalogServiceClient.listIcebergCatalogsPagedCallable().futureCall(request); // Do something. for (IcebergCatalog element : future.get().iterateAll()) { // doThingsWith(element); } } -
listIcebergCatalogsCallable
public final UnaryCallable<ListIcebergCatalogsRequest,ListIcebergCatalogsResponse> listIcebergCatalogsCallable()Lists the Iceberg REST Catalogs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { ListIcebergCatalogsRequest request = ListIcebergCatalogsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListIcebergCatalogsResponse response = icebergCatalogServiceClient.listIcebergCatalogsCallable().call(request); for (IcebergCatalog element : response.getIcebergCatalogsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateIcebergCatalog
public final IcebergCatalog updateIcebergCatalog(IcebergCatalog icebergCatalog, com.google.protobuf.FieldMask updateMask) Update the Iceberg REST Catalog configuration options.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { IcebergCatalog icebergCatalog = IcebergCatalog.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); IcebergCatalog response = icebergCatalogServiceClient.updateIcebergCatalog(icebergCatalog, updateMask); }- Parameters:
icebergCatalog- Required. The catalog to update.updateMask- Optional. The list of fields to update.- Throws:
ApiException- if the remote call fails
-
updateIcebergCatalog
Update the Iceberg REST Catalog configuration options.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { UpdateIcebergCatalogRequest request = UpdateIcebergCatalogRequest.newBuilder() .setIcebergCatalog(IcebergCatalog.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); IcebergCatalog response = icebergCatalogServiceClient.updateIcebergCatalog(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateIcebergCatalogCallable
public final UnaryCallable<UpdateIcebergCatalogRequest,IcebergCatalog> updateIcebergCatalogCallable()Update the Iceberg REST Catalog configuration options.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { UpdateIcebergCatalogRequest request = UpdateIcebergCatalogRequest.newBuilder() .setIcebergCatalog(IcebergCatalog.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<IcebergCatalog> future = icebergCatalogServiceClient.updateIcebergCatalogCallable().futureCall(request); // Do something. IcebergCatalog response = future.get(); } -
createIcebergCatalog
public final IcebergCatalog createIcebergCatalog(ProjectName parent, IcebergCatalog icebergCatalog, String icebergCatalogId) Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs. Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).If the bucket does not exist, of the caller does not have bucket metadata permissions, the catalog will not be created.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); IcebergCatalog icebergCatalog = IcebergCatalog.newBuilder().build(); String icebergCatalogId = "icebergCatalogId504062865"; IcebergCatalog response = icebergCatalogServiceClient.createIcebergCatalog( parent, icebergCatalog, icebergCatalogId); }- Parameters:
parent- Required. The parent resource where this catalog will be created. Format: projects/{project_id}icebergCatalog- Required. The catalog to create. The required fields for creation are: - catalog_type. Optionally: credential_mode can be provided, if Credential Vending is desired.icebergCatalogId- Required. The name of the catalog.- Throws:
ApiException- if the remote call fails
-
createIcebergCatalog
public final IcebergCatalog createIcebergCatalog(String parent, IcebergCatalog icebergCatalog, String icebergCatalogId) Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs. Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).If the bucket does not exist, of the caller does not have bucket metadata permissions, the catalog will not be created.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); IcebergCatalog icebergCatalog = IcebergCatalog.newBuilder().build(); String icebergCatalogId = "icebergCatalogId504062865"; IcebergCatalog response = icebergCatalogServiceClient.createIcebergCatalog( parent, icebergCatalog, icebergCatalogId); }- Parameters:
parent- Required. The parent resource where this catalog will be created. Format: projects/{project_id}icebergCatalog- Required. The catalog to create. The required fields for creation are: - catalog_type. Optionally: credential_mode can be provided, if Credential Vending is desired.icebergCatalogId- Required. The name of the catalog.- Throws:
ApiException- if the remote call fails
-
createIcebergCatalog
Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs. Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).If the bucket does not exist, of the caller does not have bucket metadata permissions, the catalog will not be created.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { CreateIcebergCatalogRequest request = CreateIcebergCatalogRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setIcebergCatalogId("icebergCatalogId504062865") .setIcebergCatalog(IcebergCatalog.newBuilder().build()) .build(); IcebergCatalog response = icebergCatalogServiceClient.createIcebergCatalog(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createIcebergCatalogCallable
public final UnaryCallable<CreateIcebergCatalogRequest,IcebergCatalog> createIcebergCatalogCallable()Creates the Iceberg REST Catalog. Currently only supports Google Cloud Storage Bucket catalogs. Google Cloud Storage Bucket catalog id is the bucket for which the catalog is created (e.g. `my-catalog` for `gs://my-catalog`).If the bucket does not exist, of the caller does not have bucket metadata permissions, the catalog will not be created.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { CreateIcebergCatalogRequest request = CreateIcebergCatalogRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setIcebergCatalogId("icebergCatalogId504062865") .setIcebergCatalog(IcebergCatalog.newBuilder().build()) .build(); ApiFuture<IcebergCatalog> future = icebergCatalogServiceClient.createIcebergCatalogCallable().futureCall(request); // Do something. IcebergCatalog response = future.get(); } -
failoverIcebergCatalog
public final FailoverIcebergCatalogResponse failoverIcebergCatalog(String name, String primaryReplica) Failover the catalog to a new primary replica region.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { String name = "name3373707"; String primaryReplica = "primaryReplica-389090218"; FailoverIcebergCatalogResponse response = icebergCatalogServiceClient.failoverIcebergCatalog(name, primaryReplica); }- Parameters:
name- Required. The name of the catalog in the form "projects/{project_id}/catalogs/{catalog_id}"primaryReplica- Required. The region being assigned as the new primary replica region. For example "us-east1". This must be one of the replica regions in the catalog's list of replicas marked as a "secondary".- Throws:
ApiException- if the remote call fails
-
failoverIcebergCatalog
public final FailoverIcebergCatalogResponse failoverIcebergCatalog(FailoverIcebergCatalogRequest request) Failover the catalog to a new primary replica region.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { FailoverIcebergCatalogRequest request = FailoverIcebergCatalogRequest.newBuilder() .setName("name3373707") .setPrimaryReplica("primaryReplica-389090218") .setValidateOnly(true) .setConditionalFailoverReplicationTime(Timestamp.newBuilder().build()) .build(); FailoverIcebergCatalogResponse response = icebergCatalogServiceClient.failoverIcebergCatalog(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
failoverIcebergCatalogCallable
public final UnaryCallable<FailoverIcebergCatalogRequest,FailoverIcebergCatalogResponse> failoverIcebergCatalogCallable()Failover the catalog to a new primary replica region.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (IcebergCatalogServiceClient icebergCatalogServiceClient = IcebergCatalogServiceClient.create()) { FailoverIcebergCatalogRequest request = FailoverIcebergCatalogRequest.newBuilder() .setName("name3373707") .setPrimaryReplica("primaryReplica-389090218") .setValidateOnly(true) .setConditionalFailoverReplicationTime(Timestamp.newBuilder().build()) .build(); ApiFuture<FailoverIcebergCatalogResponse> future = icebergCatalogServiceClient.failoverIcebergCatalogCallable().futureCall(request); // Do something. FailoverIcebergCatalogResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-