Interface SupportsMetalakes

All Known Implementing Classes:
GravitinoAdminClient

@Evolving public interface SupportsMetalakes
Client interface for supporting metalakes. It includes methods for listing, loading, creating, altering and dropping metalakes.
  • Method Details

    • listMetalakes

      Metalake[] listMetalakes()
      List all metalakes.
      Returns:
      The list of metalakes.
    • loadMetalake

      Metalake loadMetalake(String name) throws NoSuchMetalakeException
      Load a metalake by its name.
      Parameters:
      name - the name of the metalake.
      Returns:
      The metalake.
      Throws:
      NoSuchMetalakeException - If the metalake does not exist.
    • metalakeExists

      default boolean metalakeExists(String name)
      Check if a metalake exists.
      Parameters:
      name - The name of the metalake.
      Returns:
      True if the metalake exists, false otherwise.
    • createMetalake

      Metalake createMetalake(String name, String comment, Map<String,String> properties) throws MetalakeAlreadyExistsException
      Create a metalake with specified name, comment and properties.
      Parameters:
      name - The name of the metalake.
      comment - The comment of the metalake.
      properties - The properties of the metalake.
      Returns:
      The created metalake.
      Throws:
      MetalakeAlreadyExistsException - If the metalake already exists.
    • alterMetalake

      Alter a metalake with specified metalake name and changes.
      Parameters:
      name - The name of the metalake.
      changes - The changes to apply.
      Returns:
      The altered metalake.
      Throws:
      NoSuchMetalakeException - If the metalake does not exist.
      IllegalArgumentException - If the changes cannot be applied to the metalake.
    • dropMetalake

      default boolean dropMetalake(String name) throws NonEmptyEntityException, MetalakeInUseException
      Drop a metalake with specified name. Please make sure: It is equivalent to calling dropMetalake(name, false).
      Parameters:
      name - The name of the metalake.
      Returns:
      True if the metalake was dropped, false if the metalake does not exist.
      Throws:
      NonEmptyEntityException - If the metalake is not empty.
      MetalakeInUseException - If the metalake is in use.
    • dropMetalake

      boolean dropMetalake(String name, boolean force) throws NonEmptyEntityException, MetalakeInUseException
      Drop a metalake with specified name. If the force flag is true, it will:
      • Cascade drop all sub-entities (tags, catalogs, schemas, tables, etc.) of the metalake in Gravitino store.
      • Drop the metalake even if it is in use.
      • External resources (e.g. database, table, etc.) associated with sub-entities will not be deleted unless it is managed (such as managed fileset).
      If the force flag is false, it is equivalent to calling dropMetalake(String).
      Parameters:
      name - The name of the metalake.
      force - Whether to force the drop.
      Returns:
      True if the metalake was dropped, false if the metalake does not exist.
      Throws:
      NonEmptyEntityException - If the metalake is not empty and force is false.
      MetalakeInUseException - If the metalake is in use and force is false.
    • enableMetalake

      void enableMetalake(String name) throws NoSuchMetalakeException
      Enable a metalake. If the metalake is already in use, this method does nothing.
      Parameters:
      name - The name of the metalake.
      Throws:
      NoSuchMetalakeException - If the metalake does not exist.
    • disableMetalake

      void disableMetalake(String name) throws NoSuchMetalakeException
      Disable a metalake. If the metalake is already disabled, this method does nothing. Once a metalake is disable:
      Parameters:
      name - The name of the metalake.
      Throws:
      NoSuchMetalakeException - If the metalake does not exist.