Class CachingCatalog

  • All Implemented Interfaces:
    Catalog

    public class CachingCatalog
    extends java.lang.Object
    implements Catalog
    • Method Detail

      • wrap

        public static Catalog wrap​(Catalog catalog,
                                   boolean caseSensitive)
      • name

        public java.lang.String name()
        Description copied from interface: Catalog
        Return the name for this catalog.
        Specified by:
        name in interface Catalog
        Returns:
        this catalog's name
      • listTables

        public java.util.List<TableIdentifier> listTables​(Namespace namespace)
        Description copied from interface: Catalog
        Return all the identifiers under this namespace.
        Specified by:
        listTables in interface Catalog
        Parameters:
        namespace - a namespace
        Returns:
        a list of identifiers for tables
      • loadTable

        public Table loadTable​(TableIdentifier ident)
        Description copied from interface: Catalog
        Load a table.
        Specified by:
        loadTable in interface Catalog
        Parameters:
        ident - a table identifier
        Returns:
        instance of Table implementation referred by tableIdentifier
      • createTable

        public Table createTable​(TableIdentifier ident,
                                 Schema schema,
                                 PartitionSpec spec,
                                 java.lang.String location,
                                 java.util.Map<java.lang.String,​java.lang.String> properties)
        Description copied from interface: Catalog
        Create a table.
        Specified by:
        createTable in interface Catalog
        Parameters:
        ident - a table identifier
        schema - a schema
        spec - a partition spec
        location - a location for the table; leave null if unspecified
        properties - a string map of table properties
        Returns:
        a Table instance
      • newCreateTableTransaction

        public Transaction newCreateTableTransaction​(TableIdentifier ident,
                                                     Schema schema,
                                                     PartitionSpec spec,
                                                     java.lang.String location,
                                                     java.util.Map<java.lang.String,​java.lang.String> properties)
        Description copied from interface: Catalog
        Start a transaction to create a table.
        Specified by:
        newCreateTableTransaction in interface Catalog
        Parameters:
        ident - a table identifier
        schema - a schema
        spec - a partition spec
        location - a location for the table; leave null if unspecified
        properties - a string map of table properties
        Returns:
        a Transaction to create the table
      • newReplaceTableTransaction

        public Transaction newReplaceTableTransaction​(TableIdentifier ident,
                                                      Schema schema,
                                                      PartitionSpec spec,
                                                      java.lang.String location,
                                                      java.util.Map<java.lang.String,​java.lang.String> properties,
                                                      boolean orCreate)
        Description copied from interface: Catalog
        Start a transaction to replace a table.
        Specified by:
        newReplaceTableTransaction in interface Catalog
        Parameters:
        ident - a table identifier
        schema - a schema
        spec - a partition spec
        location - a location for the table; leave null if unspecified
        properties - a string map of table properties
        orCreate - whether to create the table if not exists
        Returns:
        a Transaction to replace the table
      • dropTable

        public boolean dropTable​(TableIdentifier ident,
                                 boolean purge)
        Description copied from interface: Catalog
        Drop a table; optionally delete data and metadata files.

        If purge is set to true the implementation should delete all data and metadata files.

        Specified by:
        dropTable in interface Catalog
        Parameters:
        ident - a table identifier
        purge - if true, delete all data and metadata files in the table
        Returns:
        true if the table was dropped, false if the table did not exist
      • buildTable

        public Catalog.TableBuilder buildTable​(TableIdentifier identifier,
                                               Schema schema)
        Description copied from interface: Catalog
        Instantiate a builder to either create a table or start a create/replace transaction.
        Specified by:
        buildTable in interface Catalog
        Parameters:
        identifier - a table identifier
        schema - a schema
        Returns:
        the builder to create a table or start a create/replace transaction