Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.service.CatalogOpExecutor Class Reference
Collaboration diagram for com.cloudera.impala.service.CatalogOpExecutor:

Public Member Functions

 CatalogOpExecutor (CatalogServiceCatalog catalog)
 
TDdlExecResponse execDdlRequest (TDdlExecRequest ddlRequest) throws ImpalaException
 
long updateLastDdlTime (org.apache.hadoop.hive.metastore.api.Table msTbl, MetaStoreClient msClient) throws MetaException, NoSuchObjectException, TException
 
TResetMetadataResponse execResetMetadata (TResetMetadataRequest req) throws CatalogException
 
TUpdateCatalogResponse updateCatalog (TUpdateCatalogRequest update) throws ImpalaException
 
Table getExistingTable (String dbName, String tblName) throws CatalogException
 

Static Public Member Functions

static List< FieldSchema > buildFieldSchemaList (List< TColumn > columns)
 
static
org.apache.hadoop.hive.metastore.api.Table 
createMetaStoreTable (TCreateTableParams params)
 

Private Member Functions

void alterTable (TAlterTableParams params, TDdlExecResponse response) throws ImpalaException
 
Table addHdfsPartition (TableName tableName, Partition partition) throws CatalogException
 
void alterView (TCreateOrAlterViewParams params, TDdlExecResponse resp) throws ImpalaException
 
void alterTableUpdateStats (TAlterTableUpdateStatsParams params, TDdlExecResponse resp) throws ImpalaException
 
int updateTableStats (Table table, TAlterTableUpdateStatsParams params, org.apache.hadoop.hive.metastore.api.Table msTbl, List< HdfsPartition > partitions, List< HdfsPartition > modifiedParts) throws ImpalaException
 
void createDatabase (TCreateDbParams params, TDdlExecResponse resp) throws ImpalaException
 
void createFunction (TCreateFunctionParams params, TDdlExecResponse resp) throws ImpalaException
 
void createDataSource (TCreateDataSourceParams params, TDdlExecResponse resp) throws ImpalaException
 
void dropDataSource (TDropDataSourceParams params, TDdlExecResponse resp) throws ImpalaException
 
void dropStats (TDropStatsParams params, TDdlExecResponse resp) throws ImpalaException
 
int dropColumnStats (Table table) throws ImpalaRuntimeException
 
int dropTableStats (Table table) throws ImpalaRuntimeException
 
void dropDatabase (TDropDbParams params, TDdlExecResponse resp) throws ImpalaException
 
void dropTableOrView (TDropTableOrViewParams params, TDdlExecResponse resp) throws ImpalaException
 
void dropFunction (TDropFunctionParams params, TDdlExecResponse resp) throws ImpalaException
 
boolean createTable (TCreateTableParams params, TDdlExecResponse response) throws ImpalaException
 
void createView (TCreateOrAlterViewParams params, TDdlExecResponse response) throws ImpalaException
 
void createTableLike (TCreateTableLikeParams params, TDdlExecResponse response) throws ImpalaException
 
boolean createTable (org.apache.hadoop.hive.metastore.api.Table newTable, boolean ifNotExists, THdfsCachingOp cacheOp, TDdlExecResponse response) throws ImpalaException
 
void setViewAttributes (TCreateOrAlterViewParams params, org.apache.hadoop.hive.metastore.api.Table view)
 
void alterTableAddReplaceCols (TableName tableName, List< TColumn > columns, boolean replaceExistingCols) throws ImpalaException
 
void alterTableChangeCol (TableName tableName, String colName, TColumn newCol) throws ImpalaException
 
Table alterTableAddPartition (TableName tableName, List< TPartitionKeyValue > partitionSpec, boolean ifNotExists, String location, THdfsCachingOp cacheOp) throws ImpalaException
 
Table alterTableDropPartition (TableName tableName, List< TPartitionKeyValue > partitionSpec, boolean ifExists) throws ImpalaException
 
void alterTableDropCol (TableName tableName, String colName) throws ImpalaException
 
void alterTableOrViewRename (TableName tableName, TableName newTableName, TDdlExecResponse response) throws ImpalaException
 
void alterTableSetFileFormat (TableName tableName, List< TPartitionKeyValue > partitionSpec, THdfsFileFormat fileFormat) throws ImpalaException
 
void alterTableSetLocation (TableName tableName, List< TPartitionKeyValue > partitionSpec, String location) throws ImpalaException
 
