@Generated public class MetastoresAPI extends Object
Each metastore is configured with a root storage location in a cloud storage account. This storage location is used for metadata and managed tables data.
NOTE: This metastore is distinct from the metastore included in Databricks workspaces created before Unity Catalog was released. If your workspace includes a legacy Hive metastore, the data in that metastore is available in a catalog named hive_metastore.
Constructor and Description |
---|
MetastoresAPI(ApiClient apiClient)
Regular-use constructor
|
MetastoresAPI(MetastoresService mock)
Constructor for mocks
|
Modifier and Type | Method and Description |
---|---|
void |
assign(CreateMetastoreAssignment request)
Create an assignment.
|
void |
assign(long workspaceId,
String metastoreId,
String defaultCatalogName) |
MetastoreInfo |
create(CreateMetastore request)
Create a metastore.
|
MetastoreInfo |
create(String name) |
MetastoreAssignment |
current()
Get metastore assignment for workspace.
|
void |
delete(DeleteMetastoreRequest request)
Delete a metastore.
|
void |
delete(String id) |
UpdatePredictiveOptimizationResponse |
enableOptimization(String metastoreId,
boolean enable) |
UpdatePredictiveOptimizationResponse |
enableOptimization(UpdatePredictiveOptimization request)
Toggle predictive optimization on the metastore.
|
MetastoreInfo |
get(GetMetastoreRequest request)
Get a metastore.
|
MetastoreInfo |
get(String id) |
MetastoresService |
impl() |
Iterable<MetastoreInfo> |
list()
List metastores.
|
GetMetastoreSummaryResponse |
summary()
Get a metastore summary.
|
void |
unassign(long workspaceId,
String metastoreId) |
void |
unassign(UnassignRequest request)
Delete an assignment.
|
MetastoreInfo |
update(String id) |
MetastoreInfo |
update(UpdateMetastore request)
Update a metastore.
|
void |
updateAssignment(long workspaceId) |
void |
updateAssignment(UpdateMetastoreAssignment request)
Update an assignment.
|
public MetastoresAPI(ApiClient apiClient)
public MetastoresAPI(MetastoresService mock)
public void assign(CreateMetastoreAssignment request)
Creates a new metastore assignment. If an assignment for the same __workspace_id__ exists, it will be overwritten by the new __metastore_id__ and __default_catalog_name__. The caller must be an account admin.
public MetastoreInfo create(String name)
public MetastoreInfo create(CreateMetastore request)
Creates a new metastore based on a provided name and optional storage root path. By default (if the __owner__ field is not set), the owner of the new metastore is the user calling the __createMetastore__ API. If the __owner__ field is set to the empty string (**""**), the ownership is assigned to the System User instead.
public MetastoreAssignment current()
Gets the metastore assignment for the workspace being accessed.
public void delete(String id)
public void delete(DeleteMetastoreRequest request)
Deletes a metastore. The caller must be a metastore admin.
public UpdatePredictiveOptimizationResponse enableOptimization(String metastoreId, boolean enable)
public UpdatePredictiveOptimizationResponse enableOptimization(UpdatePredictiveOptimization request)
Enables or disables predictive optimization on the metastore.
public MetastoreInfo get(String id)
public MetastoreInfo get(GetMetastoreRequest request)
Gets a metastore that matches the supplied ID. The caller must be a metastore admin to retrieve this info.
public Iterable<MetastoreInfo> list()
Gets an array of the available metastores (as __MetastoreInfo__ objects). The caller must be an admin to retrieve this info. There is no guarantee of a specific ordering of the elements in the array.
public GetMetastoreSummaryResponse summary()
Gets information about a metastore. This summary includes the storage credential, the cloud vendor, the cloud region, and the global metastore ID.
public void unassign(long workspaceId, String metastoreId)
public void unassign(UnassignRequest request)
Deletes a metastore assignment. The caller must be an account administrator.
public MetastoreInfo update(String id)
public MetastoreInfo update(UpdateMetastore request)
Updates information for a specific metastore. The caller must be a metastore admin. If the __owner__ field is set to the empty string (**""**), the ownership is updated to the System User.
public void updateAssignment(long workspaceId)
public void updateAssignment(UpdateMetastoreAssignment request)
Updates a metastore assignment. This operation can be used to update __metastore_id__ or __default_catalog_name__ for a specified Workspace, if the Workspace is already assigned a metastore. The caller must be an account admin to update __metastore_id__; otherwise, the caller can be a Workspace admin.
public MetastoresService impl()
Copyright © 2023. All rights reserved.