Class DataprocMetastoreFederationClient (2.15.0)

public class DataprocMetastoreFederationClient implements BackgroundResource

Service Description: Configures and manages metastore federation services. Dataproc Metastore Federation Service allows federating a collection of backend metastores like BigQuery, Dataplex Lakes, and other Dataproc Metastores. The Federation Service exposes a gRPC URL through which metadata from the backend metastores are served at query time.

The Dataproc Metastore Federation API defines the following resource model:

  • The service works with a collection of Google Cloud projects.
  • Each project has a collection of available locations.
  • Each location has a collection of federations.
  • Dataproc Metastore Federations are resources with names of the form: projects/{project_number}/locations/{location_id}/federations/{federation_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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   FederationName name = FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]");
   Federation response = dataprocMetastoreFederationClient.getFederation(name);
 }
 

Note: close() needs to be called on the DataprocMetastoreFederationClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns 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 DataprocMetastoreFederationSettings 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
 DataprocMetastoreFederationSettings dataprocMetastoreFederationSettings =
     DataprocMetastoreFederationSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create(dataprocMetastoreFederationSettings);
 

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
 DataprocMetastoreFederationSettings dataprocMetastoreFederationSettings =
     DataprocMetastoreFederationSettings.newBuilder().setEndpoint(myEndpoint).build();
 DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create(dataprocMetastoreFederationSettings);
 

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
 DataprocMetastoreFederationSettings dataprocMetastoreFederationSettings =
     DataprocMetastoreFederationSettings.newHttpJsonBuilder().build();
 DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create(dataprocMetastoreFederationSettings);
 

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

Inheritance

java.lang.Object > DataprocMetastoreFederationClient

Implements

BackgroundResource

Static Methods

create()

public static final DataprocMetastoreFederationClient create()

Constructs an instance of DataprocMetastoreFederationClient with default settings.

Returns
TypeDescription
DataprocMetastoreFederationClient
Exceptions
TypeDescription
IOException

create(DataprocMetastoreFederationSettings settings)

public static final DataprocMetastoreFederationClient create(DataprocMetastoreFederationSettings settings)

Constructs an instance of DataprocMetastoreFederationClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsDataprocMetastoreFederationSettings
Returns
TypeDescription
DataprocMetastoreFederationClient
Exceptions
TypeDescription
IOException

create(DataprocMetastoreFederationStub stub)

public static final DataprocMetastoreFederationClient create(DataprocMetastoreFederationStub stub)

Constructs an instance of DataprocMetastoreFederationClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataprocMetastoreFederationSettings).

Parameter
NameDescription
stubDataprocMetastoreFederationStub
Returns
TypeDescription
DataprocMetastoreFederationClient

Constructors

DataprocMetastoreFederationClient(DataprocMetastoreFederationSettings settings)

protected DataprocMetastoreFederationClient(DataprocMetastoreFederationSettings settings)

Constructs an instance of DataprocMetastoreFederationClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsDataprocMetastoreFederationSettings

DataprocMetastoreFederationClient(DataprocMetastoreFederationStub stub)

protected DataprocMetastoreFederationClient(DataprocMetastoreFederationStub stub)
Parameter
NameDescription
stubDataprocMetastoreFederationStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createFederationAsync(CreateFederationRequest request)

public final OperationFuture<Federation,OperationMetadata> createFederationAsync(CreateFederationRequest request)

Creates a metastore federation in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   CreateFederationRequest request =
       CreateFederationRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFederationId("federationId-735921218")
           .setFederation(Federation.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Federation response = dataprocMetastoreFederationClient.createFederationAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateFederationRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Federation,OperationMetadata>

createFederationAsync(LocationName parent, Federation federation, String federationId)

public final OperationFuture<Federation,OperationMetadata> createFederationAsync(LocationName parent, Federation federation, String federationId)

Creates a metastore federation in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Federation federation = Federation.newBuilder().build();
   String federationId = "federationId-735921218";
   Federation response =
       dataprocMetastoreFederationClient
           .createFederationAsync(parent, federation, federationId)
           .get();
 }
 
Parameters
NameDescription
parentLocationName

Required. The relative resource name of the location in which to create a federation service, in the following form:

projects/{project_number}/locations/{location_id}.

federationFederation

Required. The Metastore Federation to create. The name field is ignored. The ID of the created metastore federation must be provided in the request's federation_id field.

federationIdString

Required. The ID of the metastore federation, which is used as the final component of the metastore federation'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.

Returns
TypeDescription
OperationFuture<Federation,OperationMetadata>

createFederationAsync(String parent, Federation federation, String federationId)

public final OperationFuture<Federation,OperationMetadata> createFederationAsync(String parent, Federation federation, String federationId)

Creates a metastore federation in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Federation federation = Federation.newBuilder().build();
   String federationId = "federationId-735921218";
   Federation response =
       dataprocMetastoreFederationClient
           .createFederationAsync(parent, federation, federationId)
           .get();
 }
 
Parameters
NameDescription
parentString

Required. The relative resource name of the location in which to create a federation service, in the following form:

projects/{project_number}/locations/{location_id}.

federationFederation

Required. The Metastore Federation to create. The name field is ignored. The ID of the created metastore federation must be provided in the request's federation_id field.

federationIdString

Required. The ID of the metastore federation, which is used as the final component of the metastore federation'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.

Returns
TypeDescription
OperationFuture<Federation,OperationMetadata>

createFederationCallable()

public final UnaryCallable<CreateFederationRequest,Operation> createFederationCallable()

Creates a metastore federation in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   CreateFederationRequest request =
       CreateFederationRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFederationId("federationId-735921218")
           .setFederation(Federation.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       dataprocMetastoreFederationClient.createFederationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateFederationRequest,Operation>

createFederationOperationCallable()

public final OperationCallable<CreateFederationRequest,Federation,OperationMetadata> createFederationOperationCallable()

Creates a metastore federation in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   CreateFederationRequest request =
       CreateFederationRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFederationId("federationId-735921218")
           .setFederation(Federation.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Federation, OperationMetadata> future =
       dataprocMetastoreFederationClient.createFederationOperationCallable().futureCall(request);
   // Do something.
   Federation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<CreateFederationRequest,Federation,OperationMetadata>

deleteFederationAsync(DeleteFederationRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteFederationAsync(DeleteFederationRequest request)

Deletes a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   DeleteFederationRequest request =
       DeleteFederationRequest.newBuilder()
           .setName(FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString())
           .setRequestId("requestId693933066")
           .build();
   dataprocMetastoreFederationClient.deleteFederationAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteFederationRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteFederationAsync(FederationName name)

public final OperationFuture<Empty,OperationMetadata> deleteFederationAsync(FederationName name)

Deletes a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   FederationName name = FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]");
   dataprocMetastoreFederationClient.deleteFederationAsync(name).get();
 }
 
Parameter
NameDescription
nameFederationName

Required. The relative resource name of the metastore federation to delete, in the following form:

projects/{project_number}/locations/{location_id}/federations/{federation_id}.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteFederationAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteFederationAsync(String name)

Deletes a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   String name = FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString();
   dataprocMetastoreFederationClient.deleteFederationAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The relative resource name of the metastore federation to delete, in the following form:

projects/{project_number}/locations/{location_id}/federations/{federation_id}.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteFederationCallable()

public final UnaryCallable<DeleteFederationRequest,Operation> deleteFederationCallable()

Deletes a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   DeleteFederationRequest request =
       DeleteFederationRequest.newBuilder()
           .setName(FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       dataprocMetastoreFederationClient.deleteFederationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteFederationRequest,Operation>

deleteFederationOperationCallable()

public final OperationCallable<DeleteFederationRequest,Empty,OperationMetadata> deleteFederationOperationCallable()

Deletes a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   DeleteFederationRequest request =
       DeleteFederationRequest.newBuilder()
           .setName(FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       dataprocMetastoreFederationClient.deleteFederationOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteFederationRequest,Empty,OperationMetadata>

getFederation(FederationName name)

public final Federation getFederation(FederationName name)

Gets the details of a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   FederationName name = FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]");
   Federation response = dataprocMetastoreFederationClient.getFederation(name);
 }
 
Parameter
NameDescription
nameFederationName

Required. The relative resource name of the metastore federation to retrieve, in the following form:

projects/{project_number}/locations/{location_id}/federations/{federation_id}.

Returns
TypeDescription
Federation

getFederation(GetFederationRequest request)

public final Federation getFederation(GetFederationRequest request)

Gets the details of a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   GetFederationRequest request =
       GetFederationRequest.newBuilder()
           .setName(FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString())
           .build();
   Federation response = dataprocMetastoreFederationClient.getFederation(request);
 }
 
Parameter
NameDescription
requestGetFederationRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Federation

getFederation(String name)

public final Federation getFederation(String name)

Gets the details of a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   String name = FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString();
   Federation response = dataprocMetastoreFederationClient.getFederation(name);
 }
 
Parameter
NameDescription
nameString

Required. The relative resource name of the metastore federation to retrieve, in the following form:

projects/{project_number}/locations/{location_id}/federations/{federation_id}.

Returns
TypeDescription
Federation

getFederationCallable()

public final UnaryCallable<GetFederationRequest,Federation> getFederationCallable()