void alterTableSetTblProperties (TableName tableName, TAlterTableSetTblPropertiesParams params) throws ImpalaException
 
void alterTableSetCached (TableName tableName, TAlterTableSetCachedParams params) throws ImpalaException
 
void alterPartitionSetCached (TableName tableName, TAlterTableSetCachedParams params) throws ImpalaException
 
void applyAlterTable (org.apache.hadoop.hive.metastore.api.Table msTbl) throws ImpalaRuntimeException
 
void applyAlterPartition (TableName tableName, HdfsPartition partition) throws ImpalaException
 
void createDropRole (User requestingUser, TCreateDropRoleParams createDropRoleParams, TDdlExecResponse resp) throws ImpalaException
 
void grantRevokeRoleGroup (User requestingUser, TGrantRevokeRoleParams grantRevokeRoleParams, TDdlExecResponse resp) throws ImpalaException
 
void grantRevokeRolePrivilege (User requestingUser, TGrantRevokePrivParams grantRevokePrivParams, TDdlExecResponse resp) throws ImpalaException
 
void verifySentryServiceEnabled () throws CatalogException
 
void bulkAlterPartitions (String dbName, String tableName, List< HdfsPartition > modifiedParts) throws ImpalaRuntimeException
 
org.apache.hadoop.hive.metastore.api.Table getMetaStoreTable (TableName tableName) throws CatalogException
 
List< String > getPartValsFromName (org.apache.hadoop.hive.metastore.api.Table msTbl, String partName) throws MetaException, CatalogException
 

Static Private Member Functions

static ColumnStatistics createHiveColStats (Map< String, TColumnStats > columnStats, Table table)
 
static ColumnStatisticsData createHiveColStatsData (TColumnStats colStats, Type colType)
 
static void setStorageDescriptorFileFormat (StorageDescriptor sd, THdfsFileFormat fileFormat)
 
static TCatalogObject TableToTCatalogObject (Table table)
 
static long calculateDdlTime (org.apache.hadoop.hive.metastore.api.Table msTbl)
 

Private Attributes

final CatalogServiceCatalog catalog_
 
final Object metastoreDdlLock_ = new Object()
 

Static Private Attributes

static final String HMS_RPC_ERROR_FORMAT_STR
 
static final Logger LOG = Logger.getLogger(CatalogOpExecutor.class)
 
static final short MAX_PARTITION_UPDATES_PER_RPC = 500
 

Detailed Description

Class used to execute Catalog Operations, including DDL and refresh/invalidate metadata requests. Acts as a bridge between the Thrift catalog operation requests and the non-thrift Java Catalog objects. TODO: Create a Hive Metastore utility class to move code that interacts with the metastore out of this class.

Definition at line 154 of file CatalogOpExecutor.java.

Constructor & Destructor Documentation

com.cloudera.impala.service.CatalogOpExecutor.CatalogOpExecutor ( CatalogServiceCatalog  catalog)
inline

Member Function Documentation

Table com.cloudera.impala.service.CatalogOpExecutor.addHdfsPartition ( TableName  tableName,
Partition  partition 
) throws CatalogException
inlineprivate

Creates a new HdfsPartition object and adds it to the corresponding HdfsTable. Does not create the object in the Hive metastore.

Definition at line 368 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.getExistingTable().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition().

void com.cloudera.impala.service.CatalogOpExecutor.alterPartitionSetCached ( TableName  tableName,
TAlterTableSetCachedParams  params 
) throws ImpalaException
inlineprivate

Caches or uncaches the HDFS location of the target partition and updates the partition's metadata in Hive Metastore Store. If a partition is being cached, the partition properties will have the ID of the cache directive added. If the partition is being uncached, any outstanding cache directive will be dropped and the cache directive ID property key will be cleared.

Definition at line 1796 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.catalog.HdfsPartition.getParameters(), com.cloudera.impala.catalog.HdfsPartition.isMarkedCached(), com.cloudera.impala.util.HdfsCachingUtil.isUpdateOp(), and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().

Table com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition ( TableName  tableName,
List< TPartitionKeyValue >  partitionSpec,
boolean  ifNotExists,
String  location,
THdfsCachingOp  cacheOp 
) throws ImpalaException
inlineprivate

