All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.prestosql.plugin.hive.metastore.thrift.ThriftMetastoreClient Maven / Gradle / Ivy

There is a newer version: 350
Show newest version
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.prestosql.plugin.hive.metastore.thrift;

import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.EnvironmentContext;
import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
import org.apache.hadoop.hive.metastore.api.HiveObjectRef;
import org.apache.hadoop.hive.metastore.api.LockRequest;
import org.apache.hadoop.hive.metastore.api.LockResponse;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.PrincipalType;
import org.apache.hadoop.hive.metastore.api.PrivilegeBag;
import org.apache.hadoop.hive.metastore.api.Role;
import org.apache.hadoop.hive.metastore.api.RolePrincipalGrant;
import org.apache.hadoop.hive.metastore.api.Table;
import org.apache.thrift.TException;

import java.io.Closeable;
import java.util.List;
import java.util.Map;

public interface ThriftMetastoreClient
        extends Closeable
{
    @Override
    void close();

    List getAllDatabases()
            throws TException;

    Database getDatabase(String databaseName)
            throws TException;

    List getAllTables(String databaseName)
            throws TException;

    List getTableNamesByFilter(String databaseName, String filter)
            throws TException;

    List getTableNamesByType(String databaseName, String tableType)
            throws TException;

    void createDatabase(Database database)
            throws TException;

    void dropDatabase(String databaseName, boolean deleteData, boolean cascade)
            throws TException;

    void alterDatabase(String databaseName, Database database)
            throws TException;

    void createTable(Table table)
            throws TException;

    void dropTable(String databaseName, String name, boolean deleteData)
            throws TException;

    void alterTableWithEnvironmentContext(String databaseName, String tableName, Table newTable, EnvironmentContext context)
            throws TException;

    Table getTable(String databaseName, String tableName)
            throws TException;

    Table getTableWithCapabilities(String databaseName, String tableName)
            throws TException;

    List getFields(String databaseName, String tableName)
            throws TException;

    List getTableColumnStatistics(String databaseName, String tableName, List columnNames)
            throws TException;

    void setTableColumnStatistics(String databaseName, String tableName, List statistics)
            throws TException;

    void deleteTableColumnStatistics(String databaseName, String tableName, String columnName)
            throws TException;

    Map> getPartitionColumnStatistics(String databaseName, String tableName, List partitionNames, List columnNames)
            throws TException;

    void setPartitionColumnStatistics(String databaseName, String tableName, String partitionName, List statistics)
            throws TException;

    void deletePartitionColumnStatistics(String databaseName, String tableName, String partitionName, String columnName)
            throws TException;

    List getPartitionNames(String databaseName, String tableName)
            throws TException;

    List getPartitionNamesFiltered(String databaseName, String tableName, List partitionValues)
            throws TException;

    int addPartitions(List newPartitions)
            throws TException;

    boolean dropPartition(String databaseName, String tableName, List partitionValues, boolean deleteData)
            throws TException;

    void alterPartition(String databaseName, String tableName, Partition partition)
            throws TException;

    Partition getPartition(String databaseName, String tableName, List partitionValues)
            throws TException;

    List getPartitionsByNames(String databaseName, String tableName, List partitionNames)
            throws TException;

    List listRoles(String principalName, PrincipalType principalType)
            throws TException;

    List listPrivileges(String principalName, PrincipalType principalType, HiveObjectRef hiveObjectRef)
            throws TException;

    List getRoleNames()
            throws TException;

    void createRole(String role, String grantor)
            throws TException;

    void dropRole(String role)
            throws TException;

    boolean grantPrivileges(PrivilegeBag privilegeBag)
            throws TException;

    boolean revokePrivileges(PrivilegeBag privilegeBag)
            throws TException;

    void grantRole(String role, String granteeName, PrincipalType granteeType, String grantorName, PrincipalType grantorType, boolean grantOption)
            throws TException;

    void revokeRole(String role, String granteeName, PrincipalType granteeType, boolean grantOption)
            throws TException;

    List listGrantedPrincipals(String role)
            throws TException;

    List listRoleGrants(String name, PrincipalType principalType)
            throws TException;

    void setUGI(String userName)
            throws TException;

    long openTransaction(String user)
            throws TException;

    void commitTransaction(long transactionId)
            throws TException;

    void sendTransactionHeartbeat(long transactionId)
            throws TException;

    LockResponse acquireLock(LockRequest lockRequest)
            throws TException;

    LockResponse checkLock(long lockId)
            throws TException;

    String getValidWriteIds(List tableList, long currentTransactionId)
            throws TException;

    String get_config_value(String name, String defaultValue)
            throws TException;

    String getDelegationToken(String userName)
            throws TException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy