Package org.apache.gravitino.client
Class GravitinoMetalake
java.lang.Object
org.apache.gravitino.dto.MetalakeDTO
org.apache.gravitino.client.GravitinoMetalake
- All Implemented Interfaces:
Auditable,SupportsRoles,SupportsJobs,Metalake,PolicyOperations,SupportsCatalogs,TagOperations
public class GravitinoMetalake
extends MetalakeDTO
implements SupportsCatalogs, TagOperations, SupportsRoles, SupportsJobs, PolicyOperations
Apache Gravitino Metalake is the top-level metadata repository for users. It contains a list of
catalogs as sub-level metadata collections. With
GravitinoMetalake, users can list,
create, load, alter and drop a catalog with specified identifier.-
Field Summary
Fields inherited from interface org.apache.gravitino.Metalake
PROPERTY_IN_USE -
Method Summary
Modifier and TypeMethodDescriptionAdds a new Group.Adds a new User.alterCatalog(String catalogName, CatalogChange... changes) Alter the catalog with specified identifier by applying the changes.alterPolicy(String name, PolicyChange... changes) Alter a policy under the current metalake by applying the changes.Alter a tag under the current metalake.static org.apache.gravitino.client.GravitinoMetalake.Builderbuilder()Cancel a job by its ID.createCatalog(String catalogName, Catalog.Type type, String provider, String comment, Map<String, String> properties) Create a new catalog with specified identifier, type, comment and properties.createPolicy(String name, String type, String comment, boolean enabled, PolicyContent content) Create a new policy under the current metalake.createRole(String role, Map<String, String> properties, List<SecurableObject> securableObjects) Creates a new Role.Create a tag under the current metalake.booleandeleteJobTemplate(String jobTemplateName) Deletes a job template by its name.booleandeletePolicy(String name) Deletes a policy under the current metalake.booleandeleteRole(String role) Deletes a Role.booleanDelete a tag under the current metalake.voiddisableCatalog(String catalogName) Disable a catalog.voiddisablePolicy(String name) Disable a policy under the current metalake.booleandropCatalog(String catalogName, boolean force) Drop a catalog with specified name.voidenableCatalog(String catalogName) Enable a catalog.voidenablePolicy(String name) Enable a policy under the current metalake.booleanGets a Group.Retrieves a job by its ID.getJobTemplate(String jobTemplateName) Retrieves a job template by its name.getOwner(MetadataObject object) Get the owner of a metadata object.Get a policy by its name under the current metalake.Gets a Role.Get a tag by its name under the current metalake.Gets a User.grantPrivilegesToRole(String role, MetadataObject object, List<Privilege> privileges) Grant privileges to a role.grantPrivilegesToRole(String role, MetadataObject object, Set<Privilege> privileges) Grant privileges to a role.grantRolesToGroup(List<String> roles, String group) Grant roles to a group.grantRolesToUser(List<String> roles, String user) Grant roles to a user.String[]List all the role names associated with this metadata object.String[]List all the catalogs under this metalake.Catalog[]List all the catalogs with their information under this metalake.String[]Lists the group namesGroup[]Lists the groupslistJobs()Lists all the jobs in Gravitino.Lists all the jobs by the specified job template name.Lists all the registered job templates in Gravitino.String[]List all the policies under the current metalake.Policy[]List all the policies with detailed information under the current metalake.String[]Lists the role names.String[]listTags()List all the tag names under a metalake.Tag[]List all the tags with detailed information under the current metalake.String[]Lists the usernames.User[]Lists the users.loadCatalog(String catalogName) Load the catalog with specified identifier.voidregisterJobTemplate(JobTemplate jobTemplate) Register a job template with the specified job template to Gravitino.booleanremoveGroup(String group) Removes a Group.booleanremoveUser(String user) Removes a User.revokePrivilegesFromRole(String role, MetadataObject object, List<Privilege> privileges) Deprecated.revokePrivilegesFromRole(String role, MetadataObject object, Set<Privilege> privileges) Revoke privileges from a role.revokeRolesFromGroup(List<String> roles, String group) Revoke roles from a group.revokeRolesFromUser(List<String> roles, String user) Revoke roles from a user.Run a job with the template name and configuration.voidsetOwner(MetadataObject object, String ownerName, Owner.Type ownerType) Set the owner of a metadata object.voidtestConnection(String catalogName, Catalog.Type type, String provider, String comment, Map<String, String> properties) Test whether a catalog can be created successfully with the specified parameters, without actually creating it.Methods inherited from class org.apache.gravitino.dto.MetalakeDTO
auditInfo, comment, hashCode, name, propertiesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.gravitino.SupportsCatalogs
catalogExists, createCatalog, dropCatalog
-
Method Details
-
listCatalogs
List all the catalogs under this metalake.- Specified by:
listCatalogsin interfaceSupportsCatalogs- Returns:
- A list of the catalog names under the current metalake.
- Throws:
NoSuchMetalakeException- If the metalake does not exist.
-
listCatalogsInfo
List all the catalogs with their information under this metalake.- Specified by:
listCatalogsInfoin interfaceSupportsCatalogs- Returns:
- A list of
Catalogunder the specified namespace. - Throws:
NoSuchMetalakeException- if the metalake with specified namespace does not exist.
-
loadCatalog
Load the catalog with specified identifier.- Specified by:
loadCatalogin interfaceSupportsCatalogs- Parameters:
catalogName- The identifier of the catalog to load.- Returns:
- The
Catalogwith specified identifier. - Throws:
NoSuchCatalogException- if the catalog with specified identifier does not exist.
-
createCatalog
public Catalog createCatalog(String catalogName, Catalog.Type type, String provider, String comment, Map<String, String> properties) throws NoSuchMetalakeException, CatalogAlreadyExistsExceptionCreate a new catalog with specified identifier, type, comment and properties.- Specified by:
createCatalogin interfaceSupportsCatalogs- Parameters:
catalogName- The identifier of the catalog.type- The type of the catalog.provider- The provider of the catalog.comment- The comment of the catalog.properties- The properties of the catalog.- Returns:
- The created
Catalog. - Throws:
NoSuchMetalakeException- if the metalake with specified namespace does not exist.CatalogAlreadyExistsException- if the catalog with specified identifier already exists.
-
alterCatalog
public Catalog alterCatalog(String catalogName, CatalogChange... changes) throws NoSuchCatalogException, IllegalArgumentException Alter the catalog with specified identifier by applying the changes.- Specified by:
alterCatalogin interfaceSupportsCatalogs- Parameters:
catalogName- the identifier of the catalog.changes- the changes to apply to the catalog.- Returns:
- the altered
Catalog. - Throws:
NoSuchCatalogException- if the catalog with specified identifier does not exist.IllegalArgumentException- if the changes are invalid.
-
dropCatalog
public boolean dropCatalog(String catalogName, boolean force) throws NonEmptyEntityException, CatalogInUseException Drop a catalog with specified name. If the force flag is true, it will:- Cascade drop all sub-entities (schemas, tables, etc.) of the catalog in Gravitino store.
- Drop the catalog even if it is in use.
- External resources (e.g. database, table, etc.) associated with sub-entities will not be dropped unless it is managed (such as managed fileset).
- Specified by:
dropCatalogin interfaceSupportsCatalogs- Parameters:
catalogName- The identifier of the catalog.force- Whether to force the drop.- Returns:
- True if the catalog was dropped, false if the catalog does not exist.
- Throws:
NonEmptyEntityException- If the catalog is not empty and force is false.CatalogInUseException- If the catalog is in use and force is false.
-
enableCatalog
Description copied from interface:SupportsCatalogsEnable a catalog. If the catalog is already enabled, this method does nothing.- Specified by:
enableCatalogin interfaceSupportsCatalogs- Parameters:
catalogName- The identifier of the catalog.- Throws:
NoSuchCatalogException- If the catalog does not exist.
-
disableCatalog
Description copied from interface:SupportsCatalogsDisable a catalog. If the catalog is already disabled, this method does nothing. Once a catalog is disabled:- It can only be listed, loaded, dropped, or disable.
- Any other operations on the catalog will throw an
CatalogNotInUseException. - Any operation on the sub-entities (schemas, tables, etc.) will throw an
CatalogNotInUseException.
- Specified by:
disableCatalogin interfaceSupportsCatalogs- Parameters:
catalogName- The identifier of the catalog.- Throws:
NoSuchCatalogException- If the catalog does not exist.
-
testConnection
public void testConnection(String catalogName, Catalog.Type type, String provider, String comment, Map<String, String> properties) throws ExceptionTest whether a catalog can be created successfully with the specified parameters, without actually creating it.- Specified by:
testConnectionin interfaceSupportsCatalogs- Parameters:
catalogName- the name of the catalog.type- the type of the catalog.provider- the provider of the catalog.comment- the comment of the catalog.properties- the properties of the catalog.- Throws:
Exception- if the test failed.
-
supportsRoles
- Specified by:
supportsRolesin interfaceMetalake- Returns:
- the
SupportsRolesif the metalake supports role operations.
-
listTags
List all the tag names under a metalake.- Specified by:
listTagsin interfaceTagOperations- Returns:
- A list of the tag names under the current metalake.
- Throws:
NoSuchMetalakeException- If the metalake does not exist.
-
listTagsInfo
List all the tags with detailed information under the current metalake.- Specified by:
listTagsInfoin interfaceTagOperations- Returns:
- A list of
Tagunder the current metalake. - Throws:
NoSuchMetalakeException- If the metalake does not exist.
-
getTag
Get a tag by its name under the current metalake.- Specified by:
getTagin interfaceTagOperations- Parameters:
name- The name of the tag.- Returns:
- The tag.
- Throws:
NoSuchTagException- If the tag does not exist.
-
createTag
public Tag createTag(String name, String comment, Map<String, String> properties) throws TagAlreadyExistsExceptionCreate a tag under the current metalake.- Specified by:
createTagin interfaceTagOperations- Parameters:
name- The name of the tag.comment- The comment of the tag.properties- The properties of the tag.- Returns:
- The created tag.
- Throws:
TagAlreadyExistsException- If the tag already exists.
-
alterTag
public Tag alterTag(String name, TagChange... changes) throws NoSuchTagException, IllegalArgumentException Alter a tag under the current metalake.- Specified by:
alterTagin interfaceTagOperations- Parameters:
name- The name of the tag.changes- The changes to apply to the tag.- Returns:
- The altered tag.
- Throws:
NoSuchTagException- If the tag does not exist.IllegalArgumentException- If the changes cannot be applied to the tag.
-
deleteTag
Delete a tag under the current metalake.- Specified by:
deleteTagin interfaceTagOperations- Parameters:
name- The name of the tag.- Returns:
- True if the tag is deleted, false if the tag does not exist.
-
listPolicies
List all the policies under the current metalake.- Specified by:
listPoliciesin interfacePolicyOperations- Returns:
- A list of the policy names under the current metalake.
- Throws:
NoSuchMetalakeException- If the metalake does not exist.
-
listPolicyInfos
List all the policies with detailed information under the current metalake.- Specified by:
listPolicyInfosin interfacePolicyOperations- Returns:
- A list of
Policyunder the current metalake. - Throws:
NoSuchMetalakeException- If the metalake does not exist.
-
getPolicy
Get a policy by its name under the current metalake.- Specified by:
getPolicyin interfacePolicyOperations- Parameters:
name- The name of the policy.- Returns:
- The policy.
- Throws:
NoSuchPolicyException- If the policy does not exist.
-
createPolicy
public Policy createPolicy(String name, String type, String comment, boolean enabled, PolicyContent content) throws PolicyAlreadyExistsException Create a new policy under the current metalake.- Specified by:
createPolicyin interfacePolicyOperations- Parameters:
name- The name of the policy.type- The type of the policy.comment- The comment of the policy.enabled- Whether the policy is enabled or not.content- The content of the policy.- Returns:
- The created policy.
- Throws:
PolicyAlreadyExistsException- If the policy already exists.
-
enablePolicy
Enable a policy under the current metalake. If the policy is already enabled, this method does nothing.- Specified by:
enablePolicyin interfacePolicyOperations- Parameters:
name- The name of the policy to enable.- Throws:
NoSuchPolicyException- If the policy does not exist.
-
disablePolicy
Disable a policy under the current metalake. If the policy is already disabled, this method does nothing.- Specified by:
disablePolicyin interfacePolicyOperations- Parameters:
name- The name of the policy to disable.- Throws:
NoSuchPolicyException- If the policy does not exist.
-
alterPolicy
public Policy alterPolicy(String name, PolicyChange... changes) throws NoSuchPolicyException, IllegalArgumentException Alter a policy under the current metalake by applying the changes.- Specified by:
alterPolicyin interfacePolicyOperations- Parameters:
name- The name of the policy.changes- The changes to apply to the policy.- Returns:
- The altered policy.
- Throws:
NoSuchPolicyException- If the policy does not exist.IllegalArgumentException- If the changes cannot be applied to the policy.
-
deletePolicy
Deletes a policy under the current metalake.- Specified by:
deletePolicyin interfacePolicyOperations- Parameters:
name- The name of the policy.- Returns:
- True if the policy was deleted, false if the policy does not exist.
-
addUser
Adds a new User.- Parameters:
user- The name of the User.- Returns:
- The added User instance.
- Throws:
UserAlreadyExistsException- If a User with the same name already exists.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If adding the User encounters storage issues.
-
removeUser
Removes a User.- Parameters:
user- The name of the User.- Returns:
- True if the User was successfully removed, false only when there's no such user, otherwise it will throw an exception.
- Throws:
NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If removing the User encounters storage issues.
-
getUser
Gets a User.- Parameters:
user- The name of the User.- Returns:
- The getting User instance.
- Throws:
NoSuchUserException- If the User with the given name does not exist.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If getting the User encounters storage issues.
-
listUsers
Lists the users.- Returns:
- The User list.
- Throws:
NoSuchMetalakeException- If the Metalake with the given name does not exist.
-
listUserNames
Lists the usernames.- Returns:
- The username list.
- Throws:
NoSuchMetalakeException- If the Metalake with the given name does not exist.
-
addGroup
Adds a new Group.- Parameters:
group- The name of the Group.- Returns:
- The Added Group instance.
- Throws:
GroupAlreadyExistsException- If a Group with the same name already exists.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If adding the Group encounters storage issues.
-
removeGroup
Removes a Group.- Parameters:
group- THe name of the Group.- Returns:
- True if the Group was successfully removed, false only when there's no such group, otherwise it will throw an exception.
- Throws:
NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If removing the Group encounters storage issues.
-
getGroup
Gets a Group.- Parameters:
group- The name of the Group.- Returns:
- The getting Group instance.
- Throws:
NoSuchGroupException- If the Group with the given name does not exist.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If getting the Group encounters storage issues.
-
listGroups
Lists the groups- Returns:
- The Group list
- Throws:
NoSuchMetalakeException- If the Metalake with the given name does not exist.
-
listGroupNames
Lists the group names- Returns:
- The Group Name List
- Throws:
NoSuchMetalakeException- If the Metalake with the given name does not exist.
-
getRole
Gets a Role.- Parameters:
role- The name of the Role.- Returns:
- The getting Role instance.
- Throws:
NoSuchRoleException- If the Role with the given name does not exist.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If getting the Role encounters storage issues.
-
deleteRole
Deletes a Role.- Parameters:
role- The name of the Role.- Returns:
- True if the Role was successfully deleted, false only when there's no such role, otherwise it will throw an exception.
- Throws:
NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If deleting the Role encounters storage issues.
-
createRole
public Role createRole(String role, Map<String, String> properties, List<SecurableObject> securableObjects) throws RoleAlreadyExistsException, NoSuchMetalakeException, IllegalMetadataObjectExceptionCreates a new Role.- Parameters:
role- The name of the Role.properties- The properties of the Role.securableObjects- The securable objects of the Role.- Returns:
- The created Role instance.
- Throws:
RoleAlreadyExistsException- If a Role with the same name already exists.NoSuchMetalakeException- If the Metalake with the given name does not exist.IllegalMetadataObjectException- If the securable object is invalidRuntimeException- If creating the Role encounters storage issues.
-
listRoleNames
Lists the role names.- Returns:
- The role name list.
- Throws:
NoSuchMetalakeException- If the Metalake with the given name does not exist.
-
grantRolesToUser
public User grantRolesToUser(List<String> roles, String user) throws NoSuchUserException, IllegalRoleException, NoSuchMetalakeException Grant roles to a user.- Parameters:
user- The name of the User.roles- The names of the Role.- Returns:
- The Group after granted.
- Throws:
NoSuchUserException- If the User with the given name does not exist.IllegalRoleException- If the Role with the given name is invalid.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If granting roles to a user encounters storage issues.
-
grantRolesToGroup
public Group grantRolesToGroup(List<String> roles, String group) throws NoSuchGroupException, NoSuchRoleException, NoSuchMetalakeException Grant roles to a group.- Parameters:
group- The name of the Group.roles- The names of the Role.- Returns:
- The Group after granted.
- Throws:
NoSuchGroupException- If the Group with the given name does not exist.IllegalRoleException- If the Role with the given name is invalid.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If granting roles to a group encounters storage issues.NoSuchRoleException
-
revokeRolesFromUser
public User revokeRolesFromUser(List<String> roles, String user) throws NoSuchUserException, NoSuchRoleException, NoSuchMetalakeException Revoke roles from a user.- Parameters:
user- The name of the User.roles- The names of the Role.- Returns:
- The User after revoked.
- Throws:
NoSuchUserException- If the User with the given name does not exist.IllegalRoleException- If the Role with the given name is invalid.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If revoking roles from a user encounters storage issues.NoSuchRoleException
-
revokeRolesFromGroup
public Group revokeRolesFromGroup(List<String> roles, String group) throws NoSuchGroupException, IllegalRoleException, NoSuchMetalakeException Revoke roles from a group.- Parameters:
group- The name of the Group.roles- The names of the Role.- Returns:
- The Group after revoked.
- Throws:
NoSuchGroupException- If the Group with the given name does not exist.IllegalRoleException- If the Role with the given name is invalid.NoSuchMetalakeException- If the Metalake with the given name does not exist.RuntimeException- If revoking roles from a group encounters storage issues.
-
grantPrivilegesToRole
public Role grantPrivilegesToRole(String role, MetadataObject object, List<Privilege> privileges) throws NoSuchRoleException, NoSuchMetadataObjectException, NoSuchMetalakeException, IllegalPrivilegeException Grant privileges to a role.- Parameters:
role- The name of the role.privileges- The privileges to grant.object- The object is associated with privileges to grant.- Returns:
- The role after granted.
- Throws:
NoSuchRoleException- If the role with the given name does not exist.NoSuchMetadataObjectException- If the metadata object with the given name does not exist.NoSuchMetalakeException- If the Metalake with the given name does not exist.IllegalPrivilegeException- If any privilege can't be bind to the metadata object.RuntimeException- If granting privileges to a role encounters storage issues.
-
grantPrivilegesToRole
public Role grantPrivilegesToRole(String role, MetadataObject object, Set<Privilege> privileges) throws NoSuchRoleException, NoSuchMetadataObjectException, NoSuchMetalakeException, IllegalPrivilegeException Grant privileges to a role.- Parameters:
role- The name of the role.privileges- The privileges to grant.object- The object is associated with privileges to grant.- Returns:
- The role after granted.
- Throws:
NoSuchRoleException- If the role with the given name does not exist.NoSuchMetadataObjectException- If the metadata object with the given name does not exist.NoSuchMetalakeException- If the Metalake with the given name does not exist.IllegalPrivilegeException- If any privilege can't be bind to the metadata object.RuntimeException- If granting privileges to a role encounters storage issues.
-
revokePrivilegesFromRole
@Deprecated public Role revokePrivilegesFromRole(String role, MetadataObject object, List<Privilege> privileges) throws NoSuchRoleException, NoSuchMetadataObjectException, NoSuchMetalakeException, IllegalPrivilegeException Deprecated.Revoke privileges from a role.- Parameters:
role- The name of the role.privileges- The privileges to revoke.object- The object is associated with privileges to revoke.- Returns:
- The role after revoked.
- Throws:
NoSuchRoleException- If the role with the given name does not exist.NoSuchMetadataObjectException- If the metadata object with the given name does not exist.NoSuchMetalakeException- If the Metalake with the given name does not exist.IllegalPrivilegeException- If any privilege can't be bind to the metadata object.RuntimeException- If revoking privileges from a role encounters storage issues.
-
revokePrivilegesFromRole
public Role revokePrivilegesFromRole(String role, MetadataObject object, Set<Privilege> privileges) throws NoSuchRoleException, NoSuchMetadataObjectException, NoSuchMetalakeException, IllegalPrivilegeException Revoke privileges from a role.- Parameters:
role- The name of the role.privileges- The privileges to revoke.object- The object is associated with privileges to revoke.- Returns:
- The role after revoked.
- Throws:
NoSuchRoleException- If the role with the given name does not exist.NoSuchMetadataObjectException- If the metadata object with the given name does not exist.NoSuchMetalakeException- If the Metalake with the given name does not exist.IllegalPrivilegeException- If any privilege can't be bind to the metadata object.RuntimeException- If revoking privileges from a role encounters storage issues.
-
getOwner
Get the owner of a metadata object.- Parameters:
object- The metadata object- Returns:
- The owner of the metadata object. If the metadata object doesn't set the owner, it will return Optional.empty().
- Throws:
NoSuchMetadataObjectException- If the metadata object is not found.
-
setOwner
public void setOwner(MetadataObject object, String ownerName, Owner.Type ownerType) throws NotFoundException Set the owner of a metadata object.- Parameters:
object- The metadata object.ownerName- The name of the ownerownerType- The type of the owner, The owner can be a user or a group.- Throws:
NotFoundException- If the metadata object isn't found or the owner doesn't exist.
-
listBindingRoleNames
Description copied from interface:SupportsRolesList all the role names associated with this metadata object.- Specified by:
listBindingRoleNamesin interfaceSupportsRoles- Returns:
- The role name list associated with this metadata object.
-
listJobTemplates
Description copied from interface:SupportsJobsLists all the registered job templates in Gravitino.- Specified by:
listJobTemplatesin interfaceSupportsJobs- Returns:
- a list of job templates
-
registerJobTemplate
Description copied from interface:SupportsJobsRegister a job template with the specified job template to Gravitino. The registered job template will be maintained in Gravitino, allowing it to be executed later.- Specified by:
registerJobTemplatein interfaceSupportsJobs- Parameters:
jobTemplate- the template for the job- Throws:
JobTemplateAlreadyExistsException- if a job template with the same name already exists
-
getJobTemplate
Description copied from interface:SupportsJobsRetrieves a job template by its name.- Specified by:
getJobTemplatein interfaceSupportsJobs- Parameters:
jobTemplateName- the name of the job template to retrieve- Returns:
- the job template associated with the specified name
- Throws:
NoSuchJobTemplateException- if no job template with the specified name exists
-
deleteJobTemplate
Description copied from interface:SupportsJobsDeletes a job template by its name. This will remove the job template from Gravitino, and it will no longer be available for execution. Only when all the jobs associated with this job template are completed, failed, or cancelled, the job template can be deleted successfully, otherwise it will throw an exception.The deletion of a job template will also delete all the jobs associated with this template.
- Specified by:
deleteJobTemplatein interfaceSupportsJobs- Parameters:
jobTemplateName- the name of the job template to delete- Returns:
- true if the job template was successfully deleted, false if the job template does not exist
- Throws:
InUseException- if there are still queued or started jobs associated with the job template
-
listJobs
Description copied from interface:SupportsJobsLists all the jobs by the specified job template name. This will return a list of job handles associated with the specified job template. Each job handle represents a specific job.- Specified by:
listJobsin interfaceSupportsJobs- Parameters:
jobTemplateName- the name of the job template to list jobs for- Returns:
- a list of job handles associated with the specified job template
- Throws:
NoSuchJobTemplateException- if no job template with the specified name exists
-
listJobs
Description copied from interface:SupportsJobsLists all the jobs in Gravitino. This will return a list of all job handles, regardless of the job template they are associated with.- Specified by:
listJobsin interfaceSupportsJobs- Returns:
- a list of all job handles in Gravitino
-
runJob
public JobHandle runJob(String jobTemplateName, Map<String, String> jobConf) throws NoSuchJobTemplateExceptionDescription copied from interface:SupportsJobsRun a job with the template name and configuration. The jobConf is a map of key-value contains the variables that will be used to replace the templated parameters in the job template.- Specified by:
runJobin interfaceSupportsJobs- Parameters:
jobTemplateName- the name of the job template to runjobConf- the configuration for the job- Returns:
- a handle to the run job
- Throws:
NoSuchJobTemplateException- if no job template with the specified name exists
-
getJob
Description copied from interface:SupportsJobsRetrieves a job by its ID.- Specified by:
getJobin interfaceSupportsJobs- Parameters:
jobId- the ID of the job to retrieve- Returns:
- a handle to the job
- Throws:
NoSuchJobException- if the job with the specified ID does not exist
-
cancelJob
Description copied from interface:SupportsJobsCancel a job by its ID. This operation will attempt to cancel the job if it is still running. This method will return immediately, user could use the job handle to check the status of the job after invoking this method.- Specified by:
cancelJobin interfaceSupportsJobs- Parameters:
jobId- the ID of the job to cancel- Returns:
- a handle to the cancelled job
- Throws:
NoSuchJobException- if the job with the specified ID does not exist
-
equals
- Overrides:
equalsin classMetalakeDTO
-
builder
public static org.apache.gravitino.client.GravitinoMetalake.Builder builder()- Returns:
- the builder for creating a new instance of GravitinoMetaLake.
-
revokePrivilegesFromRole(String, MetadataObject, Set)instead.