The BigLake Hive Metastore API defines the following resources: + * + *
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: + * + *
{@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);
+ * }
+ * }
+ *
+ * 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(). + * + *
| 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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateHiveCatalog |
+ * Updates an existing catalog. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateHiveDatabase |
+ * Creates a new database. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateHiveTable |
+ * Creates a new hive table. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
BatchCreatePartitions |
+ * Adds partitions to a table. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
BatchDeletePartitions |
+ * Deletes partitions from a table. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
BatchUpdatePartitions |
+ * Updates partitions in a table. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
|
+ *
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: + * + *
{@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
+ * HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
+ * HiveMetastoreServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * HiveMetastoreServiceClient hiveMetastoreServiceClient =
+ * HiveMetastoreServiceClient.create(hiveMetastoreServiceSettings);
+ * }
+ *
+ * To customize the endpoint: + * + *
{@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
+ * 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: + * + *
{@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
+ * HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
+ * HiveMetastoreServiceSettings.newHttpJsonBuilder().build();
+ * HiveMetastoreServiceClient hiveMetastoreServiceClient =
+ * HiveMetastoreServiceClient.create(hiveMetastoreServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HiveMetastoreServiceClient implements BackgroundResource { + private final HiveMetastoreServiceSettings settings; + private final HiveMetastoreServiceStub stub; + + /** Constructs an instance of HiveMetastoreServiceClient with default settings. */ + public static final HiveMetastoreServiceClient create() throws IOException { + return create(HiveMetastoreServiceSettings.newBuilder().build()); + } + + /** + * 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. + */ + public static final HiveMetastoreServiceClient create(HiveMetastoreServiceSettings settings) + throws IOException { + return new HiveMetastoreServiceClient(settings); + } + + /** + * Constructs an instance of HiveMetastoreServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(HiveMetastoreServiceSettings). + */ + public static final HiveMetastoreServiceClient create(HiveMetastoreServiceStub stub) { + return new HiveMetastoreServiceClient(stub); + } + + /** + * 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. + */ + protected HiveMetastoreServiceClient(HiveMetastoreServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((HiveMetastoreServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected HiveMetastoreServiceClient(HiveMetastoreServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final HiveMetastoreServiceSettings getSettings() { + return settings; + } + + public HiveMetastoreServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new hive catalog. + * + *
Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this catalog will be created. Format:
+ * projects/{project_id_or_number}
+ * @param hiveCatalog Required. The catalog to create. The `name` field does not need to be
+ * provided. Gets copied over from catalog_id.
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveCatalog createHiveCatalog(
+ ProjectName parent, HiveCatalog hiveCatalog, String hiveCatalogId) {
+ CreateHiveCatalogRequest request =
+ CreateHiveCatalogRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setHiveCatalog(hiveCatalog)
+ .setHiveCatalogId(hiveCatalogId)
+ .build();
+ return createHiveCatalog(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new hive catalog.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this catalog will be created. Format:
+ * projects/{project_id_or_number}
+ * @param hiveCatalog Required. The catalog to create. The `name` field does not need to be
+ * provided. Gets copied over from catalog_id.
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveCatalog createHiveCatalog(
+ String parent, HiveCatalog hiveCatalog, String hiveCatalogId) {
+ CreateHiveCatalogRequest request =
+ CreateHiveCatalogRequest.newBuilder()
+ .setParent(parent)
+ .setHiveCatalog(hiveCatalog)
+ .setHiveCatalogId(hiveCatalogId)
+ .build();
+ return createHiveCatalog(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new hive catalog.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveCatalog createHiveCatalog(CreateHiveCatalogRequest request) {
+ return createHiveCatalogCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new hive catalog.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.createHiveCatalogCallable().futureCall(request);
+ * // Do something.
+ * HiveCatalog response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the catalog to retrieve. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveCatalog getHiveCatalog(CatalogName name) {
+ GetHiveCatalogRequest request =
+ GetHiveCatalogRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getHiveCatalog(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the catalog specified by the resource name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the catalog to retrieve. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveCatalog getHiveCatalog(String name) {
+ GetHiveCatalogRequest request = GetHiveCatalogRequest.newBuilder().setName(name).build();
+ return getHiveCatalog(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the catalog specified by the resource name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveCatalog getHiveCatalog(GetHiveCatalogRequest request) {
+ return getHiveCatalogCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the catalog specified by the resource name.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.getHiveCatalogCallable().futureCall(request);
+ * // Do something.
+ * HiveCatalog response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project to list catalogs from. Format:
+ * projects/{project_id_or_number}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveCatalogsPagedResponse listHiveCatalogs(ProjectName parent) {
+ ListHiveCatalogsRequest request =
+ ListHiveCatalogsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listHiveCatalogs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all catalogs in a specified project.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project to list catalogs from. Format:
+ * projects/{project_id_or_number}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveCatalogsPagedResponse listHiveCatalogs(String parent) {
+ ListHiveCatalogsRequest request =
+ ListHiveCatalogsRequest.newBuilder().setParent(parent).build();
+ return listHiveCatalogs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all catalogs in a specified project.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveCatalogsPagedResponse listHiveCatalogs(ListHiveCatalogsRequest request) {
+ return listHiveCatalogsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all catalogs in a specified project.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.listHiveCatalogsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (HiveCatalog element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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}
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final HiveCatalog updateHiveCatalog(HiveCatalog hiveCatalog, FieldMask updateMask) { + UpdateHiveCatalogRequest request = + UpdateHiveCatalogRequest.newBuilder() + .setHiveCatalog(hiveCatalog) + .setUpdateMask(updateMask) + .build(); + return updateHiveCatalog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing catalog. + * + *
Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveCatalog updateHiveCatalog(UpdateHiveCatalogRequest request) {
+ return updateHiveCatalogCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates an existing catalog.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.updateHiveCatalogCallable().futureCall(request);
+ * // Do something.
+ * HiveCatalog response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the catalog to delete. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveCatalog(CatalogName name) {
+ DeleteHiveCatalogRequest request =
+ DeleteHiveCatalogRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteHiveCatalog(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not
+ * empty.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the catalog to delete. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveCatalog(String name) {
+ DeleteHiveCatalogRequest request = DeleteHiveCatalogRequest.newBuilder().setName(name).build();
+ deleteHiveCatalog(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not
+ * empty.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveCatalog(DeleteHiveCatalogRequest request) {
+ deleteHiveCatalogCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not
+ * empty.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.deleteHiveCatalogCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this database will be created. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}
+ * @param hiveDatabase Required. The database to create. The `name` field does not need to be
+ * provided.
+ * @param hiveDatabaseId Required. The ID to use for the Hive Database. The maximum length is 128
+ * characters.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveDatabase createHiveDatabase(
+ CatalogName parent, HiveDatabase hiveDatabase, String hiveDatabaseId) {
+ CreateHiveDatabaseRequest request =
+ CreateHiveDatabaseRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setHiveDatabase(hiveDatabase)
+ .setHiveDatabaseId(hiveDatabaseId)
+ .build();
+ return createHiveDatabase(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new database.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this database will be created. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}
+ * @param hiveDatabase Required. The database to create. The `name` field does not need to be
+ * provided.
+ * @param hiveDatabaseId Required. The ID to use for the Hive Database. The maximum length is 128
+ * characters.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveDatabase createHiveDatabase(
+ String parent, HiveDatabase hiveDatabase, String hiveDatabaseId) {
+ CreateHiveDatabaseRequest request =
+ CreateHiveDatabaseRequest.newBuilder()
+ .setParent(parent)
+ .setHiveDatabase(hiveDatabase)
+ .setHiveDatabaseId(hiveDatabaseId)
+ .build();
+ return createHiveDatabase(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new database.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveDatabase createHiveDatabase(CreateHiveDatabaseRequest request) {
+ return createHiveDatabaseCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new database.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.createHiveDatabaseCallable().futureCall(request);
+ * // Do something.
+ * HiveDatabase response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the database to retrieve. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveDatabase getHiveDatabase(NamespaceName name) {
+ GetHiveDatabaseRequest request =
+ GetHiveDatabaseRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getHiveDatabase(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the database specified by the resource name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the database to retrieve. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveDatabase getHiveDatabase(String name) {
+ GetHiveDatabaseRequest request = GetHiveDatabaseRequest.newBuilder().setName(name).build();
+ return getHiveDatabase(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the database specified by the resource name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveDatabase getHiveDatabase(GetHiveDatabaseRequest request) {
+ return getHiveDatabaseCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the database specified by the resource name.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.getHiveDatabaseCallable().futureCall(request);
+ * // Do something.
+ * HiveDatabase response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The hive catalog to list databases from. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveDatabasesPagedResponse listHiveDatabases(CatalogName parent) {
+ ListHiveDatabasesRequest request =
+ ListHiveDatabasesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listHiveDatabases(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all databases in a specified catalog.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The hive catalog to list databases from. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveDatabasesPagedResponse listHiveDatabases(String parent) {
+ ListHiveDatabasesRequest request =
+ ListHiveDatabasesRequest.newBuilder().setParent(parent).build();
+ return listHiveDatabases(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all databases in a specified catalog.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveDatabasesPagedResponse listHiveDatabases(ListHiveDatabasesRequest request) {
+ return listHiveDatabasesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all databases in a specified catalog.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.listHiveDatabasesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (HiveDatabase element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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} + * @param updateMask Optional. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final HiveDatabase updateHiveDatabase(HiveDatabase hiveDatabase, FieldMask updateMask) { + UpdateHiveDatabaseRequest request = + UpdateHiveDatabaseRequest.newBuilder() + .setHiveDatabase(hiveDatabase) + .setUpdateMask(updateMask) + .build(); + return updateHiveDatabase(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing database specified by the database name. + * + *
Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveDatabase updateHiveDatabase(UpdateHiveDatabaseRequest request) {
+ return updateHiveDatabaseCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates an existing database specified by the database name.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.updateHiveDatabaseCallable().futureCall(request);
+ * // Do something.
+ * HiveDatabase response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the database to delete. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveDatabase(NamespaceName name) {
+ DeleteHiveDatabaseRequest request =
+ DeleteHiveDatabaseRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteHiveDatabase(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing database specified by the database name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the database to delete. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveDatabase(String name) {
+ DeleteHiveDatabaseRequest request =
+ DeleteHiveDatabaseRequest.newBuilder().setName(name).build();
+ deleteHiveDatabase(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing database specified by the database name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveDatabase(DeleteHiveDatabaseRequest request) {
+ deleteHiveDatabaseCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing database specified by the database name.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.deleteHiveDatabaseCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource for the table to be created. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
+ * @param hiveTable Required. The Hive Table to create. The `name` field does not need to be
+ * provided.
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveTable createHiveTable(
+ NamespaceName parent, HiveTable hiveTable, String hiveTableId) {
+ CreateHiveTableRequest request =
+ CreateHiveTableRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setHiveTable(hiveTable)
+ .setHiveTableId(hiveTableId)
+ .build();
+ return createHiveTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new hive table.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource for the table to be created. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
+ * @param hiveTable Required. The Hive Table to create. The `name` field does not need to be
+ * provided.
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveTable createHiveTable(String parent, HiveTable hiveTable, String hiveTableId) {
+ CreateHiveTableRequest request =
+ CreateHiveTableRequest.newBuilder()
+ .setParent(parent)
+ .setHiveTable(hiveTable)
+ .setHiveTableId(hiveTableId)
+ .build();
+ return createHiveTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new hive table.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveTable createHiveTable(CreateHiveTableRequest request) {
+ return createHiveTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new hive table.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.createHiveTableCallable().futureCall(request);
+ * // Do something.
+ * HiveTable response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveTable getHiveTable(TableName name) {
+ GetHiveTableRequest request =
+ GetHiveTableRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getHiveTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the table specified by the resource name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveTable getHiveTable(String name) {
+ GetHiveTableRequest request = GetHiveTableRequest.newBuilder().setName(name).build();
+ return getHiveTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the table specified by the resource name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveTable getHiveTable(GetHiveTableRequest request) {
+ return getHiveTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the table specified by the resource name.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.getHiveTableCallable().futureCall(request);
+ * // Do something.
+ * HiveTable response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The database to list tables from. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveTablesPagedResponse listHiveTables(NamespaceName parent) {
+ ListHiveTablesRequest request =
+ ListHiveTablesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listHiveTables(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all hive tables in a specified project under the hive catalog and database.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The database to list tables from. Format:
+ * projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveTablesPagedResponse listHiveTables(String parent) {
+ ListHiveTablesRequest request = ListHiveTablesRequest.newBuilder().setParent(parent).build();
+ return listHiveTables(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all hive tables in a specified project under the hive catalog and database.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListHiveTablesPagedResponse listHiveTables(ListHiveTablesRequest request) {
+ return listHiveTablesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List all hive tables in a specified project under the hive catalog and database.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.listHiveTablesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (HiveTable element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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} + * @param updateMask Optional. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final HiveTable updateHiveTable(HiveTable hiveTable, FieldMask updateMask) { + UpdateHiveTableRequest request = + UpdateHiveTableRequest.newBuilder() + .setHiveTable(hiveTable) + .setUpdateMask(updateMask) + .build(); + return updateHiveTable(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing table specified by the table name. + * + *
Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HiveTable updateHiveTable(UpdateHiveTableRequest request) {
+ return updateHiveTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates an existing table specified by the table name.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.updateHiveTableCallable().futureCall(request);
+ * // Do something.
+ * HiveTable response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveTable(TableName name) {
+ DeleteHiveTableRequest request =
+ DeleteHiveTableRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteHiveTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing table specified by the table name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveTable(String name) {
+ DeleteHiveTableRequest request = DeleteHiveTableRequest.newBuilder().setName(name).build();
+ deleteHiveTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing table specified by the table name.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteHiveTable(DeleteHiveTableRequest request) {
+ deleteHiveTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing table specified by the table name.
+ *
+ * Sample code: + * + *
{@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 future =
+ * hiveMetastoreServiceClient.deleteHiveTableCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreatePartitionsResponse batchCreatePartitions(TableName parent) {
+ BatchCreatePartitionsRequest request =
+ BatchCreatePartitionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return batchCreatePartitions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Adds partitions to a table.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreatePartitionsResponse batchCreatePartitions(String parent) {
+ BatchCreatePartitionsRequest request =
+ BatchCreatePartitionsRequest.newBuilder().setParent(parent).build();
+ return batchCreatePartitions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Adds partitions to a table.
+ *
+ * Sample code: + * + *
{@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())
+ * .setSkipExistingPartitions(true)
+ * .build();
+ * BatchCreatePartitionsResponse response =
+ * hiveMetastoreServiceClient.batchCreatePartitions(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreatePartitionsResponse batchCreatePartitions(
+ BatchCreatePartitionsRequest request) {
+ return batchCreatePartitionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Adds partitions to a table.
+ *
+ * Sample code: + * + *
{@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())
+ * .setSkipExistingPartitions(true)
+ * .build();
+ * ApiFuture future =
+ * hiveMetastoreServiceClient.batchCreatePartitionsCallable().futureCall(request);
+ * // Do something.
+ * BatchCreatePartitionsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. Reference to the table to which these partitions belong, in the format
+ * of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void batchDeletePartitions(TableName parent) {
+ BatchDeletePartitionsRequest request =
+ BatchDeletePartitionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ batchDeletePartitions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes partitions from a table.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. Reference to the table to which these partitions belong, in the format
+ * of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void batchDeletePartitions(String parent) {
+ BatchDeletePartitionsRequest request =
+ BatchDeletePartitionsRequest.newBuilder().setParent(parent).build();
+ batchDeletePartitions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes partitions from a table.
+ *
+ * Sample code: + * + *
{@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())
+ * .build();
+ * hiveMetastoreServiceClient.batchDeletePartitions(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void batchDeletePartitions(BatchDeletePartitionsRequest request) {
+ batchDeletePartitionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes partitions from a table.
+ *
+ * Sample code: + * + *
{@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())
+ * .build();
+ * ApiFuture future =
+ * hiveMetastoreServiceClient.batchDeletePartitionsCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. Reference to the table to which these partitions belong, in the format
+ * of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdatePartitionsResponse batchUpdatePartitions(TableName parent) {
+ BatchUpdatePartitionsRequest request =
+ BatchUpdatePartitionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return batchUpdatePartitions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates partitions in a table.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param parent Required. Reference to the table to which these partitions belong, in the format
+ * of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdatePartitionsResponse batchUpdatePartitions(String parent) {
+ BatchUpdatePartitionsRequest request =
+ BatchUpdatePartitionsRequest.newBuilder().setParent(parent).build();
+ return batchUpdatePartitions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates partitions in a table.
+ *
+ * Sample code: + * + *
{@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())
+ * .build();
+ * BatchUpdatePartitionsResponse response =
+ * hiveMetastoreServiceClient.batchUpdatePartitions(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdatePartitionsResponse batchUpdatePartitions(
+ BatchUpdatePartitionsRequest request) {
+ return batchUpdatePartitionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates partitions in a table.
+ *
+ * Sample code: + * + *
{@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())
+ * .build();
+ * ApiFuture future =
+ * hiveMetastoreServiceClient.batchUpdatePartitionsCallable().futureCall(request);
+ * // Do something.
+ * BatchUpdatePartitionsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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 stream =
+ * hiveMetastoreServiceClient.listPartitionsCallable().call(request);
+ * for (ListPartitionsResponse response : stream) {
+ * // Do something when a response is received.
+ * }
+ * }
+ * }
+ */
+ public final ServerStreamingCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createHiveCatalog: + * + *
{@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
+ * HiveMetastoreServiceSettings.Builder hiveMetastoreServiceSettingsBuilder =
+ * HiveMetastoreServiceSettings.newBuilder();
+ * hiveMetastoreServiceSettingsBuilder
+ * .createHiveCatalogSettings()
+ * .setRetrySettings(
+ * hiveMetastoreServiceSettingsBuilder
+ * .createHiveCatalogSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
+ * hiveMetastoreServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HiveMetastoreServiceSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= HiveMetastoreServiceClient =======================
+ *
+ * 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:
+ *
+ * Sample for HiveMetastoreServiceClient:
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcHiveMetastoreServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcHiveMetastoreServiceStub extends HiveMetastoreServiceStub {
+ private static final MethodDescriptor This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class HiveMetastoreServiceStub implements BackgroundResource {
+
+ public UnaryCallable
+ *
+ *
+ * {@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);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.biglake.hive.v1beta;
+
+import javax.annotation.Generated;
diff --git a/java-biglake/google-cloud-biglake/src/main/java/com/google/cloud/biglake/hive/v1beta/stub/GrpcHiveMetastoreServiceCallableFactory.java b/java-biglake/google-cloud-biglake/src/main/java/com/google/cloud/biglake/hive/v1beta/stub/GrpcHiveMetastoreServiceCallableFactory.java
new file mode 100644
index 000000000000..3c579f5837f8
--- /dev/null
+++ b/java-biglake/google-cloud-biglake/src/main/java/com/google/cloud/biglake/hive/v1beta/stub/GrpcHiveMetastoreServiceCallableFactory.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.biglake.hive.v1beta.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC callable factory implementation for the HiveMetastoreService service API.
+ *
+ *