Class HiveMetastoreServiceClient

java.lang.Object
com.google.cloud.biglake.hive.v1beta.HiveMetastoreServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@BetaApi @Generated("by gapic-generator-java") public class HiveMetastoreServiceClient extends Object implements BackgroundResource
Service Description: Hive Metastore Service is a biglake service that allows users to manage their external Hive catalogs. Full API compatibility with OSS Hive Metastore APIs is not supported. The methods match the Hive Metastore API spec mostly except for a few exceptions. These include listing resources with pattern, environment context which are combined in a single List API, return of ListResponse object instead of a list of resources, transactions, locks, etc.

The BigLake Hive Metastore API defines the following resources:

  • A collection of Google Cloud projects: `/projects/*`
  • Each project has a collection of catalogs: `/catalogs/*`
  • Each catalog has a collection of databases: `/databases/*`
  • Each database has a collection of tables: `/tables/*`

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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
     HiveMetastoreServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   HiveCatalog hiveCatalog = HiveCatalog.newBuilder().build();
   String hiveCatalogId = "hiveCatalogId-575314556";
   HiveCatalog response =
       hiveMetastoreServiceClient.createHiveCatalog(parent, hiveCatalog, hiveCatalogId);
 }
 

Note: close() needs to be called on the HiveMetastoreServiceClient 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

CreateHiveCatalog

Creates a new hive catalog.

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

  • createHiveCatalog(CreateHiveCatalogRequest request)

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

  • createHiveCatalog(ProjectName parent, HiveCatalog hiveCatalog, String hiveCatalogId)

  • createHiveCatalog(String parent, HiveCatalog hiveCatalog, String hiveCatalogId)

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

  • createHiveCatalogCallable()

GetHiveCatalog

Gets the catalog specified by the resource name.

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

  • getHiveCatalog(GetHiveCatalogRequest request)

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

  • getHiveCatalog(CatalogName name)

  • getHiveCatalog(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.

  • getHiveCatalogCallable()

ListHiveCatalogs

List all catalogs in a specified project.

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

  • listHiveCatalogs(ListHiveCatalogsRequest request)

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

  • listHiveCatalogs(ProjectName parent)

  • listHiveCatalogs(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.

  • listHiveCatalogsPagedCallable()

  • listHiveCatalogsCallable()

UpdateHiveCatalog

Updates an existing catalog.

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

  • updateHiveCatalog(UpdateHiveCatalogRequest request)

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

  • updateHiveCatalog(HiveCatalog hiveCatalog, 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.

  • updateHiveCatalogCallable()

DeleteHiveCatalog

Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.

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

  • deleteHiveCatalog(DeleteHiveCatalogRequest request)

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

  • deleteHiveCatalog(CatalogName name)

  • deleteHiveCatalog(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.

  • deleteHiveCatalogCallable()

CreateHiveDatabase

Creates a new database.

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

  • createHiveDatabase(CreateHiveDatabaseRequest request)

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

  • createHiveDatabase(CatalogName parent, HiveDatabase hiveDatabase, String hiveDatabaseId)

  • createHiveDatabase(String parent, HiveDatabase hiveDatabase, String hiveDatabaseId)

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

  • createHiveDatabaseCallable()

GetHiveDatabase

Gets the database specified by the resource name.

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

  • getHiveDatabase(GetHiveDatabaseRequest request)

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

  • getHiveDatabase(NamespaceName name)

  • getHiveDatabase(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.

  • getHiveDatabaseCallable()

ListHiveDatabases

List all databases in a specified catalog.

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

  • listHiveDatabases(ListHiveDatabasesRequest request)

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

  • listHiveDatabases(CatalogName parent)

  • listHiveDatabases(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.

  • listHiveDatabasesPagedCallable()

  • listHiveDatabasesCallable()

UpdateHiveDatabase

Updates an existing database specified by the database name.

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

  • updateHiveDatabase(UpdateHiveDatabaseRequest request)

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

  • updateHiveDatabase(HiveDatabase hiveDatabase, 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.

  • updateHiveDatabaseCallable()

DeleteHiveDatabase

Deletes an existing database specified by the database name.

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

  • deleteHiveDatabase(DeleteHiveDatabaseRequest request)

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

  • deleteHiveDatabase(NamespaceName name)

  • deleteHiveDatabase(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.

  • deleteHiveDatabaseCallable()

CreateHiveTable

Creates a new hive table.

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

  • createHiveTable(CreateHiveTableRequest request)

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

  • createHiveTable(NamespaceName parent, HiveTable hiveTable, String hiveTableId)

  • createHiveTable(String parent, HiveTable hiveTable, String hiveTableId)

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

  • createHiveTableCallable()

GetHiveTable

Gets the table specified by the resource name.

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

  • getHiveTable(GetHiveTableRequest request)

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

  • getHiveTable(TableName name)

  • getHiveTable(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.

  • getHiveTableCallable()

ListHiveTables

List all hive tables in a specified project under the hive catalog and database.

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

  • listHiveTables(ListHiveTablesRequest request)

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

  • listHiveTables(NamespaceName parent)

  • listHiveTables(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.

  • listHiveTablesPagedCallable()

  • listHiveTablesCallable()

UpdateHiveTable

Updates an existing table specified by the table name.

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

  • updateHiveTable(UpdateHiveTableRequest request)

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

  • updateHiveTable(HiveTable hiveTable, 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.

  • updateHiveTableCallable()

DeleteHiveTable

Deletes an existing table specified by the table name.

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

  • deleteHiveTable(DeleteHiveTableRequest request)

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

  • deleteHiveTable(TableName name)

  • deleteHiveTable(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.

  • deleteHiveTableCallable()

BatchCreatePartitions

Adds partitions to a table.

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

  • batchCreatePartitions(BatchCreatePartitionsRequest request)

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

  • batchCreatePartitions(TableName parent)

  • batchCreatePartitions(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.

  • batchCreatePartitionsCallable()

BatchDeletePartitions

Deletes partitions from a table.

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

  • batchDeletePartitions(BatchDeletePartitionsRequest request)

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

  • batchDeletePartitions(TableName parent)

  • batchDeletePartitions(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.

  • batchDeletePartitionsCallable()

BatchUpdatePartitions

Updates partitions in a table.

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

  • batchUpdatePartitions(BatchUpdatePartitionsRequest request)

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

  • batchUpdatePartitions(TableName parent)

  • batchUpdatePartitions(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.

  • batchUpdatePartitionsCallable()

ListPartitions

Streams list of partitions from a table.

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

  • listPartitionsCallable()

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 HiveMetastoreServiceSettings 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
 HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
     HiveMetastoreServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 HiveMetastoreServiceClient hiveMetastoreServiceClient =
     HiveMetastoreServiceClient.create(hiveMetastoreServiceSettings);
 

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
 HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
     HiveMetastoreServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 HiveMetastoreServiceClient hiveMetastoreServiceClient =
     HiveMetastoreServiceClient.create(hiveMetastoreServiceSettings);
 

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
 HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
     HiveMetastoreServiceSettings.newHttpJsonBuilder().build();
 HiveMetastoreServiceClient hiveMetastoreServiceClient =
     HiveMetastoreServiceClient.create(hiveMetastoreServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

  • Constructor Details

    • HiveMetastoreServiceClient

      protected HiveMetastoreServiceClient(HiveMetastoreServiceSettings settings) throws IOException
      Constructs an instance of HiveMetastoreServiceClient, 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
    • HiveMetastoreServiceClient

      protected HiveMetastoreServiceClient(HiveMetastoreServiceStub stub)
  • Method Details

    • create

      public static final HiveMetastoreServiceClient create() throws IOException
      Constructs an instance of HiveMetastoreServiceClient with default settings.
      Throws:
      IOException
    • create

      public static final HiveMetastoreServiceClient create(HiveMetastoreServiceSettings settings) throws IOException
      Constructs an instance of HiveMetastoreServiceClient, 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 HiveMetastoreServiceClient create(HiveMetastoreServiceStub stub)
      Constructs an instance of HiveMetastoreServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(HiveMetastoreServiceSettings).
    • getSettings

      public final HiveMetastoreServiceSettings getSettings()
    • getStub

      public HiveMetastoreServiceStub getStub()
    • createHiveCatalog

      public final HiveCatalog createHiveCatalog(ProjectName parent, HiveCatalog hiveCatalog, String hiveCatalogId)
      Creates a new hive catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ProjectName parent = ProjectName.of("[PROJECT]");
         HiveCatalog hiveCatalog = HiveCatalog.newBuilder().build();
         String hiveCatalogId = "hiveCatalogId-575314556";
         HiveCatalog response =
             hiveMetastoreServiceClient.createHiveCatalog(parent, hiveCatalog, hiveCatalogId);
       }
       
      Parameters:
      parent - Required. The parent resource where this catalog will be created. Format: projects/{project_id_or_number}
      hiveCatalog - Required. The catalog to create. The `name` field does not need to be provided. Gets copied over from catalog_id.
      hiveCatalogId - Required. The Hive Catalog ID to use for the catalog that will become the final component of the catalog's resource name. The maximum length is 256 characters.
      Throws:
      ApiException - if the remote call fails
    • createHiveCatalog

      public final HiveCatalog createHiveCatalog(String parent, HiveCatalog hiveCatalog, String hiveCatalogId)
      Creates a new hive catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = ProjectName.of("[PROJECT]").toString();
         HiveCatalog hiveCatalog = HiveCatalog.newBuilder().build();
         String hiveCatalogId = "hiveCatalogId-575314556";
         HiveCatalog response =
             hiveMetastoreServiceClient.createHiveCatalog(parent, hiveCatalog, hiveCatalogId);
       }
       
      Parameters:
      parent - Required. The parent resource where this catalog will be created. Format: projects/{project_id_or_number}
      hiveCatalog - Required. The catalog to create. The `name` field does not need to be provided. Gets copied over from catalog_id.
      hiveCatalogId - Required. The Hive Catalog ID to use for the catalog that will become the final component of the catalog's resource name. The maximum length is 256 characters.
      Throws:
      ApiException - if the remote call fails
    • createHiveCatalog

      public final HiveCatalog createHiveCatalog(CreateHiveCatalogRequest request)
      Creates a new hive catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CreateHiveCatalogRequest request =
             CreateHiveCatalogRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setHiveCatalog(HiveCatalog.newBuilder().build())
                 .setHiveCatalogId("hiveCatalogId-575314556")
                 .setPrimaryLocation("primaryLocation-1140723753")
                 .build();
         HiveCatalog response = hiveMetastoreServiceClient.createHiveCatalog(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createHiveCatalogCallable

      public final UnaryCallable<CreateHiveCatalogRequest,HiveCatalog> createHiveCatalogCallable()
      Creates a new hive catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CreateHiveCatalogRequest request =
             CreateHiveCatalogRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setHiveCatalog(HiveCatalog.newBuilder().build())
                 .setHiveCatalogId("hiveCatalogId-575314556")
                 .setPrimaryLocation("primaryLocation-1140723753")
                 .build();
         ApiFuture<HiveCatalog> future =
             hiveMetastoreServiceClient.createHiveCatalogCallable().futureCall(request);
         // Do something.
         HiveCatalog response = future.get();
       }
       
    • getHiveCatalog

      public final HiveCatalog getHiveCatalog(CatalogName name)
      Gets the catalog specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CatalogName name = CatalogName.of("[PROJECT]", "[CATALOG]");
         HiveCatalog response = hiveMetastoreServiceClient.getHiveCatalog(name);
       }
       
      Parameters:
      name - Required. The name of the catalog to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      Throws:
      ApiException - if the remote call fails
    • getHiveCatalog

      public final HiveCatalog getHiveCatalog(String name)
      Gets the catalog specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String name = CatalogName.of("[PROJECT]", "[CATALOG]").toString();
         HiveCatalog response = hiveMetastoreServiceClient.getHiveCatalog(name);
       }
       
      Parameters:
      name - Required. The name of the catalog to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      Throws:
      ApiException - if the remote call fails
    • getHiveCatalog

      public final HiveCatalog getHiveCatalog(GetHiveCatalogRequest request)
      Gets the catalog specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         GetHiveCatalogRequest request =
             GetHiveCatalogRequest.newBuilder()
                 .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .build();
         HiveCatalog response = hiveMetastoreServiceClient.getHiveCatalog(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getHiveCatalogCallable

      public final UnaryCallable<GetHiveCatalogRequest,HiveCatalog> getHiveCatalogCallable()
      Gets the catalog specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         GetHiveCatalogRequest request =
             GetHiveCatalogRequest.newBuilder()
                 .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .build();
         ApiFuture<HiveCatalog> future =
             hiveMetastoreServiceClient.getHiveCatalogCallable().futureCall(request);
         // Do something.
         HiveCatalog response = future.get();
       }
       
    • listHiveCatalogs

      List all catalogs in a specified project.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ProjectName parent = ProjectName.of("[PROJECT]");
         for (HiveCatalog element : hiveMetastoreServiceClient.listHiveCatalogs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project to list catalogs from. Format: projects/{project_id_or_number}
      Throws:
      ApiException - if the remote call fails
    • listHiveCatalogs

      public final HiveMetastoreServiceClient.ListHiveCatalogsPagedResponse listHiveCatalogs(String parent)
      List all catalogs in a specified project.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = ProjectName.of("[PROJECT]").toString();
         for (HiveCatalog element : hiveMetastoreServiceClient.listHiveCatalogs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project to list catalogs from. Format: projects/{project_id_or_number}
      Throws:
      ApiException - if the remote call fails
    • listHiveCatalogs

      List all catalogs in a specified project.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveCatalogsRequest request =
             ListHiveCatalogsRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (HiveCatalog element :
             hiveMetastoreServiceClient.listHiveCatalogs(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
    • listHiveCatalogsPagedCallable

      List all catalogs in a specified project.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveCatalogsRequest request =
             ListHiveCatalogsRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<HiveCatalog> future =
             hiveMetastoreServiceClient.listHiveCatalogsPagedCallable().futureCall(request);
         // Do something.
         for (HiveCatalog element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listHiveCatalogsCallable

      public final UnaryCallable<ListHiveCatalogsRequest,ListHiveCatalogsResponse> listHiveCatalogsCallable()
      List all catalogs in a specified project.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveCatalogsRequest request =
             ListHiveCatalogsRequest.newBuilder()
                 .setParent(ProjectName.of("[PROJECT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListHiveCatalogsResponse response =
               hiveMetastoreServiceClient.listHiveCatalogsCallable().call(request);
           for (HiveCatalog element : response.getCatalogsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • updateHiveCatalog

      public final HiveCatalog updateHiveCatalog(HiveCatalog hiveCatalog, com.google.protobuf.FieldMask updateMask)
      Updates an existing catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         HiveCatalog hiveCatalog = HiveCatalog.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         HiveCatalog response = hiveMetastoreServiceClient.updateHiveCatalog(hiveCatalog, updateMask);
       }
       
      Parameters:
      hiveCatalog - Required. The hive catalog to update. The name under the catalog is used to identify the catalog. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      updateMask - Optional. The list of fields to update.

      For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all of the fields that are allowed to update.

      Throws:
      ApiException - if the remote call fails
    • updateHiveCatalog

      public final HiveCatalog updateHiveCatalog(UpdateHiveCatalogRequest request)
      Updates an existing catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         UpdateHiveCatalogRequest request =
             UpdateHiveCatalogRequest.newBuilder()
                 .setHiveCatalog(HiveCatalog.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         HiveCatalog response = hiveMetastoreServiceClient.updateHiveCatalog(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateHiveCatalogCallable

      public final UnaryCallable<UpdateHiveCatalogRequest,HiveCatalog> updateHiveCatalogCallable()
      Updates an existing catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         UpdateHiveCatalogRequest request =
             UpdateHiveCatalogRequest.newBuilder()
                 .setHiveCatalog(HiveCatalog.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<HiveCatalog> future =
             hiveMetastoreServiceClient.updateHiveCatalogCallable().futureCall(request);
         // Do something.
         HiveCatalog response = future.get();
       }
       
    • deleteHiveCatalog

      public final void deleteHiveCatalog(CatalogName name)
      Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CatalogName name = CatalogName.of("[PROJECT]", "[CATALOG]");
         hiveMetastoreServiceClient.deleteHiveCatalog(name);
       }
       
      Parameters:
      name - Required. The name of the catalog to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      Throws:
      ApiException - if the remote call fails
    • deleteHiveCatalog

      public final void deleteHiveCatalog(String name)
      Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String name = CatalogName.of("[PROJECT]", "[CATALOG]").toString();
         hiveMetastoreServiceClient.deleteHiveCatalog(name);
       }
       
      Parameters:
      name - Required. The name of the catalog to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      Throws:
      ApiException - if the remote call fails
    • deleteHiveCatalog

      public final void deleteHiveCatalog(DeleteHiveCatalogRequest request)
      Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         DeleteHiveCatalogRequest request =
             DeleteHiveCatalogRequest.newBuilder()
                 .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .build();
         hiveMetastoreServiceClient.deleteHiveCatalog(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteHiveCatalogCallable

      public final UnaryCallable<DeleteHiveCatalogRequest,com.google.protobuf.Empty> deleteHiveCatalogCallable()
      Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         DeleteHiveCatalogRequest request =
             DeleteHiveCatalogRequest.newBuilder()
                 .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .build();
         ApiFuture<Empty> future =
             hiveMetastoreServiceClient.deleteHiveCatalogCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • createHiveDatabase

      public final HiveDatabase createHiveDatabase(CatalogName parent, HiveDatabase hiveDatabase, String hiveDatabaseId)
      Creates a new database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CatalogName parent = CatalogName.of("[PROJECT]", "[CATALOG]");
         HiveDatabase hiveDatabase = HiveDatabase.newBuilder().build();
         String hiveDatabaseId = "hiveDatabaseId-1150232698";
         HiveDatabase response =
             hiveMetastoreServiceClient.createHiveDatabase(parent, hiveDatabase, hiveDatabaseId);
       }
       
      Parameters:
      parent - Required. The parent resource where this database will be created. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      hiveDatabase - Required. The database to create. The `name` field does not need to be provided.
      hiveDatabaseId - Required. The ID to use for the Hive Database. The maximum length is 128 characters.
      Throws:
      ApiException - if the remote call fails
    • createHiveDatabase

      public final HiveDatabase createHiveDatabase(String parent, HiveDatabase hiveDatabase, String hiveDatabaseId)
      Creates a new database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = CatalogName.of("[PROJECT]", "[CATALOG]").toString();
         HiveDatabase hiveDatabase = HiveDatabase.newBuilder().build();
         String hiveDatabaseId = "hiveDatabaseId-1150232698";
         HiveDatabase response =
             hiveMetastoreServiceClient.createHiveDatabase(parent, hiveDatabase, hiveDatabaseId);
       }
       
      Parameters:
      parent - Required. The parent resource where this database will be created. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      hiveDatabase - Required. The database to create. The `name` field does not need to be provided.
      hiveDatabaseId - Required. The ID to use for the Hive Database. The maximum length is 128 characters.
      Throws:
      ApiException - if the remote call fails
    • createHiveDatabase

      public final HiveDatabase createHiveDatabase(CreateHiveDatabaseRequest request)
      Creates a new database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CreateHiveDatabaseRequest request =
             CreateHiveDatabaseRequest.newBuilder()
                 .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .setHiveDatabase(HiveDatabase.newBuilder().build())
                 .setHiveDatabaseId("hiveDatabaseId-1150232698")
                 .build();
         HiveDatabase response = hiveMetastoreServiceClient.createHiveDatabase(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createHiveDatabaseCallable

      public final UnaryCallable<CreateHiveDatabaseRequest,HiveDatabase> createHiveDatabaseCallable()
      Creates a new database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CreateHiveDatabaseRequest request =
             CreateHiveDatabaseRequest.newBuilder()
                 .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .setHiveDatabase(HiveDatabase.newBuilder().build())
                 .setHiveDatabaseId("hiveDatabaseId-1150232698")
                 .build();
         ApiFuture<HiveDatabase> future =
             hiveMetastoreServiceClient.createHiveDatabaseCallable().futureCall(request);
         // Do something.
         HiveDatabase response = future.get();
       }
       
    • getHiveDatabase

      public final HiveDatabase getHiveDatabase(NamespaceName name)
      Gets the database specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         NamespaceName name = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]");
         HiveDatabase response = hiveMetastoreServiceClient.getHiveDatabase(name);
       }
       
      Parameters:
      name - Required. The name of the database to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
      Throws:
      ApiException - if the remote call fails
    • getHiveDatabase

      public final HiveDatabase getHiveDatabase(String name)
      Gets the database specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String name = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString();
         HiveDatabase response = hiveMetastoreServiceClient.getHiveDatabase(name);
       }
       
      Parameters:
      name - Required. The name of the database to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
      Throws:
      ApiException - if the remote call fails
    • getHiveDatabase

      public final HiveDatabase getHiveDatabase(GetHiveDatabaseRequest request)
      Gets the database specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         GetHiveDatabaseRequest request =
             GetHiveDatabaseRequest.newBuilder()
                 .setName(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .build();
         HiveDatabase response = hiveMetastoreServiceClient.getHiveDatabase(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getHiveDatabaseCallable

      public final UnaryCallable<GetHiveDatabaseRequest,HiveDatabase> getHiveDatabaseCallable()
      Gets the database specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         GetHiveDatabaseRequest request =
             GetHiveDatabaseRequest.newBuilder()
                 .setName(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .build();
         ApiFuture<HiveDatabase> future =
             hiveMetastoreServiceClient.getHiveDatabaseCallable().futureCall(request);
         // Do something.
         HiveDatabase response = future.get();
       }
       
    • listHiveDatabases

      List all databases in a specified catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CatalogName parent = CatalogName.of("[PROJECT]", "[CATALOG]");
         for (HiveDatabase element :
             hiveMetastoreServiceClient.listHiveDatabases(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The hive catalog to list databases from. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      Throws:
      ApiException - if the remote call fails
    • listHiveDatabases

      public final HiveMetastoreServiceClient.ListHiveDatabasesPagedResponse listHiveDatabases(String parent)
      List all databases in a specified catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = CatalogName.of("[PROJECT]", "[CATALOG]").toString();
         for (HiveDatabase element :
             hiveMetastoreServiceClient.listHiveDatabases(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The hive catalog to list databases from. Format: projects/{project_id_or_number}/catalogs/{catalog_id}
      Throws:
      ApiException - if the remote call fails
    • listHiveDatabases

      List all databases in a specified catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveDatabasesRequest request =
             ListHiveDatabasesRequest.newBuilder()
                 .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (HiveDatabase element :
             hiveMetastoreServiceClient.listHiveDatabases(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
    • listHiveDatabasesPagedCallable

      List all databases in a specified catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveDatabasesRequest request =
             ListHiveDatabasesRequest.newBuilder()
                 .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<HiveDatabase> future =
             hiveMetastoreServiceClient.listHiveDatabasesPagedCallable().futureCall(request);
         // Do something.
         for (HiveDatabase element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listHiveDatabasesCallable

      public final UnaryCallable<ListHiveDatabasesRequest,ListHiveDatabasesResponse> listHiveDatabasesCallable()
      List all databases in a specified catalog.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveDatabasesRequest request =
             ListHiveDatabasesRequest.newBuilder()
                 .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListHiveDatabasesResponse response =
               hiveMetastoreServiceClient.listHiveDatabasesCallable().call(request);
           for (HiveDatabase element : response.getDatabasesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • updateHiveDatabase

      public final HiveDatabase updateHiveDatabase(HiveDatabase hiveDatabase, com.google.protobuf.FieldMask updateMask)
      Updates an existing database specified by the database name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         HiveDatabase hiveDatabase = HiveDatabase.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         HiveDatabase response =
             hiveMetastoreServiceClient.updateHiveDatabase(hiveDatabase, updateMask);
       }
       
      Parameters:
      hiveDatabase - Required. The database to update.

      The database's `name` field is used to identify the database to update. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}

      updateMask - Optional. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateHiveDatabase

      public final HiveDatabase updateHiveDatabase(UpdateHiveDatabaseRequest request)
      Updates an existing database specified by the database name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         UpdateHiveDatabaseRequest request =
             UpdateHiveDatabaseRequest.newBuilder()
                 .setHiveDatabase(HiveDatabase.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         HiveDatabase response = hiveMetastoreServiceClient.updateHiveDatabase(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateHiveDatabaseCallable

      public final UnaryCallable<UpdateHiveDatabaseRequest,HiveDatabase> updateHiveDatabaseCallable()
      Updates an existing database specified by the database name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         UpdateHiveDatabaseRequest request =
             UpdateHiveDatabaseRequest.newBuilder()
                 .setHiveDatabase(HiveDatabase.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<HiveDatabase> future =
             hiveMetastoreServiceClient.updateHiveDatabaseCallable().futureCall(request);
         // Do something.
         HiveDatabase response = future.get();
       }
       
    • deleteHiveDatabase

      public final void deleteHiveDatabase(NamespaceName name)
      Deletes an existing database specified by the database name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         NamespaceName name = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]");
         hiveMetastoreServiceClient.deleteHiveDatabase(name);
       }
       
      Parameters:
      name - Required. The name of the database to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
      Throws:
      ApiException - if the remote call fails
    • deleteHiveDatabase

      public final void deleteHiveDatabase(String name)
      Deletes an existing database specified by the database name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String name = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString();
         hiveMetastoreServiceClient.deleteHiveDatabase(name);
       }
       
      Parameters:
      name - Required. The name of the database to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
      Throws:
      ApiException - if the remote call fails
    • deleteHiveDatabase

      public final void deleteHiveDatabase(DeleteHiveDatabaseRequest request)
      Deletes an existing database specified by the database name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         DeleteHiveDatabaseRequest request =
             DeleteHiveDatabaseRequest.newBuilder()
                 .setName(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .build();
         hiveMetastoreServiceClient.deleteHiveDatabase(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteHiveDatabaseCallable

      public final UnaryCallable<DeleteHiveDatabaseRequest,com.google.protobuf.Empty> deleteHiveDatabaseCallable()
      Deletes an existing database specified by the database name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         DeleteHiveDatabaseRequest request =
             DeleteHiveDatabaseRequest.newBuilder()
                 .setName(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .build();
         ApiFuture<Empty> future =
             hiveMetastoreServiceClient.deleteHiveDatabaseCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • createHiveTable

      public final HiveTable createHiveTable(NamespaceName parent, HiveTable hiveTable, String hiveTableId)
      Creates a new hive table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         NamespaceName parent = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]");
         HiveTable hiveTable = HiveTable.newBuilder().build();
         String hiveTableId = "hiveTableId152241145";
         HiveTable response =
             hiveMetastoreServiceClient.createHiveTable(parent, hiveTable, hiveTableId);
       }
       
      Parameters:
      parent - Required. The parent resource for the table to be created. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
      hiveTable - Required. The Hive Table to create. The `name` field does not need to be provided.
      hiveTableId - Required. The Hive Table ID to use for the table that will become the final component of the table's resource name. The maximum length is 256 characters.
      Throws:
      ApiException - if the remote call fails
    • createHiveTable

      public final HiveTable createHiveTable(String parent, HiveTable hiveTable, String hiveTableId)
      Creates a new hive table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString();
         HiveTable hiveTable = HiveTable.newBuilder().build();
         String hiveTableId = "hiveTableId152241145";
         HiveTable response =
             hiveMetastoreServiceClient.createHiveTable(parent, hiveTable, hiveTableId);
       }
       
      Parameters:
      parent - Required. The parent resource for the table to be created. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
      hiveTable - Required. The Hive Table to create. The `name` field does not need to be provided.
      hiveTableId - Required. The Hive Table ID to use for the table that will become the final component of the table's resource name. The maximum length is 256 characters.
      Throws:
      ApiException - if the remote call fails
    • createHiveTable

      public final HiveTable createHiveTable(CreateHiveTableRequest request)
      Creates a new hive table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CreateHiveTableRequest request =
             CreateHiveTableRequest.newBuilder()
                 .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .setHiveTable(HiveTable.newBuilder().build())
                 .setHiveTableId("hiveTableId152241145")
                 .build();
         HiveTable response = hiveMetastoreServiceClient.createHiveTable(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createHiveTableCallable

      public final UnaryCallable<CreateHiveTableRequest,HiveTable> createHiveTableCallable()
      Creates a new hive table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         CreateHiveTableRequest request =
             CreateHiveTableRequest.newBuilder()
                 .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .setHiveTable(HiveTable.newBuilder().build())
                 .setHiveTableId("hiveTableId152241145")
                 .build();
         ApiFuture<HiveTable> future =
             hiveMetastoreServiceClient.createHiveTableCallable().futureCall(request);
         // Do something.
         HiveTable response = future.get();
       }
       
    • getHiveTable

      public final HiveTable getHiveTable(TableName name)
      Gets the table specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         TableName name = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]");
         HiveTable response = hiveMetastoreServiceClient.getHiveTable(name);
       }
       
      Parameters:
      name - Required. The name of the table to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
      Throws:
      ApiException - if the remote call fails
    • getHiveTable

      public final HiveTable getHiveTable(String name)
      Gets the table specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String name = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString();
         HiveTable response = hiveMetastoreServiceClient.getHiveTable(name);
       }
       
      Parameters:
      name - Required. The name of the table to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
      Throws:
      ApiException - if the remote call fails
    • getHiveTable

      public final HiveTable getHiveTable(GetHiveTableRequest request)
      Gets the table specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         GetHiveTableRequest request =
             GetHiveTableRequest.newBuilder()
                 .setName(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .build();
         HiveTable response = hiveMetastoreServiceClient.getHiveTable(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getHiveTableCallable

      public final UnaryCallable<GetHiveTableRequest,HiveTable> getHiveTableCallable()
      Gets the table specified by the resource name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         GetHiveTableRequest request =
             GetHiveTableRequest.newBuilder()
                 .setName(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .build();
         ApiFuture<HiveTable> future =
             hiveMetastoreServiceClient.getHiveTableCallable().futureCall(request);
         // Do something.
         HiveTable response = future.get();
       }
       
    • listHiveTables

      List all hive tables in a specified project under the hive catalog and database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         NamespaceName parent = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]");
         for (HiveTable element : hiveMetastoreServiceClient.listHiveTables(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The database to list tables from. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
      Throws:
      ApiException - if the remote call fails
    • listHiveTables

      public final HiveMetastoreServiceClient.ListHiveTablesPagedResponse listHiveTables(String parent)
      List all hive tables in a specified project under the hive catalog and database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString();
         for (HiveTable element : hiveMetastoreServiceClient.listHiveTables(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The database to list tables from. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
      Throws:
      ApiException - if the remote call fails
    • listHiveTables

      List all hive tables in a specified project under the hive catalog and database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveTablesRequest request =
             ListHiveTablesRequest.newBuilder()
                 .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (HiveTable element : hiveMetastoreServiceClient.listHiveTables(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
    • listHiveTablesPagedCallable

      List all hive tables in a specified project under the hive catalog and database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveTablesRequest request =
             ListHiveTablesRequest.newBuilder()
                 .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<HiveTable> future =
             hiveMetastoreServiceClient.listHiveTablesPagedCallable().futureCall(request);
         // Do something.
         for (HiveTable element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listHiveTablesCallable

      public final UnaryCallable<ListHiveTablesRequest,ListHiveTablesResponse> listHiveTablesCallable()
      List all hive tables in a specified project under the hive catalog and database.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListHiveTablesRequest request =
             ListHiveTablesRequest.newBuilder()
                 .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListHiveTablesResponse response =
               hiveMetastoreServiceClient.listHiveTablesCallable().call(request);
           for (HiveTable element : response.getTablesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • updateHiveTable

      public final HiveTable updateHiveTable(HiveTable hiveTable, com.google.protobuf.FieldMask updateMask)
      Updates an existing table specified by the table name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         HiveTable hiveTable = HiveTable.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         HiveTable response = hiveMetastoreServiceClient.updateHiveTable(hiveTable, updateMask);
       }
       
      Parameters:
      hiveTable - Required. The table to update.

      The table's `name` field is used to identify the table to update. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}

      updateMask - Optional. The list of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateHiveTable

      public final HiveTable updateHiveTable(UpdateHiveTableRequest request)
      Updates an existing table specified by the table name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         UpdateHiveTableRequest request =
             UpdateHiveTableRequest.newBuilder()
                 .setHiveTable(HiveTable.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         HiveTable response = hiveMetastoreServiceClient.updateHiveTable(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateHiveTableCallable

      public final UnaryCallable<UpdateHiveTableRequest,HiveTable> updateHiveTableCallable()
      Updates an existing table specified by the table name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         UpdateHiveTableRequest request =
             UpdateHiveTableRequest.newBuilder()
                 .setHiveTable(HiveTable.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<HiveTable> future =
             hiveMetastoreServiceClient.updateHiveTableCallable().futureCall(request);
         // Do something.
         HiveTable response = future.get();
       }
       
    • deleteHiveTable

      public final void deleteHiveTable(TableName name)
      Deletes an existing table specified by the table name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         TableName name = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]");
         hiveMetastoreServiceClient.deleteHiveTable(name);
       }
       
      Parameters:
      name - Required. The name of the database to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
      Throws:
      ApiException - if the remote call fails
    • deleteHiveTable

      public final void deleteHiveTable(String name)
      Deletes an existing table specified by the table name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String name = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString();
         hiveMetastoreServiceClient.deleteHiveTable(name);
       }
       
      Parameters:
      name - Required. The name of the database to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
      Throws:
      ApiException - if the remote call fails
    • deleteHiveTable

      public final void deleteHiveTable(DeleteHiveTableRequest request)
      Deletes an existing table specified by the table name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         DeleteHiveTableRequest request =
             DeleteHiveTableRequest.newBuilder()
                 .setName(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .build();
         hiveMetastoreServiceClient.deleteHiveTable(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteHiveTableCallable

      public final UnaryCallable<DeleteHiveTableRequest,com.google.protobuf.Empty> deleteHiveTableCallable()
      Deletes an existing table specified by the table name.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         DeleteHiveTableRequest request =
             DeleteHiveTableRequest.newBuilder()
                 .setName(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .build();
         ApiFuture<Empty> future =
             hiveMetastoreServiceClient.deleteHiveTableCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • batchCreatePartitions

      public final BatchCreatePartitionsResponse batchCreatePartitions(TableName parent)
      Adds partitions to a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         TableName parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]");
         BatchCreatePartitionsResponse response =
             hiveMetastoreServiceClient.batchCreatePartitions(parent);
       }
       
      Parameters:
      parent - Required. Reference to the table to where the partitions to be added, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
      Throws:
      ApiException - if the remote call fails
    • batchCreatePartitions

      public final BatchCreatePartitionsResponse batchCreatePartitions(String parent)
      Adds partitions to a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString();
         BatchCreatePartitionsResponse response =
             hiveMetastoreServiceClient.batchCreatePartitions(parent);
       }
       
      Parameters:
      parent - Required. Reference to the table to where the partitions to be added, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
      Throws:
      ApiException - if the remote call fails
    • batchCreatePartitions

      public final BatchCreatePartitionsResponse batchCreatePartitions(BatchCreatePartitionsRequest request)
      Adds partitions to a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         BatchCreatePartitionsRequest request =
             BatchCreatePartitionsRequest.newBuilder()
                 .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .addAllRequests(new ArrayList<CreatePartitionRequest>())
                 .setSkipExistingPartitions(true)
                 .build();
         BatchCreatePartitionsResponse response =
             hiveMetastoreServiceClient.batchCreatePartitions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • batchCreatePartitionsCallable

      public final UnaryCallable<BatchCreatePartitionsRequest,BatchCreatePartitionsResponse> batchCreatePartitionsCallable()
      Adds partitions to a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         BatchCreatePartitionsRequest request =
             BatchCreatePartitionsRequest.newBuilder()
                 .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .addAllRequests(new ArrayList<CreatePartitionRequest>())
                 .setSkipExistingPartitions(true)
                 .build();
         ApiFuture<BatchCreatePartitionsResponse> future =
             hiveMetastoreServiceClient.batchCreatePartitionsCallable().futureCall(request);
         // Do something.
         BatchCreatePartitionsResponse response = future.get();
       }
       
    • batchDeletePartitions

      public final void batchDeletePartitions(TableName parent)
      Deletes partitions from a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         TableName parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]");
         hiveMetastoreServiceClient.batchDeletePartitions(parent);
       }
       
      Parameters:
      parent - Required. Reference to the table to which these partitions belong, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
      Throws:
      ApiException - if the remote call fails
    • batchDeletePartitions

      public final void batchDeletePartitions(String parent)
      Deletes partitions from a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString();
         hiveMetastoreServiceClient.batchDeletePartitions(parent);
       }
       
      Parameters:
      parent - Required. Reference to the table to which these partitions belong, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
      Throws:
      ApiException - if the remote call fails
    • batchDeletePartitions

      public final void batchDeletePartitions(BatchDeletePartitionsRequest request)
      Deletes partitions from a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         BatchDeletePartitionsRequest request =
             BatchDeletePartitionsRequest.newBuilder()
                 .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .addAllPartitionValues(new ArrayList<PartitionValues>())
                 .build();
         hiveMetastoreServiceClient.batchDeletePartitions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • batchDeletePartitionsCallable

      public final UnaryCallable<BatchDeletePartitionsRequest,com.google.protobuf.Empty> batchDeletePartitionsCallable()
      Deletes partitions from a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         BatchDeletePartitionsRequest request =
             BatchDeletePartitionsRequest.newBuilder()
                 .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .addAllPartitionValues(new ArrayList<PartitionValues>())
                 .build();
         ApiFuture<Empty> future =
             hiveMetastoreServiceClient.batchDeletePartitionsCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • batchUpdatePartitions

      public final BatchUpdatePartitionsResponse batchUpdatePartitions(TableName parent)
      Updates partitions in a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         TableName parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]");
         BatchUpdatePartitionsResponse response =
             hiveMetastoreServiceClient.batchUpdatePartitions(parent);
       }
       
      Parameters:
      parent - Required. Reference to the table to which these partitions belong, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
      Throws:
      ApiException - if the remote call fails
    • batchUpdatePartitions

      public final BatchUpdatePartitionsResponse batchUpdatePartitions(String parent)
      Updates partitions in a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         String parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString();
         BatchUpdatePartitionsResponse response =
             hiveMetastoreServiceClient.batchUpdatePartitions(parent);
       }
       
      Parameters:
      parent - Required. Reference to the table to which these partitions belong, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
      Throws:
      ApiException - if the remote call fails
    • batchUpdatePartitions

      public final BatchUpdatePartitionsResponse batchUpdatePartitions(BatchUpdatePartitionsRequest request)
      Updates partitions in a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         BatchUpdatePartitionsRequest request =
             BatchUpdatePartitionsRequest.newBuilder()
                 .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .addAllRequests(new ArrayList<UpdatePartitionRequest>())
                 .build();
         BatchUpdatePartitionsResponse response =
             hiveMetastoreServiceClient.batchUpdatePartitions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • batchUpdatePartitionsCallable

      public final UnaryCallable<BatchUpdatePartitionsRequest,BatchUpdatePartitionsResponse> batchUpdatePartitionsCallable()
      Updates partitions in a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         BatchUpdatePartitionsRequest request =
             BatchUpdatePartitionsRequest.newBuilder()
                 .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .addAllRequests(new ArrayList<UpdatePartitionRequest>())
                 .build();
         ApiFuture<BatchUpdatePartitionsResponse> future =
             hiveMetastoreServiceClient.batchUpdatePartitionsCallable().futureCall(request);
         // Do something.
         BatchUpdatePartitionsResponse response = future.get();
       }
       
    • listPartitionsCallable

      Streams list of partitions from a table.

      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 (HiveMetastoreServiceClient hiveMetastoreServiceClient =
           HiveMetastoreServiceClient.create()) {
         ListPartitionsRequest request =
             ListPartitionsRequest.newBuilder()
                 .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString())
                 .setFilter("filter-1274492040")
                 .build();
         ServerStream<ListPartitionsResponse> stream =
             hiveMetastoreServiceClient.listPartitionsCallable().call(request);
         for (ListPartitionsResponse response : stream) {
           // Do something when a response is received.
         }
       }
       
    • 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