@Generated(value="by gapic-generator-java") public class DataprocMetastoreClient extends Object implements com.google.api.gax.core.BackgroundResource
The Dataproc Metastore API defines the following resource model:
`/projects/{project_number}/locations/{location_id}/services/{service_id}`.
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
Service response = dataprocMetastoreClient.getService(name);
}
Note: close() needs to be called on the DataprocMetastoreClient 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 |
|---|---|---|
ListServices |
Lists services in a project and location. |
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.
|
GetService |
Gets the details of a single service. |
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.
|
CreateService |
Creates a metastore service in a project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateService |
Updates the parameters of a single service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteService |
Deletes a single service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListMetadataImports |
Lists imports in a service. |
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.
|
GetMetadataImport |
Gets details of a single import. |
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.
|
CreateMetadataImport |
Creates a new MetadataImport in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateMetadataImport |
Updates a single import. Only the description field of MetadataImport is supported to be updated. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportMetadata |
Exports metadata from a service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RestoreService |
Restores a service from a backup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListBackups |
Lists backups in a service. |
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.
|
GetBackup |
Gets details of a single backup. |
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.
|
CreateBackup |
Creates a new backup in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteBackup |
Deletes a single backup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
QueryMetadata |
Query DPMS metadata. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
MoveTableToDatabase |
Move a table to another database. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AlterMetadataResourceLocation |
Alter metadata resource location. The metadata resource can be a database, table, or partition. This functionality only updates the parent directory for the respective metadata resource and does not transfer any existing data to the new location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
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 DataprocMetastoreSettings 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
DataprocMetastoreSettings dataprocMetastoreSettings =
DataprocMetastoreSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DataprocMetastoreClient dataprocMetastoreClient =
DataprocMetastoreClient.create(dataprocMetastoreSettings);
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
DataprocMetastoreSettings dataprocMetastoreSettings =
DataprocMetastoreSettings.newBuilder().setEndpoint(myEndpoint).build();
DataprocMetastoreClient dataprocMetastoreClient =
DataprocMetastoreClient.create(dataprocMetastoreSettings);
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
DataprocMetastoreSettings dataprocMetastoreSettings =
DataprocMetastoreSettings.newHttpJsonBuilder().build();
DataprocMetastoreClient dataprocMetastoreClient =
DataprocMetastoreClient.create(dataprocMetastoreSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
DataprocMetastoreClient.ListBackupsFixedSizeCollection |
static class |
DataprocMetastoreClient.ListBackupsPage |
static class |
DataprocMetastoreClient.ListBackupsPagedResponse |
static class |
DataprocMetastoreClient.ListLocationsFixedSizeCollection |
static class |
DataprocMetastoreClient.ListLocationsPage |
static class |
DataprocMetastoreClient.ListLocationsPagedResponse |
static class |
DataprocMetastoreClient.ListMetadataImportsFixedSizeCollection |
static class |
DataprocMetastoreClient.ListMetadataImportsPage |
static class |
DataprocMetastoreClient.ListMetadataImportsPagedResponse |
static class |
DataprocMetastoreClient.ListServicesFixedSizeCollection |
static class |
DataprocMetastoreClient.ListServicesPage |
static class |
DataprocMetastoreClient.ListServicesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
DataprocMetastoreClient(DataprocMetastoreSettings settings)
Constructs an instance of DataprocMetastoreClient, using the given settings.
|
protected |
DataprocMetastoreClient(DataprocMetastoreStub stub) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.longrunning.OperationFuture<AlterMetadataResourceLocationResponse,OperationMetadata> |
alterMetadataResourceLocationAsync(AlterMetadataResourceLocationRequest request)
Alter metadata resource location.
|
com.google.api.gax.rpc.UnaryCallable<AlterMetadataResourceLocationRequest,com.google.longrunning.Operation> |
alterMetadataResourceLocationCallable()
Alter metadata resource location.
|
com.google.api.gax.rpc.OperationCallable<AlterMetadataResourceLocationRequest,AlterMetadataResourceLocationResponse,OperationMetadata> |
alterMetadataResourceLocationOperationCallable()
Alter metadata resource location.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DataprocMetastoreClient |
create()
Constructs an instance of DataprocMetastoreClient with default settings.
|
static DataprocMetastoreClient |
create(DataprocMetastoreSettings settings)
Constructs an instance of DataprocMetastoreClient, using the given settings.
|
static DataprocMetastoreClient |
create(DataprocMetastoreStub stub)
Constructs an instance of DataprocMetastoreClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> |
createBackupAsync(CreateBackupRequest request)
Creates a new backup in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> |
createBackupAsync(ServiceName parent,
Backup backup,
String backupId)
Creates a new backup in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> |
createBackupAsync(String parent,
Backup backup,
String backupId)
Creates a new backup in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateBackupRequest,com.google.longrunning.Operation> |
createBackupCallable()
Creates a new backup in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateBackupRequest,Backup,OperationMetadata> |
createBackupOperationCallable()
Creates a new backup in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> |
createMetadataImportAsync(CreateMetadataImportRequest request)
Creates a new MetadataImport in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> |
createMetadataImportAsync(ServiceName parent,
MetadataImport metadataImport,
String metadataImportId)
Creates a new MetadataImport in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> |
createMetadataImportAsync(String parent,
MetadataImport metadataImport,
String metadataImportId)
Creates a new MetadataImport in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateMetadataImportRequest,com.google.longrunning.Operation> |
createMetadataImportCallable()
Creates a new MetadataImport in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateMetadataImportRequest,MetadataImport,OperationMetadata> |
createMetadataImportOperationCallable()
Creates a new MetadataImport in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> |
createServiceAsync(CreateServiceRequest request)
Creates a metastore service in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> |
createServiceAsync(LocationName parent,
Service service,
String serviceId)
Creates a metastore service in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> |
createServiceAsync(String parent,
Service service,
String serviceId)
Creates a metastore service in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateServiceRequest,com.google.longrunning.Operation> |
createServiceCallable()
Creates a metastore service in a project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateServiceRequest,Service,OperationMetadata> |
createServiceOperationCallable()
Creates a metastore service in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteBackupAsync(BackupName name)
Deletes a single backup.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteBackupAsync(DeleteBackupRequest request)
Deletes a single backup.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteBackupAsync(String name)
Deletes a single backup.
|
com.google.api.gax.rpc.UnaryCallable<DeleteBackupRequest,com.google.longrunning.Operation> |
deleteBackupCallable()
Deletes a single backup.
|
com.google.api.gax.rpc.OperationCallable<DeleteBackupRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteBackupOperationCallable()
Deletes a single backup.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteServiceAsync(DeleteServiceRequest request)
Deletes a single service.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteServiceAsync(ServiceName name)
Deletes a single service.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteServiceAsync(String name)
Deletes a single service.
|
com.google.api.gax.rpc.UnaryCallable<DeleteServiceRequest,com.google.longrunning.Operation> |
deleteServiceCallable()
Deletes a single service.
|
com.google.api.gax.rpc.OperationCallable<DeleteServiceRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteServiceOperationCallable()
Deletes a single service.
|
com.google.api.gax.longrunning.OperationFuture<MetadataExport,OperationMetadata> |
exportMetadataAsync(ExportMetadataRequest request)
Exports metadata from a service.
|
com.google.api.gax.rpc.UnaryCallable<ExportMetadataRequest,com.google.longrunning.Operation> |
exportMetadataCallable()
Exports metadata from a service.
|
com.google.api.gax.rpc.OperationCallable<ExportMetadataRequest,MetadataExport,OperationMetadata> |
exportMetadataOperationCallable()
Exports metadata from a service.
|
Backup |
getBackup(BackupName name)
Gets details of a single backup.
|
Backup |
getBackup(GetBackupRequest request)
Gets details of a single backup.
|
Backup |
getBackup(String name)
Gets details of a single backup.
|
com.google.api.gax.rpc.UnaryCallable<GetBackupRequest,Backup> |
getBackupCallable()
Gets details of a single backup.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
MetadataImport |
getMetadataImport(GetMetadataImportRequest request)
Gets details of a single import.
|
MetadataImport |
getMetadataImport(MetadataImportName name)
Gets details of a single import.
|
MetadataImport |
getMetadataImport(String name)
Gets details of a single import.
|
com.google.api.gax.rpc.UnaryCallable<GetMetadataImportRequest,MetadataImport> |
getMetadataImportCallable()
Gets details of a single import.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
Service |
getService(GetServiceRequest request)
Gets the details of a single service.
|
Service |
getService(ServiceName name)
Gets the details of a single service.
|
Service |
getService(String name)
Gets the details of a single service.
|
com.google.api.gax.rpc.UnaryCallable<GetServiceRequest,Service> |
getServiceCallable()
Gets the details of a single service.
|
DataprocMetastoreSettings |
getSettings() |
DataprocMetastoreStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
DataprocMetastoreClient.ListBackupsPagedResponse |
listBackups(ListBackupsRequest request)
Lists backups in a service.
|
DataprocMetastoreClient.ListBackupsPagedResponse |
listBackups(ServiceName parent)
Lists backups in a service.
|
DataprocMetastoreClient.ListBackupsPagedResponse |
listBackups(String parent)
Lists backups in a service.
|
com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,ListBackupsResponse> |
listBackupsCallable()
Lists backups in a service.
|
com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,DataprocMetastoreClient.ListBackupsPagedResponse> |
listBackupsPagedCallable()
Lists backups in a service.
|
DataprocMetastoreClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,DataprocMetastoreClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
DataprocMetastoreClient.ListMetadataImportsPagedResponse |
listMetadataImports(ListMetadataImportsRequest request)
Lists imports in a service.
|
DataprocMetastoreClient.ListMetadataImportsPagedResponse |
listMetadataImports(ServiceName parent)
Lists imports in a service.
|
DataprocMetastoreClient.ListMetadataImportsPagedResponse |
listMetadataImports(String parent)
Lists imports in a service.
|
com.google.api.gax.rpc.UnaryCallable<ListMetadataImportsRequest,ListMetadataImportsResponse> |
listMetadataImportsCallable()
Lists imports in a service.
|
com.google.api.gax.rpc.UnaryCallable<ListMetadataImportsRequest,DataprocMetastoreClient.ListMetadataImportsPagedResponse> |
listMetadataImportsPagedCallable()
Lists imports in a service.
|
DataprocMetastoreClient.ListServicesPagedResponse |
listServices(ListServicesRequest request)
Lists services in a project and location.
|
DataprocMetastoreClient.ListServicesPagedResponse |
listServices(LocationName parent)
Lists services in a project and location.
|
DataprocMetastoreClient.ListServicesPagedResponse |
listServices(String parent)
Lists services in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,ListServicesResponse> |
listServicesCallable()
Lists services in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,DataprocMetastoreClient.ListServicesPagedResponse> |
listServicesPagedCallable()
Lists services in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<MoveTableToDatabaseResponse,OperationMetadata> |
moveTableToDatabaseAsync(MoveTableToDatabaseRequest request)
Move a table to another database.
|
com.google.api.gax.rpc.UnaryCallable<MoveTableToDatabaseRequest,com.google.longrunning.Operation> |
moveTableToDatabaseCallable()
Move a table to another database.
|
com.google.api.gax.rpc.OperationCallable<MoveTableToDatabaseRequest,MoveTableToDatabaseResponse,OperationMetadata> |
moveTableToDatabaseOperationCallable()
Move a table to another database.
|
com.google.api.gax.longrunning.OperationFuture<QueryMetadataResponse,OperationMetadata> |
queryMetadataAsync(QueryMetadataRequest request)
Query DPMS metadata.
|
com.google.api.gax.rpc.UnaryCallable<QueryMetadataRequest,com.google.longrunning.Operation> |
queryMetadataCallable()
Query DPMS metadata.
|
com.google.api.gax.rpc.OperationCallable<QueryMetadataRequest,QueryMetadataResponse,OperationMetadata> |
queryMetadataOperationCallable()
Query DPMS metadata.
|
com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> |
restoreServiceAsync(RestoreServiceRequest request)
Restores a service from a backup.
|
com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> |
restoreServiceAsync(ServiceName service,
BackupName backup)
Restores a service from a backup.
|
com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> |
restoreServiceAsync(ServiceName service,
String backup)
Restores a service from a backup.
|
com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> |
restoreServiceAsync(String service,
BackupName backup)
Restores a service from a backup.
|
com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> |
restoreServiceAsync(String service,
String backup)
Restores a service from a backup.
|
com.google.api.gax.rpc.UnaryCallable<RestoreServiceRequest,com.google.longrunning.Operation> |
restoreServiceCallable()
Restores a service from a backup.
|
com.google.api.gax.rpc.OperationCallable<RestoreServiceRequest,Restore,OperationMetadata> |
restoreServiceOperationCallable()
Restores a service from a backup.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> |
updateMetadataImportAsync(MetadataImport metadataImport,
com.google.protobuf.FieldMask updateMask)
Updates a single import.
|
com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> |
updateMetadataImportAsync(UpdateMetadataImportRequest request)
Updates a single import.
|
com.google.api.gax.rpc.UnaryCallable<UpdateMetadataImportRequest,com.google.longrunning.Operation> |
updateMetadataImportCallable()
Updates a single import.
|
com.google.api.gax.rpc.OperationCallable<UpdateMetadataImportRequest,MetadataImport,OperationMetadata> |
updateMetadataImportOperationCallable()
Updates a single import.
|
com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> |
updateServiceAsync(Service service,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single service.
|
com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> |
updateServiceAsync(UpdateServiceRequest request)
Updates the parameters of a single service.
|
com.google.api.gax.rpc.UnaryCallable<UpdateServiceRequest,com.google.longrunning.Operation> |
updateServiceCallable()
Updates the parameters of a single service.
|
com.google.api.gax.rpc.OperationCallable<UpdateServiceRequest,Service,OperationMetadata> |
updateServiceOperationCallable()
Updates the parameters of a single service.
|
protected DataprocMetastoreClient(DataprocMetastoreSettings settings) throws IOException
IOExceptionprotected DataprocMetastoreClient(DataprocMetastoreStub stub)
public static final DataprocMetastoreClient create() throws IOException
IOExceptionpublic static final DataprocMetastoreClient create(DataprocMetastoreSettings settings) throws IOException
IOExceptionpublic static final DataprocMetastoreClient create(DataprocMetastoreStub stub)
public final DataprocMetastoreSettings getSettings()
public DataprocMetastoreStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final DataprocMetastoreClient.ListServicesPagedResponse listServices(LocationName parent)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Service element : dataprocMetastoreClient.listServices(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The relative resource name of the location of metastore services to
list, in the following form:
`projects/{project_number}/locations/{location_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataprocMetastoreClient.ListServicesPagedResponse listServices(String parent)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Service element : dataprocMetastoreClient.listServices(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The relative resource name of the location of metastore services to
list, in the following form:
`projects/{project_number}/locations/{location_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataprocMetastoreClient.ListServicesPagedResponse listServices(ListServicesRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Service element : dataprocMetastoreClient.listServices(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,DataprocMetastoreClient.ListServicesPagedResponse> listServicesPagedCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Service> future =
dataprocMetastoreClient.listServicesPagedCallable().futureCall(request);
// Do something.
for (Service element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,ListServicesResponse> listServicesCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListServicesResponse response =
dataprocMetastoreClient.listServicesCallable().call(request);
for (Service element : response.getServicesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Service getService(ServiceName 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
Service response = dataprocMetastoreClient.getService(name);
}
name - Required. The relative resource name of the metastore service to retrieve, in the
following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Service getService(String 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String name = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
Service response = dataprocMetastoreClient.getService(name);
}
name - Required. The relative resource name of the metastore service to retrieve, in the
following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Service getService(GetServiceRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetServiceRequest request =
GetServiceRequest.newBuilder()
.setName(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.build();
Service response = dataprocMetastoreClient.getService(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetServiceRequest,Service> getServiceCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetServiceRequest request =
GetServiceRequest.newBuilder()
.setName(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.build();
ApiFuture<Service> future = dataprocMetastoreClient.getServiceCallable().futureCall(request);
// Do something.
Service response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> createServiceAsync(LocationName parent, Service service, String serviceId)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Service service = Service.newBuilder().build();
String serviceId = "serviceId-194185552";
Service response =
dataprocMetastoreClient.createServiceAsync(parent, service, serviceId).get();
}
parent - Required. The relative resource name of the location in which to create a
metastore service, in the following form:
`projects/{project_number}/locations/{location_id}`.
service - Required. The Metastore service to create. The `name` field is ignored. The ID
of the created metastore service must be provided in the request's `service_id` field.serviceId - Required. The ID of the metastore service, which is used as the final
component of the metastore service's name.
This value must be between 2 and 63 characters long inclusive, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> createServiceAsync(String parent, Service service, String serviceId)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Service service = Service.newBuilder().build();
String serviceId = "serviceId-194185552";
Service response =
dataprocMetastoreClient.createServiceAsync(parent, service, serviceId).get();
}
parent - Required. The relative resource name of the location in which to create a
metastore service, in the following form:
`projects/{project_number}/locations/{location_id}`.
service - Required. The Metastore service to create. The `name` field is ignored. The ID
of the created metastore service must be provided in the request's `service_id` field.serviceId - Required. The ID of the metastore service, which is used as the final
component of the metastore service's name.
This value must be between 2 and 63 characters long inclusive, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> createServiceAsync(CreateServiceRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateServiceRequest request =
CreateServiceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setServiceId("serviceId-194185552")
.setService(Service.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Service response = dataprocMetastoreClient.createServiceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateServiceRequest,Service,OperationMetadata> createServiceOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateServiceRequest request =
CreateServiceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setServiceId("serviceId-194185552")
.setService(Service.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Service, OperationMetadata> future =
dataprocMetastoreClient.createServiceOperationCallable().futureCall(request);
// Do something.
Service response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateServiceRequest,com.google.longrunning.Operation> createServiceCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateServiceRequest request =
CreateServiceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setServiceId("serviceId-194185552")
.setService(Service.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.createServiceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> updateServiceAsync(Service service, com.google.protobuf.FieldMask updateMask)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
Service service = Service.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Service response = dataprocMetastoreClient.updateServiceAsync(service, updateMask).get();
}
service - Required. The metastore service to update. The server only merges fields in the
service if they are specified in `update_mask`.
The metastore service's `name` field is used to identify the metastore service to be updated.
updateMask - Required. A field mask used to specify the fields to be overwritten in the
metastore service resource by the update. Fields specified in the `update_mask` are
relative to the resource (not to the full request). A field is overwritten if it is in the
mask.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Service,OperationMetadata> updateServiceAsync(UpdateServiceRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
UpdateServiceRequest request =
UpdateServiceRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setService(Service.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Service response = dataprocMetastoreClient.updateServiceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateServiceRequest,Service,OperationMetadata> updateServiceOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
UpdateServiceRequest request =
UpdateServiceRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setService(Service.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Service, OperationMetadata> future =
dataprocMetastoreClient.updateServiceOperationCallable().futureCall(request);
// Do something.
Service response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateServiceRequest,com.google.longrunning.Operation> updateServiceCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
UpdateServiceRequest request =
UpdateServiceRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setService(Service.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.updateServiceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(ServiceName 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
dataprocMetastoreClient.deleteServiceAsync(name).get();
}
name - Required. The relative resource name of the metastore service to delete, in the
following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(String 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String name = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
dataprocMetastoreClient.deleteServiceAsync(name).get();
}
name - Required. The relative resource name of the metastore service to delete, in the
following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(DeleteServiceRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
DeleteServiceRequest request =
DeleteServiceRequest.newBuilder()
.setName(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setRequestId("requestId693933066")
.build();
dataprocMetastoreClient.deleteServiceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteServiceRequest,com.google.protobuf.Empty,OperationMetadata> deleteServiceOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
DeleteServiceRequest request =
DeleteServiceRequest.newBuilder()
.setName(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
dataprocMetastoreClient.deleteServiceOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteServiceRequest,com.google.longrunning.Operation> deleteServiceCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
DeleteServiceRequest request =
DeleteServiceRequest.newBuilder()
.setName(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.deleteServiceCallable().futureCall(request);
// Do something.
future.get();
}
public final DataprocMetastoreClient.ListMetadataImportsPagedResponse listMetadataImports(ServiceName parent)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
for (MetadataImport element :
dataprocMetastoreClient.listMetadataImports(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The relative resource name of the service whose metadata imports to
list, in the following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataprocMetastoreClient.ListMetadataImportsPagedResponse listMetadataImports(String parent)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
for (MetadataImport element :
dataprocMetastoreClient.listMetadataImports(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The relative resource name of the service whose metadata imports to
list, in the following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataprocMetastoreClient.ListMetadataImportsPagedResponse listMetadataImports(ListMetadataImportsRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListMetadataImportsRequest request =
ListMetadataImportsRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (MetadataImport element :
dataprocMetastoreClient.listMetadataImports(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListMetadataImportsRequest,DataprocMetastoreClient.ListMetadataImportsPagedResponse> listMetadataImportsPagedCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListMetadataImportsRequest request =
ListMetadataImportsRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<MetadataImport> future =
dataprocMetastoreClient.listMetadataImportsPagedCallable().futureCall(request);
// Do something.
for (MetadataImport element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListMetadataImportsRequest,ListMetadataImportsResponse> listMetadataImportsCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListMetadataImportsRequest request =
ListMetadataImportsRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListMetadataImportsResponse response =
dataprocMetastoreClient.listMetadataImportsCallable().call(request);
for (MetadataImport element : response.getMetadataImportsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final MetadataImport getMetadataImport(MetadataImportName 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
MetadataImportName name =
MetadataImportName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[METADATA_IMPORT]");
MetadataImport response = dataprocMetastoreClient.getMetadataImport(name);
}
name - Required. The relative resource name of the metadata import to retrieve, in the
following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final MetadataImport getMetadataImport(String 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String name =
MetadataImportName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[METADATA_IMPORT]")
.toString();
MetadataImport response = dataprocMetastoreClient.getMetadataImport(name);
}
name - Required. The relative resource name of the metadata import to retrieve, in the
following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final MetadataImport getMetadataImport(GetMetadataImportRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetMetadataImportRequest request =
GetMetadataImportRequest.newBuilder()
.setName(
MetadataImportName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[METADATA_IMPORT]")
.toString())
.build();
MetadataImport response = dataprocMetastoreClient.getMetadataImport(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetMetadataImportRequest,MetadataImport> getMetadataImportCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetMetadataImportRequest request =
GetMetadataImportRequest.newBuilder()
.setName(
MetadataImportName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[METADATA_IMPORT]")
.toString())
.build();
ApiFuture<MetadataImport> future =
dataprocMetastoreClient.getMetadataImportCallable().futureCall(request);
// Do something.
MetadataImport response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> createMetadataImportAsync(ServiceName parent, MetadataImport metadataImport, String metadataImportId)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
MetadataImport metadataImport = MetadataImport.newBuilder().build();
String metadataImportId = "metadataImportId1824548847";
MetadataImport response =
dataprocMetastoreClient
.createMetadataImportAsync(parent, metadataImport, metadataImportId)
.get();
}
parent - Required. The relative resource name of the service in which to create a
metastore import, in the following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}`.
metadataImport - Required. The metadata import to create. The `name` field is ignored. The
ID of the created metadata import must be provided in the request's `metadata_import_id`
field.metadataImportId - Required. The ID of the metadata import, which is used as the final
component of the metadata import's name.
This value must be between 1 and 64 characters long, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> createMetadataImportAsync(String parent, MetadataImport metadataImport, String metadataImportId)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
MetadataImport metadataImport = MetadataImport.newBuilder().build();
String metadataImportId = "metadataImportId1824548847";
MetadataImport response =
dataprocMetastoreClient
.createMetadataImportAsync(parent, metadataImport, metadataImportId)
.get();
}
parent - Required. The relative resource name of the service in which to create a
metastore import, in the following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}`.
metadataImport - Required. The metadata import to create. The `name` field is ignored. The
ID of the created metadata import must be provided in the request's `metadata_import_id`
field.metadataImportId - Required. The ID of the metadata import, which is used as the final
component of the metadata import's name.
This value must be between 1 and 64 characters long, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> createMetadataImportAsync(CreateMetadataImportRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateMetadataImportRequest request =
CreateMetadataImportRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setMetadataImportId("metadataImportId1824548847")
.setMetadataImport(MetadataImport.newBuilder().build())
.setRequestId("requestId693933066")
.build();
MetadataImport response = dataprocMetastoreClient.createMetadataImportAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateMetadataImportRequest,MetadataImport,OperationMetadata> createMetadataImportOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateMetadataImportRequest request =
CreateMetadataImportRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setMetadataImportId("metadataImportId1824548847")
.setMetadataImport(MetadataImport.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<MetadataImport, OperationMetadata> future =
dataprocMetastoreClient.createMetadataImportOperationCallable().futureCall(request);
// Do something.
MetadataImport response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateMetadataImportRequest,com.google.longrunning.Operation> createMetadataImportCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateMetadataImportRequest request =
CreateMetadataImportRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setMetadataImportId("metadataImportId1824548847")
.setMetadataImport(MetadataImport.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.createMetadataImportCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> updateMetadataImportAsync(MetadataImport metadataImport, com.google.protobuf.FieldMask updateMask)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
MetadataImport metadataImport = MetadataImport.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
MetadataImport response =
dataprocMetastoreClient.updateMetadataImportAsync(metadataImport, updateMask).get();
}
metadataImport - Required. The metadata import to update. The server only merges fields in
the import if they are specified in `update_mask`.
The metadata import's `name` field is used to identify the metastore import to be updated.
updateMask - Required. A field mask used to specify the fields to be overwritten in the
metadata import resource by the update. Fields specified in the `update_mask` are relative
to the resource (not to the full request). A field is overwritten if it is in the mask.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<MetadataImport,OperationMetadata> updateMetadataImportAsync(UpdateMetadataImportRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
UpdateMetadataImportRequest request =
UpdateMetadataImportRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setMetadataImport(MetadataImport.newBuilder().build())
.setRequestId("requestId693933066")
.build();
MetadataImport response = dataprocMetastoreClient.updateMetadataImportAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateMetadataImportRequest,MetadataImport,OperationMetadata> updateMetadataImportOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
UpdateMetadataImportRequest request =
UpdateMetadataImportRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setMetadataImport(MetadataImport.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<MetadataImport, OperationMetadata> future =
dataprocMetastoreClient.updateMetadataImportOperationCallable().futureCall(request);
// Do something.
MetadataImport response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateMetadataImportRequest,com.google.longrunning.Operation> updateMetadataImportCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
UpdateMetadataImportRequest request =
UpdateMetadataImportRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setMetadataImport(MetadataImport.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.updateMetadataImportCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<MetadataExport,OperationMetadata> exportMetadataAsync(ExportMetadataRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ExportMetadataRequest request =
ExportMetadataRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setRequestId("requestId693933066")
.build();
MetadataExport response = dataprocMetastoreClient.exportMetadataAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ExportMetadataRequest,MetadataExport,OperationMetadata> exportMetadataOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ExportMetadataRequest request =
ExportMetadataRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<MetadataExport, OperationMetadata> future =
dataprocMetastoreClient.exportMetadataOperationCallable().futureCall(request);
// Do something.
MetadataExport response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ExportMetadataRequest,com.google.longrunning.Operation> exportMetadataCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ExportMetadataRequest request =
ExportMetadataRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.exportMetadataCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> restoreServiceAsync(ServiceName service, BackupName backup)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName service = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
BackupName backup = BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]");
Restore response = dataprocMetastoreClient.restoreServiceAsync(service, backup).get();
}
service - Required. The relative resource name of the metastore service to run restore, in
the following form:
`projects/{project_id}/locations/{location_id}/services/{service_id}`.
backup - Required. The relative resource name of the metastore service backup to restore
from, in the following form:
`projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> restoreServiceAsync(ServiceName service, String backup)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName service = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
String backup = BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString();
Restore response = dataprocMetastoreClient.restoreServiceAsync(service, backup).get();
}
service - Required. The relative resource name of the metastore service to run restore, in
the following form:
`projects/{project_id}/locations/{location_id}/services/{service_id}`.
backup - Required. The relative resource name of the metastore service backup to restore
from, in the following form:
`projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> restoreServiceAsync(String service, BackupName backup)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String service = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
BackupName backup = BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]");
Restore response = dataprocMetastoreClient.restoreServiceAsync(service, backup).get();
}
service - Required. The relative resource name of the metastore service to run restore, in
the following form:
`projects/{project_id}/locations/{location_id}/services/{service_id}`.
backup - Required. The relative resource name of the metastore service backup to restore
from, in the following form:
`projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> restoreServiceAsync(String service, String backup)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String service = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
String backup = BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString();
Restore response = dataprocMetastoreClient.restoreServiceAsync(service, backup).get();
}
service - Required. The relative resource name of the metastore service to run restore, in
the following form:
`projects/{project_id}/locations/{location_id}/services/{service_id}`.
backup - Required. The relative resource name of the metastore service backup to restore
from, in the following form:
`projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Restore,OperationMetadata> restoreServiceAsync(RestoreServiceRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
RestoreServiceRequest request =
RestoreServiceRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setBackup(
BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setRequestId("requestId693933066")
.build();
Restore response = dataprocMetastoreClient.restoreServiceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RestoreServiceRequest,Restore,OperationMetadata> restoreServiceOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
RestoreServiceRequest request =
RestoreServiceRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setBackup(
BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Restore, OperationMetadata> future =
dataprocMetastoreClient.restoreServiceOperationCallable().futureCall(request);
// Do something.
Restore response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RestoreServiceRequest,com.google.longrunning.Operation> restoreServiceCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
RestoreServiceRequest request =
RestoreServiceRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setBackup(
BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.restoreServiceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final DataprocMetastoreClient.ListBackupsPagedResponse listBackups(ServiceName parent)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
for (Backup element : dataprocMetastoreClient.listBackups(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The relative resource name of the service whose backups to list, in the
following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/backups`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataprocMetastoreClient.ListBackupsPagedResponse listBackups(String parent)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
for (Backup element : dataprocMetastoreClient.listBackups(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The relative resource name of the service whose backups to list, in the
following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/backups`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataprocMetastoreClient.ListBackupsPagedResponse listBackups(ListBackupsRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListBackupsRequest request =
ListBackupsRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Backup element : dataprocMetastoreClient.listBackups(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,DataprocMetastoreClient.ListBackupsPagedResponse> listBackupsPagedCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListBackupsRequest request =
ListBackupsRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Backup> future =
dataprocMetastoreClient.listBackupsPagedCallable().futureCall(request);
// Do something.
for (Backup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,ListBackupsResponse> listBackupsCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListBackupsRequest request =
ListBackupsRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListBackupsResponse response = dataprocMetastoreClient.listBackupsCallable().call(request);
for (Backup element : response.getBackupsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Backup getBackup(BackupName 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]");
Backup response = dataprocMetastoreClient.getBackup(name);
}
name - Required. The relative resource name of the backup to retrieve, in the following
form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Backup getBackup(String 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String name = BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString();
Backup response = dataprocMetastoreClient.getBackup(name);
}
name - Required. The relative resource name of the backup to retrieve, in the following
form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Backup getBackup(GetBackupRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetBackupRequest request =
GetBackupRequest.newBuilder()
.setName(BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.build();
Backup response = dataprocMetastoreClient.getBackup(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetBackupRequest,Backup> getBackupCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetBackupRequest request =
GetBackupRequest.newBuilder()
.setName(BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.build();
ApiFuture<Backup> future = dataprocMetastoreClient.getBackupCallable().futureCall(request);
// Do something.
Backup response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> createBackupAsync(ServiceName parent, Backup backup, String backupId)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]");
Backup backup = Backup.newBuilder().build();
String backupId = "backupId2121930365";
Backup response = dataprocMetastoreClient.createBackupAsync(parent, backup, backupId).get();
}
parent - Required. The relative resource name of the service in which to create a backup
of the following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}`.
backup - Required. The backup to create. The `name` field is ignored. The ID of the
created backup must be provided in the request's `backup_id` field.backupId - Required. The ID of the backup, which is used as the final component of the
backup's name.
This value must be between 1 and 64 characters long, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> createBackupAsync(String parent, Backup backup, String backupId)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString();
Backup backup = Backup.newBuilder().build();
String backupId = "backupId2121930365";
Backup response = dataprocMetastoreClient.createBackupAsync(parent, backup, backupId).get();
}
parent - Required. The relative resource name of the service in which to create a backup
of the following form:
`projects/{project_number}/locations/{location_id}/services/{service_id}`.
backup - Required. The backup to create. The `name` field is ignored. The ID of the
created backup must be provided in the request's `backup_id` field.backupId - Required. The ID of the backup, which is used as the final component of the
backup's name.
This value must be between 1 and 64 characters long, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> createBackupAsync(CreateBackupRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateBackupRequest request =
CreateBackupRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setBackupId("backupId2121930365")
.setBackup(Backup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Backup response = dataprocMetastoreClient.createBackupAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateBackupRequest,Backup,OperationMetadata> createBackupOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateBackupRequest request =
CreateBackupRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setBackupId("backupId2121930365")
.setBackup(Backup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Backup, OperationMetadata> future =
dataprocMetastoreClient.createBackupOperationCallable().futureCall(request);
// Do something.
Backup response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateBackupRequest,com.google.longrunning.Operation> createBackupCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
CreateBackupRequest request =
CreateBackupRequest.newBuilder()
.setParent(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setBackupId("backupId2121930365")
.setBackup(Backup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.createBackupCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupAsync(BackupName 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]");
dataprocMetastoreClient.deleteBackupAsync(name).get();
}
name - Required. The relative resource name of the backup to delete, in the following
form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupAsync(String 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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
String name = BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString();
dataprocMetastoreClient.deleteBackupAsync(name).get();
}
name - Required. The relative resource name of the backup to delete, in the following
form:
`projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupAsync(DeleteBackupRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
DeleteBackupRequest request =
DeleteBackupRequest.newBuilder()
.setName(BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setRequestId("requestId693933066")
.build();
dataprocMetastoreClient.deleteBackupAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteBackupRequest,com.google.protobuf.Empty,OperationMetadata> deleteBackupOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
DeleteBackupRequest request =
DeleteBackupRequest.newBuilder()
.setName(BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
dataprocMetastoreClient.deleteBackupOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteBackupRequest,com.google.longrunning.Operation> deleteBackupCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
DeleteBackupRequest request =
DeleteBackupRequest.newBuilder()
.setName(BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.deleteBackupCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<QueryMetadataResponse,OperationMetadata> queryMetadataAsync(QueryMetadataRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
QueryMetadataRequest request =
QueryMetadataRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setQuery("query107944136")
.build();
QueryMetadataResponse response = dataprocMetastoreClient.queryMetadataAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<QueryMetadataRequest,QueryMetadataResponse,OperationMetadata> queryMetadataOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
QueryMetadataRequest request =
QueryMetadataRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setQuery("query107944136")
.build();
OperationFuture<QueryMetadataResponse, OperationMetadata> future =
dataprocMetastoreClient.queryMetadataOperationCallable().futureCall(request);
// Do something.
QueryMetadataResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<QueryMetadataRequest,com.google.longrunning.Operation> queryMetadataCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
QueryMetadataRequest request =
QueryMetadataRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setQuery("query107944136")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.queryMetadataCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<MoveTableToDatabaseResponse,OperationMetadata> moveTableToDatabaseAsync(MoveTableToDatabaseRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
MoveTableToDatabaseRequest request =
MoveTableToDatabaseRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setTableName("tableName-1988717703")
.setDbName("dbName-1339126743")
.setDestinationDbName("destinationDbName-2077361705")
.build();
MoveTableToDatabaseResponse response =
dataprocMetastoreClient.moveTableToDatabaseAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<MoveTableToDatabaseRequest,MoveTableToDatabaseResponse,OperationMetadata> moveTableToDatabaseOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
MoveTableToDatabaseRequest request =
MoveTableToDatabaseRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setTableName("tableName-1988717703")
.setDbName("dbName-1339126743")
.setDestinationDbName("destinationDbName-2077361705")
.build();
OperationFuture<MoveTableToDatabaseResponse, OperationMetadata> future =
dataprocMetastoreClient.moveTableToDatabaseOperationCallable().futureCall(request);
// Do something.
MoveTableToDatabaseResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<MoveTableToDatabaseRequest,com.google.longrunning.Operation> moveTableToDatabaseCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
MoveTableToDatabaseRequest request =
MoveTableToDatabaseRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setTableName("tableName-1988717703")
.setDbName("dbName-1339126743")
.setDestinationDbName("destinationDbName-2077361705")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.moveTableToDatabaseCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<AlterMetadataResourceLocationResponse,OperationMetadata> alterMetadataResourceLocationAsync(AlterMetadataResourceLocationRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
AlterMetadataResourceLocationRequest request =
AlterMetadataResourceLocationRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setResourceName("resourceName-384566343")
.setLocationUri("locationUri552310135")
.build();
AlterMetadataResourceLocationResponse response =
dataprocMetastoreClient.alterMetadataResourceLocationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AlterMetadataResourceLocationRequest,AlterMetadataResourceLocationResponse,OperationMetadata> alterMetadataResourceLocationOperationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
AlterMetadataResourceLocationRequest request =
AlterMetadataResourceLocationRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setResourceName("resourceName-384566343")
.setLocationUri("locationUri552310135")
.build();
OperationFuture<AlterMetadataResourceLocationResponse, OperationMetadata> future =
dataprocMetastoreClient
.alterMetadataResourceLocationOperationCallable()
.futureCall(request);
// Do something.
AlterMetadataResourceLocationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AlterMetadataResourceLocationRequest,com.google.longrunning.Operation> alterMetadataResourceLocationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
AlterMetadataResourceLocationRequest request =
AlterMetadataResourceLocationRequest.newBuilder()
.setService(ServiceName.of("[PROJECT]", "[LOCATION]", "[SERVICE]").toString())
.setResourceName("resourceName-384566343")
.setLocationUri("locationUri552310135")
.build();
ApiFuture<Operation> future =
dataprocMetastoreClient.alterMetadataResourceLocationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final DataprocMetastoreClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : dataprocMetastoreClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,DataprocMetastoreClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
dataprocMetastoreClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
dataprocMetastoreClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = dataprocMetastoreClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
dataprocMetastoreClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = dataprocMetastoreClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = dataprocMetastoreClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = dataprocMetastoreClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
BackupName.of("[PROJECT]", "[LOCATION]", "[SERVICE]", "[BACKUP]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = dataprocMetastoreClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = dataprocMetastoreClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
dataprocMetastoreClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.