Class DrillHiveMetaStoreClient

java.lang.Object
org.apache.hadoop.hive.metastore.HiveMetaStoreClient
org.apache.drill.exec.store.hive.client.DrillHiveMetaStoreClient
All Implemented Interfaces:
AutoCloseable, org.apache.hadoop.hive.metastore.IMetaStoreClient

public class DrillHiveMetaStoreClient extends org.apache.hadoop.hive.metastore.HiveMetaStoreClient
Extension of HiveMetaStoreClient with addition of cache and methods useful for Drill schema. Note, that access to parent class is synchronized either on cache loading level or in overridden methods, and the synchronization should not be neglected in child classes.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.hadoop.hive.metastore.HiveMetaStoreClient

    org.apache.hadoop.hive.metastore.HiveMetaStoreClient.MetastoreMapIterable<K extends Object,V extends Object>

    Nested classes/interfaces inherited from interface org.apache.hadoop.hive.metastore.IMetaStoreClient

    org.apache.hadoop.hive.metastore.IMetaStoreClient.IncompatibleMetastoreException, org.apache.hadoop.hive.metastore.IMetaStoreClient.NotificationFilter
  • Field Summary

    Fields inherited from class org.apache.hadoop.hive.metastore.HiveMetaStoreClient

    conf, LOG, TEST_VERSION, VERSION
  • Method Summary

    Modifier and Type
    Method
    Description
    getDatabases(boolean ignoreAuthzErrors)
    Lists all Hive database names.
    getDelegationToken(String owner, String renewerKerberosPrincipalName)
    Overridden to enforce synchronization.
    getHiveReadEntry(String dbName, String tableName, boolean ignoreAuthzErrors)
    Returns table metadata for concrete table
    Map<String,org.apache.calcite.schema.Schema.TableType>
    getTableNamesAndTypes(String dbName, boolean ignoreAuthzErrors)
    Returns collection of view and table names along with their types.

    Methods inherited from class org.apache.hadoop.hive.metastore.HiveMetaStoreClient

    abortTxns, add_partition, add_partition, add_partitions, add_partitions, add_partitions_pspec, addCheckConstraint, addDefaultConstraint, addDynamicPartitions, addDynamicPartitions, addForeignKey, addMasterKey, addNotNullConstraint, addPrimaryKey, addRuntimeStat, addSchemaVersion, addSerDe, addToken, addUniqueConstraint, allocateTableWriteId, allocateTableWriteIdsBatch, alter_partition, alter_partition, alter_partition, alter_partitions, alter_partitions, alter_partitions, alter_table, alter_table, alter_table, alter_table_with_environmentContext, alterCatalog, alterDatabase, alterDatabase, alterFunction, alterFunction, alterISchema, alterResourcePlan, alterWMPool, alterWMTrigger, appendPartition, appendPartition, appendPartition, appendPartition, appendPartition, appendPartitionByName, appendPartitionByName, cacheFileMetadata, cancelDelegationToken, checkLock, clearFileMetadata, close, commitTxn, compact, compact, compact2, create_role, create_table_with_environment_context, createCatalog, createDatabase, createFunction, createISchema, createOrDropTriggerToPoolMapping, createOrUpdateWMMapping, createResourcePlan, createTable, createTable, createTableWithConstraints, createType, createWMPool, createWMTrigger, deepCopy, deepCopy, deepCopy, deepCopyFieldSchemas, deletePartitionColumnStatistics, deletePartitionColumnStatistics, deleteTableColumnStatistics, deleteTableColumnStatistics, drop_role, drop_table_with_environment_context, dropCatalog, dropConstraint, dropConstraint, dropDatabase, dropDatabase, dropDatabase, dropDatabase, dropFunction, dropFunction, dropISchema, dropPartition, dropPartition, dropPartition, dropPartition, dropPartition, dropPartition, dropPartition, dropPartition, dropPartition, dropPartitionByName, dropPartitionByName, dropPartitions, dropPartitions, dropPartitions, dropPartitions, dropResourcePlan, dropSchemaVersion, dropTable, dropTable, dropTable, dropTable, dropTable, dropType, dropWMMapping, dropWMPool, dropWMTrigger, exchange_partition, exchange_partition, exchange_partitions, exchange_partitions, fireListenerEvent, flushCache, get_principals_in_role, get_privilege_set, get_role_grants_for_principal, getActiveResourcePlan, getAggrColStatsFor, getAggrColStatsFor, getAllDatabases, getAllDatabases, getAllFunctions, getAllResourcePlans, getAllTables, getAllTables, getAllTokenIdentifiers, getCatalog, getCatalogs, getCheckConstraints, getConfigValue, getCurrentNotificationEventId, getDatabase, getDatabase, getDatabases, getDatabases, getDefaultConstraints, getDelegationToken, getFields, getFields, getFileMetadata, getFileMetadataBySarg, getForeignKeys, getFunction, getFunction, getFunctions, getFunctions, getISchema, getMasterKeys, getMaterializationInvalidationInfo, getMaterializedViewsForRewriting, getMaterializedViewsForRewriting, getMetaConf, getMetastoreDbUuid, getNextNotification, getNotificationEventsCount, getNotNullConstraints, getNumPartitionsByFilter, getNumPartitionsByFilter, getPartition, getPartition, getPartition, getPartition, getPartitionColumnStatistics, getPartitionColumnStatistics, getPartitionsByNames, getPartitionsByNames, getPartitionWithAuthInfo, getPartitionWithAuthInfo, getPrimaryKeys, getResourcePlan, getRuntimeStats, getSchema, getSchema, getSchemaAllVersions, getSchemaByCols, getSchemaLatestVersion, getSchemaVersion, getSerDe, getTable, getTable, getTableColumnStatistics, getTableColumnStatistics, getTableMeta, getTableMeta, getTableObjectsByName, getTableObjectsByName, getTables, getTables, getTables, getTables, getToken, getTokenStrForm, getTriggersForResourcePlan, getTTransport, getType, getTypeAll, getUniqueConstraints, getValidTxns, getValidTxns, getValidWriteIds, getValidWriteIds, grant_privileges, grant_role, heartbeat, heartbeatLockMaterializationRebuild, heartbeatTxnRange, insertTable, isCompatibleWith, isLocalMetaStore, isPartitionMarkedForEvent, isPartitionMarkedForEvent, isSameConfObj, list_privileges, list_roles, listPartitionNames, listPartitionNames, listPartitionNames, listPartitionNames, listPartitions, listPartitions, listPartitions, listPartitions, listPartitionsByExpr, listPartitionsByExpr, listPartitionsByFilter, listPartitionsByFilter, listPartitionSpecs, listPartitionSpecs, listPartitionSpecsByFilter, listPartitionSpecsByFilter, listPartitionsWithAuthInfo, listPartitionsWithAuthInfo, listPartitionsWithAuthInfo, listPartitionsWithAuthInfo, listPartitionValues, listRoleNames, listTableNamesByFilter, listTableNamesByFilter, lock, lockMaterializationRebuild, mapSchemaVersionToSerde, markPartitionForEvent, markPartitionForEvent, newSynchronizedClient, openTxn, openTxns, partitionNameToSpec, partitionNameToVals, putFileMetadata, reconnect, recycleDirToCmPath, refresh_privileges, removeMasterKey, removeToken, renamePartition, renamePartition, renewDelegationToken, replAllocateTableWriteIdsBatch, replCommitTxn, replOpenTxn, replRollbackTxn, replTableWriteIdState, revoke_privileges, revoke_role, rollbackTxn, setHiveAddedJars, setMetaConf, setPartitionColumnStatistics, setSchemaVersionState, showCompactions, showLocks, showLocks, showTxns, tableExists, tableExists, truncateTable, truncateTable, unlock, updateCreationMetadata, updateCreationMetadata, updateMasterKey, updatePartitionColumnStatistics, updateTableColumnStatistics, validatePartitionNameCharacters, validateResourcePlan

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.hadoop.hive.metastore.IMetaStoreClient

    alter_partition, alter_partitions, alter_table, dropDatabase, dropDatabase, dropPartitions, dropPartitions, dropTable, dropTable
  • Method Details

    • getDatabases

      public List<String> getDatabases(boolean ignoreAuthzErrors) throws org.apache.thrift.TException
      Lists all Hive database names.
      Parameters:
      ignoreAuthzErrors - whether authorization errors should be ignored
      Returns:
      list of Hive databases
      Throws:
      org.apache.thrift.TException - when client fails
    • getHiveReadEntry

      public HiveReadEntry getHiveReadEntry(String dbName, String tableName, boolean ignoreAuthzErrors) throws org.apache.thrift.TException
      Returns table metadata for concrete table
      Parameters:
      dbName - name of database
      tableName - name of table
      Returns:
      HiveReadEntry containing table meta like columns, partitions etc.
      Throws:
      org.apache.thrift.TException - when client fails
    • getTableNamesAndTypes

      public Map<String,org.apache.calcite.schema.Schema.TableType> getTableNamesAndTypes(String dbName, boolean ignoreAuthzErrors) throws org.apache.thrift.TException
      Returns collection of view and table names along with their types.
      Parameters:
      dbName - name of database
      ignoreAuthzErrors - hint for handling authorization errors
      Returns:
      map where keys are db object names values are types (VIEW or TABLE)
      Throws:
      org.apache.thrift.TException - in case when if loader thrown ExecutionException
    • getDelegationToken

      public String getDelegationToken(String owner, String renewerKerberosPrincipalName) throws org.apache.thrift.TException
      Overridden to enforce synchronization.
      Specified by:
      getDelegationToken in interface org.apache.hadoop.hive.metastore.IMetaStoreClient
      Overrides:
      getDelegationToken in class org.apache.hadoop.hive.metastore.HiveMetaStoreClient
      Parameters:
      owner - the intended owner for the token
      renewerKerberosPrincipalName - kerberos user
      Returns:
      the string of the token
      Throws:
      org.apache.thrift.TException - when client fails