Gets the details of a single federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   GetFederationRequest request =
       GetFederationRequest.newBuilder()
           .setName(FederationName.of("[PROJECT]", "[LOCATION]", "[FEDERATION]").toString())
           .build();
   ApiFuture<Federation> future =
       dataprocMetastoreFederationClient.getFederationCallable().futureCall(request);
   // Do something.
   Federation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetFederationRequest,Federation>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getSettings()

public final DataprocMetastoreFederationSettings getSettings()
Returns
TypeDescription
DataprocMetastoreFederationSettings

getStub()

public DataprocMetastoreFederationStub getStub()
Returns
TypeDescription
DataprocMetastoreFederationStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listFederations(ListFederationsRequest request)

public final DataprocMetastoreFederationClient.ListFederationsPagedResponse listFederations(ListFederationsRequest request)

Lists federations in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   ListFederationsRequest request =
       ListFederationsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Federation element :
       dataprocMetastoreFederationClient.listFederations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListFederationsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DataprocMetastoreFederationClient.ListFederationsPagedResponse

listFederations(LocationName parent)

public final DataprocMetastoreFederationClient.ListFederationsPagedResponse listFederations(LocationName parent)

Lists federations in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Federation element :
       dataprocMetastoreFederationClient.listFederations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The relative resource name of the location of metastore federations to list, in the following form: projects/{project_number}/locations/{location_id}.

Returns
TypeDescription
DataprocMetastoreFederationClient.ListFederationsPagedResponse

listFederations(String parent)

public final DataprocMetastoreFederationClient.ListFederationsPagedResponse listFederations(String parent)

Lists federations in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Federation element :
       dataprocMetastoreFederationClient.listFederations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The relative resource name of the location of metastore federations to list, in the following form: projects/{project_number}/locations/{location_id}.

Returns
TypeDescription
DataprocMetastoreFederationClient.ListFederationsPagedResponse

listFederationsCallable()

public final UnaryCallable<ListFederationsRequest,ListFederationsResponse> listFederationsCallable()

Lists federations in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   ListFederationsRequest request =
       ListFederationsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListFederationsResponse response =
         dataprocMetastoreFederationClient.listFederationsCallable().call(request);
     for (Federation element : response.getFederationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListFederationsRequest,ListFederationsResponse>

listFederationsPagedCallable()

public final UnaryCallable<ListFederationsRequest,DataprocMetastoreFederationClient.ListFederationsPagedResponse> listFederationsPagedCallable()

Lists federations in a project and location.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   ListFederationsRequest request =
       ListFederationsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Federation> future =
       dataprocMetastoreFederationClient.listFederationsPagedCallable().futureCall(request);
   // Do something.
   for (Federation element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListFederationsRequest,ListFederationsPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateFederationAsync(Federation federation, FieldMask updateMask)

public final OperationFuture<Federation,OperationMetadata> updateFederationAsync(Federation federation, FieldMask updateMask)

Updates the fields of a federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   Federation federation = Federation.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Federation response =
       dataprocMetastoreFederationClient.updateFederationAsync(federation, updateMask).get();
 }
 
Parameters
NameDescription
federationFederation

Required. The metastore federation to update. The server only merges fields in the service if they are specified in update_mask.

The metastore federation's name field is used to identify the metastore service to be updated.

updateMaskFieldMask

Required. A field mask used to specify the fields to be overwritten in the metastore federation 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.

Returns
TypeDescription
OperationFuture<Federation,OperationMetadata>

updateFederationAsync(UpdateFederationRequest request)

public final OperationFuture<Federation,OperationMetadata> updateFederationAsync(UpdateFederationRequest request)

Updates the fields of a federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   UpdateFederationRequest request =
       UpdateFederationRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setFederation(Federation.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Federation response = dataprocMetastoreFederationClient.updateFederationAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateFederationRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Federation,OperationMetadata>

updateFederationCallable()

public final UnaryCallable<UpdateFederationRequest,Operation> updateFederationCallable()

Updates the fields of a federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   UpdateFederationRequest request =
       UpdateFederationRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setFederation(Federation.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       dataprocMetastoreFederationClient.updateFederationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateFederationRequest,Operation>

updateFederationOperationCallable()

public final OperationCallable<UpdateFederationRequest,Federation,OperationMetadata> updateFederationOperationCallable()

Updates the fields of a federation.

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 (DataprocMetastoreFederationClient dataprocMetastoreFederationClient =
     DataprocMetastoreFederationClient.create()) {
   UpdateFederationRequest request =
       UpdateFederationRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setFederation(Federation.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Federation, OperationMetadata> future =
       dataprocMetastoreFederationClient.updateFederationOperationCallable().futureCall(request);
   // Do something.
   Federation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateFederationRequest,Federation,OperationMetadata>