Class NessieStoreImpl

  • All Implemented Interfaces:
    NessieStore, TransactionHandler, org.apache.hadoop.conf.Configurable

    public class NessieStoreImpl
    extends Object
    implements NessieStore
    A rawstore implementation that is backed by the Nessie REST API.
    • Constructor Detail

      • NessieStoreImpl

        public NessieStoreImpl()
    • Method Detail

      • setConf

        public void setConf​(org.apache.hadoop.conf.Configuration conf)
        Specified by:
        setConf in interface org.apache.hadoop.conf.Configurable
      • getConf

        public org.apache.hadoop.conf.Configuration getConf()
        Specified by:
        getConf in interface org.apache.hadoop.conf.Configurable
      • createDatabase

        public void createDatabase​(org.apache.hadoop.hive.metastore.api.Database db)
                            throws org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                   org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        createDatabase in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • getDatabase

        public org.apache.hadoop.hive.metastore.api.Database getDatabase​(String name)
                                                                  throws org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        getDatabase in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • dropDatabase

        public boolean dropDatabase​(String dbname)
                             throws org.apache.hadoop.hive.metastore.api.NoSuchObjectException,
                                    org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        dropDatabase in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • alterDatabase

        public boolean alterDatabase​(String dbname,
                                     org.apache.hadoop.hive.metastore.api.Database db)
                              throws org.apache.hadoop.hive.metastore.api.NoSuchObjectException,
                                     org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        alterDatabase in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • getDatabases

        public List<String> getDatabases​(String pattern)
                                  throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getDatabases in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • getAllDatabases

        public List<String> getAllDatabases()
                                     throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getAllDatabases in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • createTable

        public void createTable​(org.apache.hadoop.hive.metastore.api.Table tbl)
                         throws org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        createTable in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • dropTable

        public boolean dropTable​(String dbName,
                                 String tableName)
                          throws org.apache.hadoop.hive.metastore.api.MetaException,
                                 org.apache.hadoop.hive.metastore.api.NoSuchObjectException,
                                 org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                 org.apache.hadoop.hive.metastore.api.InvalidInputException
        Specified by:
        dropTable in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.InvalidInputException
      • getTable

        public org.apache.hadoop.hive.metastore.api.Table getTable​(String dbName,
                                                                   String tableName)
                                                            throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getTable in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • addPartition

        public boolean addPartition​(org.apache.hadoop.hive.metastore.api.Partition part)
                             throws org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                    org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        addPartition in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • addPartitions

        public boolean addPartitions​(String dbName,
                                     String tblName,
                                     List<org.apache.hadoop.hive.metastore.api.Partition> parts)
                              throws org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                     org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        addPartitions in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • addPartitions

        public boolean addPartitions​(String dbName,
                                     String tblName,
                                     org.apache.hadoop.hive.metastore.partition.spec.PartitionSpecProxy partitionSpec,
                                     boolean ifNotExists)
                              throws org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                     org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        addPartitions in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • getPartition

        public org.apache.hadoop.hive.metastore.api.Partition getPartition​(String dbName,
                                                                           String tableName,
                                                                           List<String> partitionValues)
                                                                    throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                           org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        getPartition in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • getPartitionWithAuth

        public org.apache.hadoop.hive.metastore.api.Partition getPartitionWithAuth​(String dbName,
                                                                                   String tblName,
                                                                                   List<String> partVals,
                                                                                   String userName,
                                                                                   List<String> groupNames)
                                                                            throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                                   org.apache.hadoop.hive.metastore.api.NoSuchObjectException,
                                                                                   org.apache.hadoop.hive.metastore.api.InvalidObjectException
        Specified by:
        getPartitionWithAuth in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
      • getPartitionsWithAuth

        public List<org.apache.hadoop.hive.metastore.api.Partition> getPartitionsWithAuth​(String dbName,
                                                                                          String tblName,
                                                                                          short maxParts,
                                                                                          String userName,
                                                                                          List<String> groupNames)
                                                                                   throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                                          org.apache.hadoop.hive.metastore.api.NoSuchObjectException,
                                                                                          org.apache.hadoop.hive.metastore.api.InvalidObjectException
        Specified by:
        getPartitionsWithAuth in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
      • doesPartitionExist

        public boolean doesPartitionExist​(String dbName,
                                          String tableName,
                                          List<String> partitionValues)
                                   throws org.apache.hadoop.hive.metastore.api.MetaException,
                                          org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        doesPartitionExist in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • dropPartition

        public boolean dropPartition​(String dbName,
                                     String tableName,
                                     List<String> partVals)
                              throws org.apache.hadoop.hive.metastore.api.MetaException,
                                     org.apache.hadoop.hive.metastore.api.NoSuchObjectException,
                                     org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                     org.apache.hadoop.hive.metastore.api.InvalidInputException
        Specified by:
        dropPartition in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.InvalidInputException
      • dropPartitions

        public void dropPartitions​(String dbName,
                                   String tableName,
                                   List<String> partNames)
                            throws org.apache.hadoop.hive.metastore.api.MetaException,
                                   org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        dropPartitions in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • getPartitions

        public List<org.apache.hadoop.hive.metastore.api.Partition> getPartitions​(String dbName,
                                                                                  String tableName,
                                                                                  int max)
                                                                           throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                                  org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        getPartitions in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • alterTable

        public void alterTable​(String dbname,
                               String name,
                               org.apache.hadoop.hive.metastore.api.Table newTable)
                        throws org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                               org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        alterTable in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • getTables

        public List<String> getTables​(String dbName,
                                      String pattern)
                               throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getTables in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • getTables

        public List<String> getTables​(String dbName,
                                      String pattern,
                                      org.apache.hadoop.hive.metastore.TableType tableType)
                               throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getTables in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • getTableMeta

        public List<org.apache.hadoop.hive.metastore.api.TableMeta> getTableMeta​(String dbName,
                                                                                 String tableNames,
                                                                                 List<String> tableTypes)
                                                                          throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getTableMeta in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • getTableObjectsByName

        public List<org.apache.hadoop.hive.metastore.api.Table> getTableObjectsByName​(String dbName,
                                                                                      List<String> tableNames)
                                                                               throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                                      org.apache.hadoop.hive.metastore.api.UnknownDBException
        Specified by:
        getTableObjectsByName in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.UnknownDBException
      • getAllTables

        public List<String> getAllTables​(String dbName)
                                  throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getAllTables in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • listTableNamesByFilter

        public List<String> listTableNamesByFilter​(String dbName,
                                                   String filter,
                                                   short maxTables)
                                            throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                   org.apache.hadoop.hive.metastore.api.UnknownDBException
        Specified by:
        listTableNamesByFilter in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.UnknownDBException
      • listPartitionNames

        public List<String> listPartitionNames​(String dbName,
                                               String tblName,
                                               short maxParts)
                                        throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        listPartitionNames in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • listPartitionValues

        public org.apache.hadoop.hive.metastore.api.PartitionValuesResponse listPartitionValues​(String dbName,
                                                                                                String tblName,
                                                                                                List<org.apache.hadoop.hive.metastore.api.FieldSchema> cols,
                                                                                                boolean applyDistinct,
                                                                                                String filter,
                                                                                                boolean ascending,
                                                                                                List<org.apache.hadoop.hive.metastore.api.FieldSchema> order,
                                                                                                long maxParts)
                                                                                         throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        listPartitionValues in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • alterPartition

        public void alterPartition​(String dbName,
                                   String tblName,
                                   List<String> partVals,
                                   org.apache.hadoop.hive.metastore.api.Partition newPart)
                            throws org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                   org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        alterPartition in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • alterPartitions

        public void alterPartitions​(String dbName,
                                    String tblName,
                                    List<List<String>> partValsList,
                                    List<org.apache.hadoop.hive.metastore.api.Partition> newParts)
                             throws org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                    org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        alterPartitions in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.MetaException
      • getPartitionsByFilter

        public List<org.apache.hadoop.hive.metastore.api.Partition> getPartitionsByFilter​(String dbName,
                                                                                          String tblName,
                                                                                          String filter,
                                                                                          short maxParts)
                                                                                   throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                                          org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        getPartitionsByFilter in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • getPartitionsByExpr

        public boolean getPartitionsByExpr​(String dbName,
                                           String tblName,
                                           byte[] expr,
                                           String defaultPartitionName,
                                           short maxParts,
                                           List<org.apache.hadoop.hive.metastore.api.Partition> result)
                                    throws org.apache.thrift.TException
        Specified by:
        getPartitionsByExpr in interface NessieStore
        Throws:
        org.apache.thrift.TException
      • getNumPartitionsByFilter

        public int getNumPartitionsByFilter​(String dbName,
                                            String tblName,
                                            String filter)
                                     throws org.apache.hadoop.hive.metastore.api.MetaException,
                                            org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        getNumPartitionsByFilter in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • getNumPartitionsByExpr

        public int getNumPartitionsByExpr​(String dbName,
                                          String tblName,
                                          byte[] expr)
                                   throws org.apache.hadoop.hive.metastore.api.MetaException,
                                          org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        getNumPartitionsByExpr in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • getPartitionsByNames

        public List<org.apache.hadoop.hive.metastore.api.Partition> getPartitionsByNames​(String dbName,
                                                                                         String tblName,
                                                                                         List<String> partNames)
                                                                                  throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                                         org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        getPartitionsByNames in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • listPartitionsPsWithAuth

        public List<org.apache.hadoop.hive.metastore.api.Partition> listPartitionsPsWithAuth​(String dbName,
                                                                                             String tblName,
                                                                                             List<String> partVals,
                                                                                             short maxParts,
                                                                                             String userName,
                                                                                             List<String> groupNames)
                                                                                      throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                                             org.apache.hadoop.hive.metastore.api.InvalidObjectException,
                                                                                             org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        listPartitionsPsWithAuth in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.InvalidObjectException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
      • getMetaStoreSchemaVersion

        public String getMetaStoreSchemaVersion()
                                         throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getMetaStoreSchemaVersion in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • listPartitionNamesByFilter

        public List<String> listPartitionNamesByFilter​(String dbName,
                                                       String tblName,
                                                       String filter,
                                                       short maxParts)
                                                throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        listPartitionNamesByFilter in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • getDatabaseCount

        public int getDatabaseCount()
                             throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getDatabaseCount in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • getTableCount

        public int getTableCount()
                          throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getTableCount in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • getPartitionCount

        public int getPartitionCount()
                              throws org.apache.hadoop.hive.metastore.api.MetaException
        Specified by:
        getPartitionCount in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
      • getPartitionColsWithStats

        public Map<String,​List<String>> getPartitionColsWithStats​(String dbName,
                                                                        String tableName)
                                                                 throws org.apache.hadoop.hive.metastore.api.MetaException,
                                                                        org.apache.hadoop.hive.metastore.api.NoSuchObjectException
        Specified by:
        getPartitionColsWithStats in interface NessieStore
        Throws:
        org.apache.hadoop.hive.metastore.api.MetaException
        org.apache.hadoop.hive.metastore.api.NoSuchObjectException