Adds a new partition to the given table in Hive. Also creates and adds a new HdfsPartition to the corresponding HdfsTable. If cacheOp is not null, the partition's location will be cached according to the cacheOp. If cacheOp is null, the new partition will inherit the the caching properties of the parent table. Returns null if the partition already exists in Hive and "IfNotExists" is true. Otherwise, returns the table object with an updated catalog version.

Definition at line 1306 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.addHdfsPartition(), com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsHdfsPartition(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().

void com.cloudera.impala.service.CatalogOpExecutor.alterTableAddReplaceCols ( TableName  tableName,
List< TColumn >  columns,
boolean  replaceExistingCols 
) throws ImpalaException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.alterTableChangeCol ( TableName  tableName,
String  colName,
TColumn  newCol 
) throws ImpalaException
inlineprivate

Changes the column definition of an existing column. This can be used to rename a column, add a comment to a column, or change the datatype of a column.

Definition at line 1270 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().

void com.cloudera.impala.service.CatalogOpExecutor.alterTableDropCol ( TableName  tableName,
String  colName 
) throws ImpalaException
inlineprivate
Table com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition ( TableName  tableName,
List< TPartitionKeyValue >  partitionSpec,
boolean  ifExists 
) throws ImpalaException
inlineprivate

Drops an existing partition from the given table in Hive. If the partition is cached, the associated cache directive will also be removed. Also drops the partition from its Hdfs table. Returns the table object with an updated catalog version. If the partition does not exist and "IfExists" is true, null is returned.

Definition at line 1406 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsHdfsPartition(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.catalog.HdfsPartition.isMarkedCached(), com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().

void com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename ( TableName  tableName,
TableName  newTableName,
TDdlExecResponse  response 
) throws ImpalaException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.alterTableSetCached ( TableName  tableName,
TAlterTableSetCachedParams  params 
) throws ImpalaException
inlineprivate

Caches or uncaches the HDFS location of the target table and updates the table's metadata in Hive Metastore Store. If this is a partitioned table, all uncached partitions will also be cached. The table/partition metadata will be updated to include the ID of each cache directive that was submitted. If the table is being uncached, any outstanding cache directives will be dropped and the cache directive ID property key will be cleared.

Definition at line 1680 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), com.cloudera.impala.catalog.HdfsTable.getPartitions(), and com.cloudera.impala.util.HdfsCachingUtil.isUpdateOp().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().

void com.cloudera.impala.service.CatalogOpExecutor.alterTableSetFileFormat ( TableName  tableName,
List< TPartitionKeyValue >  partitionSpec,
THdfsFileFormat  fileFormat 
) throws ImpalaException
inlineprivate

Changes the file format for the given table or partition. This is a metadata only operation, existing table data will not be converted to the new format. After changing the file format the table metadata is marked as invalid and will be reloaded on the next access.

Definition at line 1560 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.setStorageDescriptorFileFormat().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTable().

void com.cloudera.impala.service.CatalogOpExecutor.alterTableSetLocation ( TableName  tableName,
List< TPartitionKeyValue >  partitionSpec,
String  location 
) throws ImpalaException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.alterTableSetTblProperties ( TableName  tableName,
TAlterTableSetTblPropertiesParams  params 
) throws ImpalaException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.alterView ( TCreateOrAlterViewParams  params,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable ( org.apache.hadoop.hive.metastore.api.Table  msTbl) throws ImpalaRuntimeException
inlineprivate

Applies an ALTER TABLE command to the metastore table. The caller should take the metastoreDdlLock before calling this method. Note: The metastore interface is not very safe because it only accepts an entire metastore.api.Table object rather than a delta of what to change. This means an external modification to the table could be overwritten by an ALTER TABLE command if the metadata is not completely in-sync. This affects both Hive and Impala, but is more important in Impala because the metadata is cached for a longer period of time.

Definition at line 1853 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.calculateDdlTime(), and com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR.

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddReplaceCols(), com.cloudera.impala.service.CatalogOpExecutor.alterTableChangeCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropCol(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetFileFormat(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetLocation(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetTblProperties(), com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats(), com.cloudera.impala.service.CatalogOpExecutor.alterView(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), and com.cloudera.impala.service.CatalogOpExecutor.dropTableStats().

static List<FieldSchema> com.cloudera.impala.service.CatalogOpExecutor.buildFieldSchemaList ( List< TColumn >  columns)
inlinestatic
void com.cloudera.impala.service.CatalogOpExecutor.bulkAlterPartitions ( String  dbName,
String  tableName,
List< HdfsPartition modifiedParts 
) throws ImpalaRuntimeException
inlineprivate
static long com.cloudera.impala.service.CatalogOpExecutor.calculateDdlTime ( org.apache.hadoop.hive.metastore.api.Table  msTbl)
inlinestaticprivate
void com.cloudera.impala.service.CatalogOpExecutor.createDatabase ( TCreateDbParams  params,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate

Creates a new database in the metastore and adds the db name to the internal metadata cache, marking its metadata to be lazily loaded on the next access. Re-throws any Hive Meta Store exceptions encountered during the create, these may vary depending on the Meta Store connection type (thrift vs direct db).

Definition at line 658 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogVersion(), com.cloudera.impala.catalog.Catalog.getDb(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.catalog.Catalog.INITIAL_CATALOG_VERSION, and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.

Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().

void com.cloudera.impala.service.CatalogOpExecutor.createDataSource ( TCreateDataSourceParams  params,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.createDropRole ( User  requestingUser,
TCreateDropRoleParams  createDropRoleParams,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate

Creates or drops a Sentry role on behalf of the requestingUser.

Definition at line 1891 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.verifySentryServiceEnabled().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().

void com.cloudera.impala.service.CatalogOpExecutor.createFunction ( TCreateFunctionParams  params,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate
static ColumnStatistics com.cloudera.impala.service.CatalogOpExecutor.createHiveColStats ( Map< String, TColumnStats >  columnStats,
Table  table 
)
inlinestaticprivate

Create Hive column statistics for the given table based on the give map from column name to column stats. Missing or new columns as a result of concurrent table alterations are ignored.

Definition at line 580 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.createHiveColStatsData(), com.cloudera.impala.catalog.Table.getDb(), and com.cloudera.impala.catalog.Table.getName().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), and com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats().

static ColumnStatisticsData com.cloudera.impala.service.CatalogOpExecutor.createHiveColStatsData ( TColumnStats  colStats,
Type  colType 
)
inlinestaticprivate
static org.apache.hadoop.hive.metastore.api.Table com.cloudera.impala.service.CatalogOpExecutor.createMetaStoreTable ( TCreateTableParams  params)
inlinestatic

Utility function that creates a hive.metastore.api.Table object based on the given TCreateTableParams. TODO: Extract metastore object creation utility functions into a separate helper/factory class.

Definition at line 2122 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.buildFieldSchemaList(), and com.cloudera.impala.catalog.RowFormat.fromThrift().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.createTable().

boolean com.cloudera.impala.service.CatalogOpExecutor.createTable ( TCreateTableParams  params,
TDdlExecResponse  response 
) throws ImpalaException
inlineprivate
boolean com.cloudera.impala.service.CatalogOpExecutor.createTable ( org.apache.hadoop.hive.metastore.api.Table  newTable,
boolean  ifNotExists,
THdfsCachingOp  cacheOp,
TDdlExecResponse  response 
) throws ImpalaException
inlineprivate

Creates a new table in the HMS. If ifNotExists=true, no error will be thrown if the table already exists, otherwise an exception will be thrown. Accepts an optional 'cacheOp' param, which if specified will cache the table's HDFS location according to the 'cacheOp' spec after creation. Stores details of the operations (such as the resulting catalog version) in 'response' output parameter. Returns true if a new table was created as part of this call, false otherwise.

Definition at line 1172 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject().

void com.cloudera.impala.service.CatalogOpExecutor.createTableLike ( TCreateTableLikeParams  params,
TDdlExecResponse  response 
) throws ImpalaException
inlineprivate

Creates a new table in the metastore based on the definition of an existing table. No data is copied as part of this process, it is a metadata only operation. If the creation succeeds, an entry is added to the metadata cache to lazily load the new table's metadata on the next access.

Definition at line 1104 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsTable(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogVersion(), com.cloudera.impala.analysis.TableName.getDb(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), and com.cloudera.impala.service.CatalogOpExecutor.setStorageDescriptorFileFormat().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().

void com.cloudera.impala.service.CatalogOpExecutor.createView ( TCreateOrAlterViewParams  params,
TDdlExecResponse  response 
) throws ImpalaException
inlineprivate

Creates a new view in the metastore and adds an entry to the metadata cache to lazily load the new metadata on the next access. Re-throws any Metastore exceptions encountered during the create.

Definition at line 1077 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.catalog.Catalog.containsTable(), com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.analysis.TableName.getDb(), and com.cloudera.impala.service.CatalogOpExecutor.setViewAttributes().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().

int com.cloudera.impala.service.CatalogOpExecutor.dropColumnStats ( Table  table) throws ImpalaRuntimeException
inlineprivate

Drops all column stats from the table in the HMS. Returns the number of columns that were updated as part of this operation.

Definition at line 827 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, and com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_.

Referenced by com.cloudera.impala.service.CatalogOpExecutor.dropStats().

void com.cloudera.impala.service.CatalogOpExecutor.dropDatabase ( TDropDbParams  params,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate

Drops a database from the metastore and removes the database's metadata from the internal cache. The database must be empty (contain no tables) for the drop operation to succeed. Re-throws any Hive Meta Store exceptions encountered during the drop.

Definition at line 916 of file CatalogOpExecutor.java.

References com.cloudera.impala.catalog.Db.getName(), com.cloudera.impala.service.CatalogOpExecutor.HMS_RPC_ERROR_FORMAT_STR, com.cloudera.impala.service.CatalogOpExecutor.metastoreDdlLock_, and com.cloudera.impala.catalog.Db.numFunctions().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().

void com.cloudera.impala.service.CatalogOpExecutor.dropDataSource ( TDropDataSourceParams  params,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.dropFunction ( TDropFunctionParams  params,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.dropTableOrView ( TDropTableOrViewParams  params,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate
int com.cloudera.impala.service.CatalogOpExecutor.dropTableStats ( Table  table) throws ImpalaRuntimeException
inlineprivate

Drops all table and partition stats from this table in the HMS. Partitions are updated in batches of MAX_PARTITION_UPDATES_PER_RPC. Returns the number of partitions updated as part of this operation, or 1 if the table is unpartitioned.

Definition at line 865 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.applyAlterTable(), com.cloudera.impala.service.CatalogOpExecutor.bulkAlterPartitions(), and com.cloudera.impala.catalog.HdfsTable.getPartitions().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.dropStats().

TResetMetadataResponse com.cloudera.impala.service.CatalogOpExecutor.execResetMetadata ( TResetMetadataRequest  req) throws CatalogException
inline

Executes a TResetMetadataRequest and returns the result as a TResetMetadataResponse. Based on the request parameters, this operation may do one of three things: 1) invalidate the entire catalog, forcing the metadata for all catalog objects to be reloaded. 2) invalidate a specific table, forcing the metadata to be reloaded on the next access. 3) perform a synchronous incremental refresh of a specific table.

For details on the specific commands see comments on their respective methods in CatalogServiceCatalog.java.

Definition at line 2185 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.JniCatalog.getServiceId(), and com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject().

Table com.cloudera.impala.service.CatalogOpExecutor.getExistingTable ( String  dbName,
String  tblName 
) throws CatalogException
inline

Returns an existing, loaded table from the Catalog. Throws an exception if any of the following are true:

  • The table does not exist
  • There was an error loading the table metadata.
  • The table is missing (not yet loaded). This is to help protect against certain scenarios where the table was modified or dropped between the time analysis completed and the the catalog op started executing. However, even with these checks it is possible the table was modified or dropped/re-created without us knowing. TODO: Track object IDs to know when a table has been dropped and re-created with the same name.

Definition at line 2468 of file CatalogOpExecutor.java.

References com.cloudera.impala.catalog.Table.isLoaded().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.addHdfsPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableOrViewRename(), com.cloudera.impala.service.CatalogOpExecutor.alterTableSetCached(), com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats(), com.cloudera.impala.service.CatalogOpExecutor.createTableLike(), com.cloudera.impala.service.CatalogOpExecutor.dropStats(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), and com.cloudera.impala.service.CatalogOpExecutor.updateCatalog().

List<String> com.cloudera.impala.service.CatalogOpExecutor.getPartValsFromName ( org.apache.hadoop.hive.metastore.api.Table  msTbl,
String  partName 
) throws MetaException, CatalogException
inlineprivate
void com.cloudera.impala.service.CatalogOpExecutor.grantRevokeRoleGroup ( User  requestingUser,
TGrantRevokeRoleParams  grantRevokeRoleParams,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate

Grants or revokes a Sentry role to/from the given group on behalf of the requestingUser.

Definition at line 1927 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.verifySentryServiceEnabled().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().

void com.cloudera.impala.service.CatalogOpExecutor.grantRevokeRolePrivilege ( User  requestingUser,
TGrantRevokePrivParams  grantRevokePrivParams,
TDdlExecResponse  resp 
) throws ImpalaException
inlineprivate

Grants or revokes one or more privileges to/from a Sentry role on behalf of the requestingUser.

Definition at line 1956 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.verifySentryServiceEnabled().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.execDdlRequest().

static void com.cloudera.impala.service.CatalogOpExecutor.setStorageDescriptorFileFormat ( StorageDescriptor  sd,
THdfsFileFormat  fileFormat 
)
inlinestaticprivate
void com.cloudera.impala.service.CatalogOpExecutor.setViewAttributes ( TCreateOrAlterViewParams  params,
org.apache.hadoop.hive.metastore.api.Table  view 
)
inlineprivate
TUpdateCatalogResponse com.cloudera.impala.service.CatalogOpExecutor.updateCatalog ( TUpdateCatalogRequest  update) throws ImpalaException
inline

Create any new partitions required as a result of an INSERT statement and refreshes the table metadata after every INSERT statement. Any new partitions will inherit their cache configuration from the parent table. That is, if the parent is cached new partitions created will also be cached and will be put in the same pool as the parent. If the insert touched any pre-existing partitions that were cached, a request to watch the associated cache directives will be submitted. This will result in an async table refresh once the cache request completes. Updates the lastDdlTime of the table if new partitions were created.

Definition at line 2261 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.catalog_, com.cloudera.impala.analysis.TableName.getDb(), com.cloudera.impala.catalog.Table.getDb(), com.cloudera.impala.service.CatalogOpExecutor.getExistingTable(), com.cloudera.impala.service.CatalogOpExecutor.getMetaStoreTable(), com.cloudera.impala.catalog.Table.getName(), com.cloudera.impala.catalog.Table.getNumClusteringCols(), com.cloudera.impala.service.CatalogOpExecutor.getPartValsFromName(), com.cloudera.impala.service.JniCatalog.getServiceId(), com.cloudera.impala.service.CatalogOpExecutor.TableToTCatalogObject(), com.cloudera.impala.analysis.TableName.toThrift(), com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime(), and com.cloudera.impala.catalog.CatalogServiceCatalog.watchCacheDirs().

long com.cloudera.impala.service.CatalogOpExecutor.updateLastDdlTime ( org.apache.hadoop.hive.metastore.api.Table  msTbl,
MetaStoreClient  msClient 
) throws MetaException, NoSuchObjectException, TException
inline

Sets the table parameter 'transient_lastDdlTime' to System.currentTimeMillis()/1000 in the given msTbl. 'transient_lastDdlTime' is guaranteed to be changed. If msClient is not null then this method applies alter_table() to update the Metastore. Otherwise, the caller is responsible for the final update.

Definition at line 2087 of file CatalogOpExecutor.java.

References com.cloudera.impala.service.CatalogOpExecutor.calculateDdlTime().

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition(), com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition(), com.cloudera.impala.service.CatalogOpExecutor.applyAlterPartition(), and com.cloudera.impala.service.CatalogOpExecutor.updateCatalog().

int com.cloudera.impala.service.CatalogOpExecutor.updateTableStats ( Table  table,
TAlterTableUpdateStatsParams  params,
org.apache.hadoop.hive.metastore.api.Table  msTbl,
List< HdfsPartition partitions,
List< HdfsPartition modifiedParts 
) throws ImpalaException
inlineprivate

Updates the row counts of the given Hive partitions and the total row count of the given Hive table based on the given update stats parameters. The partitions whose row counts have not changed are skipped. The modified partitions are returned in the modifiedParts parameter. Row counts for missing or new partitions as a result of concurrent table alterations are set to 0. Returns the number of partitions that were targeted for update (includes partitions whose row counts have not changed).

Definition at line 501 of file CatalogOpExecutor.java.

Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableUpdateStats().

Member Data Documentation

final Logger com.cloudera.impala.service.CatalogOpExecutor.LOG = Logger.getLogger(CatalogOpExecutor.class)
staticprivate
final short com.cloudera.impala.service.CatalogOpExecutor.MAX_PARTITION_UPDATES_PER_RPC = 500
staticprivate

The documentation for this class was generated from the following file: