Class HiveMetastoreServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
The BigLake Hive Metastore API defines the following resources:
- A collection of Google Cloud projects: `/projects/*`
- Each project has a collection of catalogs: `/catalogs/*`
- Each catalog has a collection of databases: `/databases/*`
- Each database has a collection of tables: `/tables/*`
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (HiveMetastoreServiceClient hiveMetastoreServiceClient =
HiveMetastoreServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
HiveCatalog hiveCatalog = HiveCatalog.newBuilder().build();
String hiveCatalogId = "hiveCatalogId-575314556";
HiveCatalog response =
hiveMetastoreServiceClient.createHiveCatalog(parent, hiveCatalog, hiveCatalogId);
}
Note: close() needs to be called on the HiveMetastoreServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
HiveMetastoreServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
HiveMetastoreServiceClient hiveMetastoreServiceClient =
HiveMetastoreServiceClient.create(hiveMetastoreServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
HiveMetastoreServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
HiveMetastoreServiceClient hiveMetastoreServiceClient =
HiveMetastoreServiceClient.create(hiveMetastoreServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
HiveMetastoreServiceSettings hiveMetastoreServiceSettings =
HiveMetastoreServiceSettings.newHttpJsonBuilder().build();
HiveMetastoreServiceClient hiveMetastoreServiceClient =
HiveMetastoreServiceClient.create(hiveMetastoreServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of HiveMetastoreServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) Adds partitions to a table.batchCreatePartitions(TableName parent) Adds partitions to a table.batchCreatePartitions(String parent) Adds partitions to a table.Adds partitions to a table.final voidDeletes partitions from a table.final voidbatchDeletePartitions(TableName parent) Deletes partitions from a table.final voidbatchDeletePartitions(String parent) Deletes partitions from a table.final UnaryCallable<BatchDeletePartitionsRequest,com.google.protobuf.Empty> Deletes partitions from a table.Updates partitions in a table.batchUpdatePartitions(TableName parent) Updates partitions in a table.batchUpdatePartitions(String parent) Updates partitions in a table.Updates partitions in a table.final voidclose()static final HiveMetastoreServiceClientcreate()Constructs an instance of HiveMetastoreServiceClient with default settings.static final HiveMetastoreServiceClientcreate(HiveMetastoreServiceSettings settings) Constructs an instance of HiveMetastoreServiceClient, using the given settings.static final HiveMetastoreServiceClientConstructs an instance of HiveMetastoreServiceClient, using the given stub for making calls.final HiveCatalogCreates a new hive catalog.final HiveCatalogcreateHiveCatalog(ProjectName parent, HiveCatalog hiveCatalog, String hiveCatalogId) Creates a new hive catalog.final HiveCatalogcreateHiveCatalog(String parent, HiveCatalog hiveCatalog, String hiveCatalogId) Creates a new hive catalog.Creates a new hive catalog.final HiveDatabasecreateHiveDatabase(CatalogName parent, HiveDatabase hiveDatabase, String hiveDatabaseId) Creates a new database.final HiveDatabaseCreates a new database.final HiveDatabasecreateHiveDatabase(String parent, HiveDatabase hiveDatabase, String hiveDatabaseId) Creates a new database.Creates a new database.final HiveTablecreateHiveTable(CreateHiveTableRequest request) Creates a new hive table.final HiveTablecreateHiveTable(NamespaceName parent, HiveTable hiveTable, String hiveTableId) Creates a new hive table.final HiveTablecreateHiveTable(String parent, HiveTable hiveTable, String hiveTableId) Creates a new hive table.Creates a new hive table.final voiddeleteHiveCatalog(CatalogName name) Deletes an existing catalog specified by the catalog ID.final voidDeletes an existing catalog specified by the catalog ID.final voiddeleteHiveCatalog(String name) Deletes an existing catalog specified by the catalog ID.final UnaryCallable<DeleteHiveCatalogRequest,com.google.protobuf.Empty> Deletes an existing catalog specified by the catalog ID.final voidDeletes an existing database specified by the database name.final voidDeletes an existing database specified by the database name.final voiddeleteHiveDatabase(String name) Deletes an existing database specified by the database name.final UnaryCallable<DeleteHiveDatabaseRequest,com.google.protobuf.Empty> Deletes an existing database specified by the database name.final voiddeleteHiveTable(DeleteHiveTableRequest request) Deletes an existing table specified by the table name.final voiddeleteHiveTable(TableName name) Deletes an existing table specified by the table name.final voiddeleteHiveTable(String name) Deletes an existing table specified by the table name.final UnaryCallable<DeleteHiveTableRequest,com.google.protobuf.Empty> Deletes an existing table specified by the table name.final HiveCataloggetHiveCatalog(CatalogName name) Gets the catalog specified by the resource name.final HiveCataloggetHiveCatalog(GetHiveCatalogRequest request) Gets the catalog specified by the resource name.final HiveCataloggetHiveCatalog(String name) Gets the catalog specified by the resource name.Gets the catalog specified by the resource name.final HiveDatabasegetHiveDatabase(GetHiveDatabaseRequest request) Gets the database specified by the resource name.final HiveDatabasegetHiveDatabase(NamespaceName name) Gets the database specified by the resource name.final HiveDatabasegetHiveDatabase(String name) Gets the database specified by the resource name.Gets the database specified by the resource name.final HiveTablegetHiveTable(GetHiveTableRequest request) Gets the table specified by the resource name.final HiveTablegetHiveTable(TableName name) Gets the table specified by the resource name.final HiveTablegetHiveTable(String name) Gets the table specified by the resource name.Gets the table specified by the resource name.getStub()booleanbooleanlistHiveCatalogs(ListHiveCatalogsRequest request) List all catalogs in a specified project.listHiveCatalogs(ProjectName parent) List all catalogs in a specified project.listHiveCatalogs(String parent) List all catalogs in a specified project.List all catalogs in a specified project.final UnaryCallable<ListHiveCatalogsRequest,HiveMetastoreServiceClient.ListHiveCatalogsPagedResponse> List all catalogs in a specified project.listHiveDatabases(CatalogName parent) List all databases in a specified catalog.List all databases in a specified catalog.listHiveDatabases(String parent) List all databases in a specified catalog.List all databases in a specified catalog.final UnaryCallable<ListHiveDatabasesRequest,HiveMetastoreServiceClient.ListHiveDatabasesPagedResponse> List all databases in a specified catalog.listHiveTables(ListHiveTablesRequest request) List all hive tables in a specified project under the hive catalog and database.listHiveTables(NamespaceName parent) List all hive tables in a specified project under the hive catalog and database.listHiveTables(String parent) List all hive tables in a specified project under the hive catalog and database.List all hive tables in a specified project under the hive catalog and database.List all hive tables in a specified project under the hive catalog and database.Streams list of partitions from a table.voidshutdown()voidfinal HiveCatalogupdateHiveCatalog(HiveCatalog hiveCatalog, com.google.protobuf.FieldMask updateMask) Updates an existing catalog.final HiveCatalogUpdates an existing catalog.Updates an existing catalog.final HiveDatabaseupdateHiveDatabase(HiveDatabase hiveDatabase, com.google.protobuf.FieldMask updateMask) Updates an existing database specified by the database name.final HiveDatabaseUpdates an existing database specified by the database name.Updates an existing database specified by the database name.final HiveTableupdateHiveTable(HiveTable hiveTable, com.google.protobuf.FieldMask updateMask) Updates an existing table specified by the table name.final HiveTableupdateHiveTable(UpdateHiveTableRequest request) Updates an existing table specified by the table name.Updates an existing table specified by the table name.
-
Constructor Details
-
HiveMetastoreServiceClient
Constructs an instance of HiveMetastoreServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
HiveMetastoreServiceClient
-
-
Method Details
-
create
Constructs an instance of HiveMetastoreServiceClient with default settings.- Throws:
IOException
-
create
public static final HiveMetastoreServiceClient create(HiveMetastoreServiceSettings settings) throws IOException Constructs an instance of HiveMetastoreServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of HiveMetastoreServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(HiveMetastoreServiceSettings). -
getSettings
-
getStub
-
createHiveCatalog
public final HiveCatalog createHiveCatalog(ProjectName parent, HiveCatalog hiveCatalog, String hiveCatalogId) Creates a new hive catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); HiveCatalog hiveCatalog = HiveCatalog.newBuilder().build(); String hiveCatalogId = "hiveCatalogId-575314556"; HiveCatalog response = hiveMetastoreServiceClient.createHiveCatalog(parent, hiveCatalog, hiveCatalogId); }- Parameters:
parent- Required. The parent resource where this catalog will be created. Format: projects/{project_id_or_number}hiveCatalog- Required. The catalog to create. The `name` field does not need to be provided. Gets copied over from catalog_id.hiveCatalogId- Required. The Hive Catalog ID to use for the catalog that will become the final component of the catalog's resource name. The maximum length is 256 characters.- Throws:
ApiException- if the remote call fails
-
createHiveCatalog
public final HiveCatalog createHiveCatalog(String parent, HiveCatalog hiveCatalog, String hiveCatalogId) Creates a new hive catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); HiveCatalog hiveCatalog = HiveCatalog.newBuilder().build(); String hiveCatalogId = "hiveCatalogId-575314556"; HiveCatalog response = hiveMetastoreServiceClient.createHiveCatalog(parent, hiveCatalog, hiveCatalogId); }- Parameters:
parent- Required. The parent resource where this catalog will be created. Format: projects/{project_id_or_number}hiveCatalog- Required. The catalog to create. The `name` field does not need to be provided. Gets copied over from catalog_id.hiveCatalogId- Required. The Hive Catalog ID to use for the catalog that will become the final component of the catalog's resource name. The maximum length is 256 characters.- Throws:
ApiException- if the remote call fails
-
createHiveCatalog
Creates a new hive catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CreateHiveCatalogRequest request = CreateHiveCatalogRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setHiveCatalog(HiveCatalog.newBuilder().build()) .setHiveCatalogId("hiveCatalogId-575314556") .setPrimaryLocation("primaryLocation-1140723753") .build(); HiveCatalog response = hiveMetastoreServiceClient.createHiveCatalog(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createHiveCatalogCallable
Creates a new hive catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CreateHiveCatalogRequest request = CreateHiveCatalogRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setHiveCatalog(HiveCatalog.newBuilder().build()) .setHiveCatalogId("hiveCatalogId-575314556") .setPrimaryLocation("primaryLocation-1140723753") .build(); ApiFuture<HiveCatalog> future = hiveMetastoreServiceClient.createHiveCatalogCallable().futureCall(request); // Do something. HiveCatalog response = future.get(); } -
getHiveCatalog
Gets the catalog specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CatalogName name = CatalogName.of("[PROJECT]", "[CATALOG]"); HiveCatalog response = hiveMetastoreServiceClient.getHiveCatalog(name); }- Parameters:
name- Required. The name of the catalog to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}- Throws:
ApiException- if the remote call fails
-
getHiveCatalog
Gets the catalog specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String name = CatalogName.of("[PROJECT]", "[CATALOG]").toString(); HiveCatalog response = hiveMetastoreServiceClient.getHiveCatalog(name); }- Parameters:
name- Required. The name of the catalog to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}- Throws:
ApiException- if the remote call fails
-
getHiveCatalog
Gets the catalog specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { GetHiveCatalogRequest request = GetHiveCatalogRequest.newBuilder() .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .build(); HiveCatalog response = hiveMetastoreServiceClient.getHiveCatalog(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getHiveCatalogCallable
Gets the catalog specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { GetHiveCatalogRequest request = GetHiveCatalogRequest.newBuilder() .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .build(); ApiFuture<HiveCatalog> future = hiveMetastoreServiceClient.getHiveCatalogCallable().futureCall(request); // Do something. HiveCatalog response = future.get(); } -
listHiveCatalogs
public final HiveMetastoreServiceClient.ListHiveCatalogsPagedResponse listHiveCatalogs(ProjectName parent) List all catalogs in a specified project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); for (HiveCatalog element : hiveMetastoreServiceClient.listHiveCatalogs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project to list catalogs from. Format: projects/{project_id_or_number}- Throws:
ApiException- if the remote call fails
-
listHiveCatalogs
public final HiveMetastoreServiceClient.ListHiveCatalogsPagedResponse listHiveCatalogs(String parent) List all catalogs in a specified project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = ProjectName.of("[PROJECT]").toString(); for (HiveCatalog element : hiveMetastoreServiceClient.listHiveCatalogs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project to list catalogs from. Format: projects/{project_id_or_number}- Throws:
ApiException- if the remote call fails
-
listHiveCatalogs
public final HiveMetastoreServiceClient.ListHiveCatalogsPagedResponse listHiveCatalogs(ListHiveCatalogsRequest request) List all catalogs in a specified project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveCatalogsRequest request = ListHiveCatalogsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (HiveCatalog element : hiveMetastoreServiceClient.listHiveCatalogs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listHiveCatalogsPagedCallable
public final UnaryCallable<ListHiveCatalogsRequest,HiveMetastoreServiceClient.ListHiveCatalogsPagedResponse> listHiveCatalogsPagedCallable()List all catalogs in a specified project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveCatalogsRequest request = ListHiveCatalogsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<HiveCatalog> future = hiveMetastoreServiceClient.listHiveCatalogsPagedCallable().futureCall(request); // Do something. for (HiveCatalog element : future.get().iterateAll()) { // doThingsWith(element); } } -
listHiveCatalogsCallable
public final UnaryCallable<ListHiveCatalogsRequest,ListHiveCatalogsResponse> listHiveCatalogsCallable()List all catalogs in a specified project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveCatalogsRequest request = ListHiveCatalogsRequest.newBuilder() .setParent(ProjectName.of("[PROJECT]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListHiveCatalogsResponse response = hiveMetastoreServiceClient.listHiveCatalogsCallable().call(request); for (HiveCatalog element : response.getCatalogsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateHiveCatalog
public final HiveCatalog updateHiveCatalog(HiveCatalog hiveCatalog, com.google.protobuf.FieldMask updateMask) Updates an existing catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { HiveCatalog hiveCatalog = HiveCatalog.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); HiveCatalog response = hiveMetastoreServiceClient.updateHiveCatalog(hiveCatalog, updateMask); }- Parameters:
hiveCatalog- Required. The hive catalog to update. The name under the catalog is used to identify the catalog. Format: projects/{project_id_or_number}/catalogs/{catalog_id}updateMask- Optional. The list of fields to update.For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all of the fields that are allowed to update.
- Throws:
ApiException- if the remote call fails
-
updateHiveCatalog
Updates an existing catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { UpdateHiveCatalogRequest request = UpdateHiveCatalogRequest.newBuilder() .setHiveCatalog(HiveCatalog.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); HiveCatalog response = hiveMetastoreServiceClient.updateHiveCatalog(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateHiveCatalogCallable
Updates an existing catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { UpdateHiveCatalogRequest request = UpdateHiveCatalogRequest.newBuilder() .setHiveCatalog(HiveCatalog.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<HiveCatalog> future = hiveMetastoreServiceClient.updateHiveCatalogCallable().futureCall(request); // Do something. HiveCatalog response = future.get(); } -
deleteHiveCatalog
Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CatalogName name = CatalogName.of("[PROJECT]", "[CATALOG]"); hiveMetastoreServiceClient.deleteHiveCatalog(name); }- Parameters:
name- Required. The name of the catalog to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}- Throws:
ApiException- if the remote call fails
-
deleteHiveCatalog
Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String name = CatalogName.of("[PROJECT]", "[CATALOG]").toString(); hiveMetastoreServiceClient.deleteHiveCatalog(name); }- Parameters:
name- Required. The name of the catalog to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}- Throws:
ApiException- if the remote call fails
-
deleteHiveCatalog
Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { DeleteHiveCatalogRequest request = DeleteHiveCatalogRequest.newBuilder() .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .build(); hiveMetastoreServiceClient.deleteHiveCatalog(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteHiveCatalogCallable
public final UnaryCallable<DeleteHiveCatalogRequest,com.google.protobuf.Empty> deleteHiveCatalogCallable()Deletes an existing catalog specified by the catalog ID. Delete will fail if the catalog is not empty.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { DeleteHiveCatalogRequest request = DeleteHiveCatalogRequest.newBuilder() .setName(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .build(); ApiFuture<Empty> future = hiveMetastoreServiceClient.deleteHiveCatalogCallable().futureCall(request); // Do something. future.get(); } -
createHiveDatabase
public final HiveDatabase createHiveDatabase(CatalogName parent, HiveDatabase hiveDatabase, String hiveDatabaseId) Creates a new database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CatalogName parent = CatalogName.of("[PROJECT]", "[CATALOG]"); HiveDatabase hiveDatabase = HiveDatabase.newBuilder().build(); String hiveDatabaseId = "hiveDatabaseId-1150232698"; HiveDatabase response = hiveMetastoreServiceClient.createHiveDatabase(parent, hiveDatabase, hiveDatabaseId); }- Parameters:
parent- Required. The parent resource where this database will be created. Format: projects/{project_id_or_number}/catalogs/{catalog_id}hiveDatabase- Required. The database to create. The `name` field does not need to be provided.hiveDatabaseId- Required. The ID to use for the Hive Database. The maximum length is 128 characters.- Throws:
ApiException- if the remote call fails
-
createHiveDatabase
public final HiveDatabase createHiveDatabase(String parent, HiveDatabase hiveDatabase, String hiveDatabaseId) Creates a new database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = CatalogName.of("[PROJECT]", "[CATALOG]").toString(); HiveDatabase hiveDatabase = HiveDatabase.newBuilder().build(); String hiveDatabaseId = "hiveDatabaseId-1150232698"; HiveDatabase response = hiveMetastoreServiceClient.createHiveDatabase(parent, hiveDatabase, hiveDatabaseId); }- Parameters:
parent- Required. The parent resource where this database will be created. Format: projects/{project_id_or_number}/catalogs/{catalog_id}hiveDatabase- Required. The database to create. The `name` field does not need to be provided.hiveDatabaseId- Required. The ID to use for the Hive Database. The maximum length is 128 characters.- Throws:
ApiException- if the remote call fails
-
createHiveDatabase
Creates a new database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CreateHiveDatabaseRequest request = CreateHiveDatabaseRequest.newBuilder() .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .setHiveDatabase(HiveDatabase.newBuilder().build()) .setHiveDatabaseId("hiveDatabaseId-1150232698") .build(); HiveDatabase response = hiveMetastoreServiceClient.createHiveDatabase(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createHiveDatabaseCallable
Creates a new database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CreateHiveDatabaseRequest request = CreateHiveDatabaseRequest.newBuilder() .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .setHiveDatabase(HiveDatabase.newBuilder().build()) .setHiveDatabaseId("hiveDatabaseId-1150232698") .build(); ApiFuture<HiveDatabase> future = hiveMetastoreServiceClient.createHiveDatabaseCallable().futureCall(request); // Do something. HiveDatabase response = future.get(); } -
getHiveDatabase
Gets the database specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { NamespaceName name = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]"); HiveDatabase response = hiveMetastoreServiceClient.getHiveDatabase(name); }- Parameters:
name- Required. The name of the database to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}- Throws:
ApiException- if the remote call fails
-
getHiveDatabase
Gets the database specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String name = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString(); HiveDatabase response = hiveMetastoreServiceClient.getHiveDatabase(name); }- Parameters:
name- Required. The name of the database to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}- Throws:
ApiException- if the remote call fails
-
getHiveDatabase
Gets the database specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { GetHiveDatabaseRequest request = GetHiveDatabaseRequest.newBuilder() .setName(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .build(); HiveDatabase response = hiveMetastoreServiceClient.getHiveDatabase(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getHiveDatabaseCallable
Gets the database specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { GetHiveDatabaseRequest request = GetHiveDatabaseRequest.newBuilder() .setName(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .build(); ApiFuture<HiveDatabase> future = hiveMetastoreServiceClient.getHiveDatabaseCallable().futureCall(request); // Do something. HiveDatabase response = future.get(); } -
listHiveDatabases
public final HiveMetastoreServiceClient.ListHiveDatabasesPagedResponse listHiveDatabases(CatalogName parent) List all databases in a specified catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CatalogName parent = CatalogName.of("[PROJECT]", "[CATALOG]"); for (HiveDatabase element : hiveMetastoreServiceClient.listHiveDatabases(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The hive catalog to list databases from. Format: projects/{project_id_or_number}/catalogs/{catalog_id}- Throws:
ApiException- if the remote call fails
-
listHiveDatabases
public final HiveMetastoreServiceClient.ListHiveDatabasesPagedResponse listHiveDatabases(String parent) List all databases in a specified catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = CatalogName.of("[PROJECT]", "[CATALOG]").toString(); for (HiveDatabase element : hiveMetastoreServiceClient.listHiveDatabases(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The hive catalog to list databases from. Format: projects/{project_id_or_number}/catalogs/{catalog_id}- Throws:
ApiException- if the remote call fails
-
listHiveDatabases
public final HiveMetastoreServiceClient.ListHiveDatabasesPagedResponse listHiveDatabases(ListHiveDatabasesRequest request) List all databases in a specified catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveDatabasesRequest request = ListHiveDatabasesRequest.newBuilder() .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (HiveDatabase element : hiveMetastoreServiceClient.listHiveDatabases(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listHiveDatabasesPagedCallable
public final UnaryCallable<ListHiveDatabasesRequest,HiveMetastoreServiceClient.ListHiveDatabasesPagedResponse> listHiveDatabasesPagedCallable()List all databases in a specified catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveDatabasesRequest request = ListHiveDatabasesRequest.newBuilder() .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<HiveDatabase> future = hiveMetastoreServiceClient.listHiveDatabasesPagedCallable().futureCall(request); // Do something. for (HiveDatabase element : future.get().iterateAll()) { // doThingsWith(element); } } -
listHiveDatabasesCallable
public final UnaryCallable<ListHiveDatabasesRequest,ListHiveDatabasesResponse> listHiveDatabasesCallable()List all databases in a specified catalog.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveDatabasesRequest request = ListHiveDatabasesRequest.newBuilder() .setParent(CatalogName.of("[PROJECT]", "[CATALOG]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListHiveDatabasesResponse response = hiveMetastoreServiceClient.listHiveDatabasesCallable().call(request); for (HiveDatabase element : response.getDatabasesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateHiveDatabase
public final HiveDatabase updateHiveDatabase(HiveDatabase hiveDatabase, com.google.protobuf.FieldMask updateMask) Updates an existing database specified by the database name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { HiveDatabase hiveDatabase = HiveDatabase.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); HiveDatabase response = hiveMetastoreServiceClient.updateHiveDatabase(hiveDatabase, updateMask); }- Parameters:
hiveDatabase- Required. The database to update.The database's `name` field is used to identify the database to update. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}
updateMask- Optional. The list of fields to update.- Throws:
ApiException- if the remote call fails
-
updateHiveDatabase
Updates an existing database specified by the database name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { UpdateHiveDatabaseRequest request = UpdateHiveDatabaseRequest.newBuilder() .setHiveDatabase(HiveDatabase.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); HiveDatabase response = hiveMetastoreServiceClient.updateHiveDatabase(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateHiveDatabaseCallable
Updates an existing database specified by the database name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { UpdateHiveDatabaseRequest request = UpdateHiveDatabaseRequest.newBuilder() .setHiveDatabase(HiveDatabase.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<HiveDatabase> future = hiveMetastoreServiceClient.updateHiveDatabaseCallable().futureCall(request); // Do something. HiveDatabase response = future.get(); } -
deleteHiveDatabase
Deletes an existing database specified by the database name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { NamespaceName name = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]"); hiveMetastoreServiceClient.deleteHiveDatabase(name); }- Parameters:
name- Required. The name of the database to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}- Throws:
ApiException- if the remote call fails
-
deleteHiveDatabase
Deletes an existing database specified by the database name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String name = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString(); hiveMetastoreServiceClient.deleteHiveDatabase(name); }- Parameters:
name- Required. The name of the database to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}- Throws:
ApiException- if the remote call fails
-
deleteHiveDatabase
Deletes an existing database specified by the database name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { DeleteHiveDatabaseRequest request = DeleteHiveDatabaseRequest.newBuilder() .setName(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .build(); hiveMetastoreServiceClient.deleteHiveDatabase(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteHiveDatabaseCallable
public final UnaryCallable<DeleteHiveDatabaseRequest,com.google.protobuf.Empty> deleteHiveDatabaseCallable()Deletes an existing database specified by the database name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { DeleteHiveDatabaseRequest request = DeleteHiveDatabaseRequest.newBuilder() .setName(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .build(); ApiFuture<Empty> future = hiveMetastoreServiceClient.deleteHiveDatabaseCallable().futureCall(request); // Do something. future.get(); } -
createHiveTable
public final HiveTable createHiveTable(NamespaceName parent, HiveTable hiveTable, String hiveTableId) Creates a new hive table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { NamespaceName parent = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]"); HiveTable hiveTable = HiveTable.newBuilder().build(); String hiveTableId = "hiveTableId152241145"; HiveTable response = hiveMetastoreServiceClient.createHiveTable(parent, hiveTable, hiveTableId); }- Parameters:
parent- Required. The parent resource for the table to be created. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}hiveTable- Required. The Hive Table to create. The `name` field does not need to be provided.hiveTableId- Required. The Hive Table ID to use for the table that will become the final component of the table's resource name. The maximum length is 256 characters.- Throws:
ApiException- if the remote call fails
-
createHiveTable
Creates a new hive table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString(); HiveTable hiveTable = HiveTable.newBuilder().build(); String hiveTableId = "hiveTableId152241145"; HiveTable response = hiveMetastoreServiceClient.createHiveTable(parent, hiveTable, hiveTableId); }- Parameters:
parent- Required. The parent resource for the table to be created. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}hiveTable- Required. The Hive Table to create. The `name` field does not need to be provided.hiveTableId- Required. The Hive Table ID to use for the table that will become the final component of the table's resource name. The maximum length is 256 characters.- Throws:
ApiException- if the remote call fails
-
createHiveTable
Creates a new hive table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CreateHiveTableRequest request = CreateHiveTableRequest.newBuilder() .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .setHiveTable(HiveTable.newBuilder().build()) .setHiveTableId("hiveTableId152241145") .build(); HiveTable response = hiveMetastoreServiceClient.createHiveTable(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createHiveTableCallable
Creates a new hive table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { CreateHiveTableRequest request = CreateHiveTableRequest.newBuilder() .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .setHiveTable(HiveTable.newBuilder().build()) .setHiveTableId("hiveTableId152241145") .build(); ApiFuture<HiveTable> future = hiveMetastoreServiceClient.createHiveTableCallable().futureCall(request); // Do something. HiveTable response = future.get(); } -
getHiveTable
Gets the table specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { TableName name = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]"); HiveTable response = hiveMetastoreServiceClient.getHiveTable(name); }- Parameters:
name- Required. The name of the table to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}- Throws:
ApiException- if the remote call fails
-
getHiveTable
Gets the table specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String name = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString(); HiveTable response = hiveMetastoreServiceClient.getHiveTable(name); }- Parameters:
name- Required. The name of the table to retrieve. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}- Throws:
ApiException- if the remote call fails
-
getHiveTable
Gets the table specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { GetHiveTableRequest request = GetHiveTableRequest.newBuilder() .setName(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .build(); HiveTable response = hiveMetastoreServiceClient.getHiveTable(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getHiveTableCallable
Gets the table specified by the resource name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { GetHiveTableRequest request = GetHiveTableRequest.newBuilder() .setName(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .build(); ApiFuture<HiveTable> future = hiveMetastoreServiceClient.getHiveTableCallable().futureCall(request); // Do something. HiveTable response = future.get(); } -
listHiveTables
public final HiveMetastoreServiceClient.ListHiveTablesPagedResponse listHiveTables(NamespaceName parent) List all hive tables in a specified project under the hive catalog and database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { NamespaceName parent = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]"); for (HiveTable element : hiveMetastoreServiceClient.listHiveTables(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The database to list tables from. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}- Throws:
ApiException- if the remote call fails
-
listHiveTables
List all hive tables in a specified project under the hive catalog and database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString(); for (HiveTable element : hiveMetastoreServiceClient.listHiveTables(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The database to list tables from. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}- Throws:
ApiException- if the remote call fails
-
listHiveTables
public final HiveMetastoreServiceClient.ListHiveTablesPagedResponse listHiveTables(ListHiveTablesRequest request) List all hive tables in a specified project under the hive catalog and database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveTablesRequest request = ListHiveTablesRequest.newBuilder() .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (HiveTable element : hiveMetastoreServiceClient.listHiveTables(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listHiveTablesPagedCallable
public final UnaryCallable<ListHiveTablesRequest,HiveMetastoreServiceClient.ListHiveTablesPagedResponse> listHiveTablesPagedCallable()List all hive tables in a specified project under the hive catalog and database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveTablesRequest request = ListHiveTablesRequest.newBuilder() .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<HiveTable> future = hiveMetastoreServiceClient.listHiveTablesPagedCallable().futureCall(request); // Do something. for (HiveTable element : future.get().iterateAll()) { // doThingsWith(element); } } -
listHiveTablesCallable
List all hive tables in a specified project under the hive catalog and database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListHiveTablesRequest request = ListHiveTablesRequest.newBuilder() .setParent(NamespaceName.of("[PROJECT]", "[CATALOG]", "[DATABASE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListHiveTablesResponse response = hiveMetastoreServiceClient.listHiveTablesCallable().call(request); for (HiveTable element : response.getTablesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateHiveTable
public final HiveTable updateHiveTable(HiveTable hiveTable, com.google.protobuf.FieldMask updateMask) Updates an existing table specified by the table name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { HiveTable hiveTable = HiveTable.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); HiveTable response = hiveMetastoreServiceClient.updateHiveTable(hiveTable, updateMask); }- Parameters:
hiveTable- Required. The table to update.The table's `name` field is used to identify the table to update. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
updateMask- Optional. The list of fields to update.- Throws:
ApiException- if the remote call fails
-
updateHiveTable
Updates an existing table specified by the table name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { UpdateHiveTableRequest request = UpdateHiveTableRequest.newBuilder() .setHiveTable(HiveTable.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); HiveTable response = hiveMetastoreServiceClient.updateHiveTable(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateHiveTableCallable
Updates an existing table specified by the table name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { UpdateHiveTableRequest request = UpdateHiveTableRequest.newBuilder() .setHiveTable(HiveTable.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<HiveTable> future = hiveMetastoreServiceClient.updateHiveTableCallable().futureCall(request); // Do something. HiveTable response = future.get(); } -
deleteHiveTable
Deletes an existing table specified by the table name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { TableName name = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]"); hiveMetastoreServiceClient.deleteHiveTable(name); }- Parameters:
name- Required. The name of the database to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}- Throws:
ApiException- if the remote call fails
-
deleteHiveTable
Deletes an existing table specified by the table name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String name = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString(); hiveMetastoreServiceClient.deleteHiveTable(name); }- Parameters:
name- Required. The name of the database to delete. Format: projects/{project_id_or_number}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}- Throws:
ApiException- if the remote call fails
-
deleteHiveTable
Deletes an existing table specified by the table name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { DeleteHiveTableRequest request = DeleteHiveTableRequest.newBuilder() .setName(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .build(); hiveMetastoreServiceClient.deleteHiveTable(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteHiveTableCallable
public final UnaryCallable<DeleteHiveTableRequest,com.google.protobuf.Empty> deleteHiveTableCallable()Deletes an existing table specified by the table name.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { DeleteHiveTableRequest request = DeleteHiveTableRequest.newBuilder() .setName(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .build(); ApiFuture<Empty> future = hiveMetastoreServiceClient.deleteHiveTableCallable().futureCall(request); // Do something. future.get(); } -
batchCreatePartitions
Adds partitions to a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { TableName parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]"); BatchCreatePartitionsResponse response = hiveMetastoreServiceClient.batchCreatePartitions(parent); }- Parameters:
parent- Required. Reference to the table to where the partitions to be added, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.- Throws:
ApiException- if the remote call fails
-
batchCreatePartitions
Adds partitions to a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString(); BatchCreatePartitionsResponse response = hiveMetastoreServiceClient.batchCreatePartitions(parent); }- Parameters:
parent- Required. Reference to the table to where the partitions to be added, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.- Throws:
ApiException- if the remote call fails
-
batchCreatePartitions
public final BatchCreatePartitionsResponse batchCreatePartitions(BatchCreatePartitionsRequest request) Adds partitions to a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { BatchCreatePartitionsRequest request = BatchCreatePartitionsRequest.newBuilder() .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .addAllRequests(new ArrayList<CreatePartitionRequest>()) .setSkipExistingPartitions(true) .build(); BatchCreatePartitionsResponse response = hiveMetastoreServiceClient.batchCreatePartitions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchCreatePartitionsCallable
public final UnaryCallable<BatchCreatePartitionsRequest,BatchCreatePartitionsResponse> batchCreatePartitionsCallable()Adds partitions to a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { BatchCreatePartitionsRequest request = BatchCreatePartitionsRequest.newBuilder() .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .addAllRequests(new ArrayList<CreatePartitionRequest>()) .setSkipExistingPartitions(true) .build(); ApiFuture<BatchCreatePartitionsResponse> future = hiveMetastoreServiceClient.batchCreatePartitionsCallable().futureCall(request); // Do something. BatchCreatePartitionsResponse response = future.get(); } -
batchDeletePartitions
Deletes partitions from a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { TableName parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]"); hiveMetastoreServiceClient.batchDeletePartitions(parent); }- Parameters:
parent- Required. Reference to the table to which these partitions belong, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.- Throws:
ApiException- if the remote call fails
-
batchDeletePartitions
Deletes partitions from a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString(); hiveMetastoreServiceClient.batchDeletePartitions(parent); }- Parameters:
parent- Required. Reference to the table to which these partitions belong, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.- Throws:
ApiException- if the remote call fails
-
batchDeletePartitions
Deletes partitions from a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { BatchDeletePartitionsRequest request = BatchDeletePartitionsRequest.newBuilder() .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .addAllPartitionValues(new ArrayList<PartitionValues>()) .build(); hiveMetastoreServiceClient.batchDeletePartitions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchDeletePartitionsCallable
public final UnaryCallable<BatchDeletePartitionsRequest,com.google.protobuf.Empty> batchDeletePartitionsCallable()Deletes partitions from a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { BatchDeletePartitionsRequest request = BatchDeletePartitionsRequest.newBuilder() .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .addAllPartitionValues(new ArrayList<PartitionValues>()) .build(); ApiFuture<Empty> future = hiveMetastoreServiceClient.batchDeletePartitionsCallable().futureCall(request); // Do something. future.get(); } -
batchUpdatePartitions
Updates partitions in a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { TableName parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]"); BatchUpdatePartitionsResponse response = hiveMetastoreServiceClient.batchUpdatePartitions(parent); }- Parameters:
parent- Required. Reference to the table to which these partitions belong, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.- Throws:
ApiException- if the remote call fails
-
batchUpdatePartitions
Updates partitions in a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { String parent = TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString(); BatchUpdatePartitionsResponse response = hiveMetastoreServiceClient.batchUpdatePartitions(parent); }- Parameters:
parent- Required. Reference to the table to which these partitions belong, in the format of projects/{project}/catalogs/{catalogs}/databases/{database}/tables/{table}.- Throws:
ApiException- if the remote call fails
-
batchUpdatePartitions
public final BatchUpdatePartitionsResponse batchUpdatePartitions(BatchUpdatePartitionsRequest request) Updates partitions in a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { BatchUpdatePartitionsRequest request = BatchUpdatePartitionsRequest.newBuilder() .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .addAllRequests(new ArrayList<UpdatePartitionRequest>()) .build(); BatchUpdatePartitionsResponse response = hiveMetastoreServiceClient.batchUpdatePartitions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchUpdatePartitionsCallable
public final UnaryCallable<BatchUpdatePartitionsRequest,BatchUpdatePartitionsResponse> batchUpdatePartitionsCallable()Updates partitions in a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { BatchUpdatePartitionsRequest request = BatchUpdatePartitionsRequest.newBuilder() .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .addAllRequests(new ArrayList<UpdatePartitionRequest>()) .build(); ApiFuture<BatchUpdatePartitionsResponse> future = hiveMetastoreServiceClient.batchUpdatePartitionsCallable().futureCall(request); // Do something. BatchUpdatePartitionsResponse response = future.get(); } -
listPartitionsCallable
public final ServerStreamingCallable<ListPartitionsRequest,ListPartitionsResponse> listPartitionsCallable()Streams list of partitions from a table.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (HiveMetastoreServiceClient hiveMetastoreServiceClient = HiveMetastoreServiceClient.create()) { ListPartitionsRequest request = ListPartitionsRequest.newBuilder() .setParent(TableName.of("[PROJECT]", "[CATALOG]", "[DATABASE]", "[TABLE]").toString()) .setFilter("filter-1274492040") .build(); ServerStream<ListPartitionsResponse> stream = hiveMetastoreServiceClient.listPartitionsCallable().call(request); for (ListPartitionsResponse response : stream) { // Do something when a response is received. } } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-