Class RESTSessionCatalog

    • Constructor Detail

      • RESTSessionCatalog

        public RESTSessionCatalog()
      • RESTSessionCatalog

        public RESTSessionCatalog​(java.util.function.Function<java.util.Map<java.lang.String,​java.lang.String>,​RESTClient> clientBuilder,
                                  java.util.function.BiFunction<SessionCatalog.SessionContext,​java.util.Map<java.lang.String,​java.lang.String>,​FileIO> ioBuilder)
    • Method Detail

      • initialize

        public void initialize​(java.lang.String name,
                               java.util.Map<java.lang.String,​java.lang.String> unresolved)
        Description copied from interface: SessionCatalog
        Initialize given a custom name and a map of catalog properties.
        Specified by:
        initialize in interface SessionCatalog
        Overrides:
        initialize in class BaseSessionCatalog
        Parameters:
        name - a custom name for the catalog
        unresolved - catalog properties
      • setConf

        public void setConf​(java.lang.Object newConf)
        Specified by:
        setConf in interface Configurable<java.lang.Object>
      • dropTable

        public boolean dropTable​(SessionCatalog.SessionContext context,
                                 TableIdentifier identifier)
        Description copied from interface: SessionCatalog
        Drop a table, without requesting that files are immediately deleted.

        Data and metadata files should be deleted according to the catalog's policy.

        Specified by:
        dropTable in interface SessionCatalog
        Parameters:
        context - session context
        identifier - a table identifier
        Returns:
        true if the table was dropped, false if the table did not exist
      • purgeTable

        public boolean purgeTable​(SessionCatalog.SessionContext context,
                                  TableIdentifier identifier)
        Description copied from interface: SessionCatalog
        Drop a table and request that files are immediately deleted.
        Specified by:
        purgeTable in interface SessionCatalog
        Parameters:
        context - session context
        identifier - a table identifier
        Returns:
        true if the table was dropped and purged, false if the table did not exist
      • invalidateTable

        public void invalidateTable​(SessionCatalog.SessionContext context,
                                    TableIdentifier ident)
        Description copied from interface: SessionCatalog
        Invalidate cached table metadata from current catalog.

        If the table is already loaded or cached, drop cached data. If the table does not exist or is not cached, do nothing.

        Specified by:
        invalidateTable in interface SessionCatalog
        Parameters:
        context - session context
        ident - a table identifier
      • listNamespaces

        public java.util.List<Namespace> listNamespaces​(SessionCatalog.SessionContext context,
                                                        Namespace namespace)
        Description copied from interface: SessionCatalog
        List child namespaces from the namespace.

        For two existing tables named 'a.b.c.table' and 'a.b.d.table', this method returns:

        • Given: Namespace.empty()
        • Returns: Namespace.of("a")
        • Given: Namespace.of("a")
        • Returns: Namespace.of("a", "b")
        • Given: Namespace.of("a", "b")
        • Returns: Namespace.of("a", "b", "c") and Namespace.of("a", "b", "d")
        • Given: Namespace.of("a", "b", "c")
        • Returns: empty list, because there are no child namespaces
        Specified by:
        listNamespaces in interface SessionCatalog
        Parameters:
        context - session context
        namespace - a namespace
        Returns:
        a List of child Namespace names from the given namespace
      • updateNamespaceMetadata

        public boolean updateNamespaceMetadata​(SessionCatalog.SessionContext context,
                                               Namespace ns,
                                               java.util.Map<java.lang.String,​java.lang.String> updates,
                                               java.util.Set<java.lang.String> removals)
        Description copied from interface: SessionCatalog
        Set a collection of properties on a namespace in the catalog.

        Properties that are not in the given map are not modified or removed by this method.

        Specified by:
        updateNamespaceMetadata in interface SessionCatalog
        Parameters:
        context - session context
        ns - a namespace
        updates - properties to set for the namespace
        removals - properties to remove from the namespace
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException