Class IcebergCatalogServiceClient

java.lang.Object
com.google.cloud.biglake.v1.IcebergCatalogServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class IcebergCatalogServiceClient extends Object implements BackgroundResource
Service Description: Iceberg Catalog Service API: this implements the open-source Iceberg REST Catalog API. See the API definition here: https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml

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().

Methods
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.

  • getIcebergCatalog(GetIcebergCatalogRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getIcebergCatalog(CatalogName name)

  • getIcebergCatalog(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIcebergCatalogCallable()

ListIcebergCatalogs

Lists the Iceberg REST Catalogs.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listIcebergCatalogs(ListIcebergCatalogsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listIcebergCatalogs(ProjectName parent)

  • listIcebergCatalogs(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listIcebergCatalogsPagedCallable()

  • listIcebergCatalogsCallable()

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.

  • updateIcebergCatalog(UpdateIcebergCatalogRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateIcebergCatalog(IcebergCatalog icebergCatalog, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateIcebergCatalogCallable()

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.

  • createIcebergCatalog(CreateIcebergCatalogRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createIcebergCatalog(ProjectName parent, IcebergCatalog icebergCatalog, String icebergCatalogId)

  • createIcebergCatalog(String parent, IcebergCatalog icebergCatalog, String icebergCatalogId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createIcebergCatalogCallable()

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.

  • failoverIcebergCatalog(FailoverIcebergCatalogRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • failoverIcebergCatalog(String name, String primaryReplica)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • failoverIcebergCatalogCallable()

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.

  • Constructor Details

    • IcebergCatalogServiceClient

      protected IcebergCatalogServiceClient(IcebergCatalogServiceSettings settings) throws IOException
      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

      protected IcebergCatalogServiceClient(IcebergCatalogServiceStub stub)
  • Method Details

    • create

      public static final IcebergCatalogServiceClient create() throws IOException
      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

      public static final IcebergCatalogServiceClient create(IcebergCatalogServiceStub stub)
      Constructs an instance of IcebergCatalogServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(IcebergCatalogServiceSettings).
    • getSettings

      public final IcebergCatalogServiceSettings getSettings()
    • getStub

      public IcebergCatalogServiceStub getStub()
    • getIcebergCatalog

      public final IcebergCatalog getIcebergCatalog(CatalogName name)
      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

      public final IcebergCatalog getIcebergCatalog(String name)
      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

      public final IcebergCatalog getIcebergCatalog(GetIcebergCatalogRequest request)
      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

      public final UnaryCallable<GetIcebergCatalogRequest,IcebergCatalog> 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

      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

      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

      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

      public final IcebergCatalog updateIcebergCatalog(UpdateIcebergCatalogRequest request)
      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

      public final IcebergCatalog createIcebergCatalog(CreateIcebergCatalogRequest request)
      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:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException