Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Public Member Functions | |
ImpaladTestCatalog () | |
ImpaladTestCatalog (AuthorizationConfig authzConfig) | |
HdfsCachePool | getHdfsCachePool (String poolName) |
void | reset () throws CatalogException |
Table | getTable (String dbName, String tableName) throws CatalogException |
synchronized TUpdateCatalogCacheResponse | updateCatalog (TUpdateCatalogCacheRequest req) throws CatalogException |
void | waitForCatalogUpdate (long timeoutMs) |
Path | getTablePath (org.apache.hadoop.hive.metastore.api.Table msTbl) throws NoSuchObjectException, MetaException, TException |
Db | addDb (Db db) |
boolean | addFunction (Function fn) |
boolean | addDataSource (DataSource dataSource) |
DataSource | removeDataSource (String dataSourceName) |
Db | removeDb (String dbName) |
Table | removeTable (TTableName tableName) |
Function | removeFunction (Function desc) |
boolean | isReady () |
void | setIsReady () |
AuthorizationPolicy | getAuthPolicy () |
Db | getBuiltinsDb () |
Db | getDb (String dbName) |
List< String > | getDbNames (String dbPattern) |
List< String > | getTableNames (String dbName, String tablePattern) throws DatabaseNotFoundException |
boolean | containsTable (String dbName, String tableName) |
DataSource | getDataSource (String dataSourceName) |
List< DataSource > | getDataSources () |
List< DataSource > | getDataSources (String pattern) |
List< String > | getDataSourceNames (String pattern) |
Function | getFunction (Function desc, Function.CompareMode mode) |
boolean | containsFunction (FunctionName name) |
boolean | addHdfsCachePool (HdfsCachePool cachePool) |
void | close () |
MetaStoreClient | getMetaStoreClient () |
HdfsPartition | getHdfsPartition (String dbName, String tableName, List< TPartitionKeyValue > partitionSpec) throws CatalogException |
boolean | containsHdfsPartition (String dbName, String tableName, List< TPartitionKeyValue > partitionSpec) throws CatalogException |
TCatalogObject | getTCatalogObject (TCatalogObject objectDesc) throws CatalogException |
Static Public Member Functions | |
static Function | getBuiltin (Function desc, Function.CompareMode mode) |
Static Public Attributes | |
static final long | INITIAL_CATALOG_VERSION = 0L |
static final String | DEFAULT_DB = "default" |
static final String | BUILTINS_DB = "_impala_builtins" |
Protected Attributes | |
final MetaStoreClientPool | metaStoreClientPool_ = new MetaStoreClientPool(0) |
AuthorizationPolicy | authPolicy_ = new AuthorizationPolicy() |
AtomicReference < ConcurrentHashMap< String, Db > > | dbCache_ |
final CatalogObjectCache < DataSource > | dataSources_ |
final CatalogObjectCache < HdfsCachePool > | hdfsCachePools_ |
Private Attributes | |
final CatalogServiceCatalog | srcCatalog_ |
Mock catalog used for running FE tests that allows lazy-loading of tables without a running catalogd/statestored.
Definition at line 30 of file ImpaladTestCatalog.java.
|
inline |
Definition at line 34 of file ImpaladTestCatalog.java.
|
inline |
Takes an AuthorizationConfig to bootstrap the backing CatalogServiceCatalog.
Definition at line 41 of file ImpaladTestCatalog.java.
References com.cloudera.impala.catalog.ImpaladCatalog.addDb(), com.cloudera.impala.catalog.Catalog.authPolicy_, com.cloudera.impala.catalog.Catalog.getDb(), com.cloudera.impala.catalog.Catalog.getDbNames(), com.cloudera.impala.catalog.ImpaladCatalog.setIsReady(), and com.cloudera.impala.testutil.ImpaladTestCatalog.srcCatalog_.
|
inlineinherited |
Adds a data source to the in-memory map of data sources. It is not persisted to the metastore.
Definition at line 197 of file Catalog.java.
Adds a new database to the catalog, replacing any existing database with the same name. Returns the previous database with this name, or null if there was no previous database.
Definition at line 107 of file Catalog.java.
References com.cloudera.impala.catalog.Db.getName().
Referenced by com.cloudera.impala.catalog.Catalog.Catalog().
|
inlineinherited |
Adds a function to the catalog. Returns true if the function was successfully added. Returns false if the function already exists. TODO: allow adding a function to a global scope. We probably want this to resolve after the local scope. e.g. if we had fn() and db.fn(). If the current database is 'db', fn() would resolve first to db.fn().
Definition at line 259 of file Catalog.java.
References com.cloudera.impala.catalog.Function.dbName(), and com.cloudera.impala.catalog.Catalog.getDb().
|
inlineinherited |
Adds a new HdfsCachePool to the catalog.
Definition at line 304 of file Catalog.java.
|
inlineinherited |
Release the Hive Meta Store Client resources. Can be called multiple times (additional calls will be no-ops).
Definition at line 320 of file Catalog.java.
|
inlineinherited |
Returns true if there is a function with this function name. Parameters are ignored.
Definition at line 295 of file Catalog.java.
References com.cloudera.impala.analysis.FunctionName.getDb(), and com.cloudera.impala.catalog.Catalog.getDb().
|
inlineinherited |
Returns true if the table contains the given partition spec, otherwise false. This may trigger a metadata load if the table metadata is not yet cached.
DatabaseNotFoundException | - If the database does not exist. |
TableNotFoundException | - If the table does not exist. |
TableLoadingException | - If there is an error loading the table metadata. |
Definition at line 384 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.getHdfsPartition().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.alterTableAddPartition(), and com.cloudera.impala.service.CatalogOpExecutor.alterTableDropPartition().
|
inlineinherited |
Returns true if the table and the database exist in the Impala Catalog. Returns false if either the table or the database do not exist.
Definition at line 187 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.getDb().
Referenced by com.cloudera.impala.service.CatalogOpExecutor.createTable(), com.cloudera.impala.service.CatalogOpExecutor.createTableLike(), and com.cloudera.impala.service.CatalogOpExecutor.createView().
|
inlineinherited |
Definition at line 447 of file ImpaladCatalog.java.
References com.cloudera.impala.catalog.Catalog.authPolicy_.
Referenced by com.cloudera.impala.service.Frontend.Frontend(), and com.cloudera.impala.service.Frontend.updateCatalogCache().
|
inlinestaticinherited |
Definition at line 276 of file Catalog.java.
|
inlineinherited |
Definition at line 100 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.builtinsDb_.
|
inlineinherited |
Gets the specified data source.
Definition at line 213 of file Catalog.java.
Referenced by com.cloudera.impala.service.CatalogOpExecutor.createDataSource(), and com.cloudera.impala.catalog.Catalog.getTCatalogObject().
|
inlineinherited |
Returns a list of data sources names that match pattern. See filterStringsByPattern for details of the pattern match semantics.
pattern may be null (and thus matches everything).
Definition at line 231 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.dataSources_, and com.cloudera.impala.catalog.Catalog.filterStringsByPattern().
|
inlineinherited |
Gets a list of all data sources.
Definition at line 221 of file Catalog.java.
Referenced by com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogObjects().
|
inlineinherited |
Returns a list of data sources that match pattern. See filterStringsByPattern for details of the pattern match semantics.
pattern may be null (and thus matches everything).
Definition at line 241 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.dataSources_, com.cloudera.impala.catalog.Catalog.filterStringsByPattern(), and impala.name.
|
inlineinherited |
Gets the Db object from the Catalog using a case-insensitive lookup on the name. Returns null if no matching database is found.
Definition at line 115 of file Catalog.java.
Referenced by com.cloudera.impala.catalog.ImpaladCatalog.addDb(), com.cloudera.impala.catalog.Catalog.addFunction(), com.cloudera.impala.catalog.ImpaladCatalog.addFunction(), com.cloudera.impala.catalog.CatalogServiceCatalog.addFunction(), com.cloudera.impala.catalog.CatalogServiceCatalog.addPartition(), com.cloudera.impala.catalog.ImpaladCatalog.addTable(), com.cloudera.impala.catalog.CatalogServiceCatalog.addTable(), com.cloudera.impala.catalog.Catalog.containsFunction(), com.cloudera.impala.catalog.Catalog.containsTable(), com.cloudera.impala.service.CatalogOpExecutor.createDatabase(), com.cloudera.impala.catalog.TableLoadingMgr.LoadRequest.get(), com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogObjects(), com.cloudera.impala.catalog.Catalog.getFunction(), com.cloudera.impala.catalog.CatalogServiceCatalog.getFunctions(), com.cloudera.impala.testutil.ImpaladTestCatalog.getTable(), com.cloudera.impala.catalog.Catalog.getTable(), com.cloudera.impala.catalog.Catalog.getTableNames(), com.cloudera.impala.catalog.Catalog.getTCatalogObject(), com.cloudera.impala.testutil.ImpaladTestCatalog.ImpaladTestCatalog(), com.cloudera.impala.catalog.CatalogServiceCatalog.invalidateTable(), com.cloudera.impala.catalog.ImpaladCatalog.removeDb(), com.cloudera.impala.catalog.Catalog.removeFunction(), com.cloudera.impala.catalog.ImpaladCatalog.removeFunction(), com.cloudera.impala.catalog.Catalog.removeTable(), com.cloudera.impala.catalog.ImpaladCatalog.removeTable(), com.cloudera.impala.catalog.CatalogServiceCatalog.removeTable(), com.cloudera.impala.catalog.CatalogServiceCatalog.renameTable(), com.cloudera.impala.catalog.CatalogServiceCatalog.replaceTableIfUnchanged(), com.cloudera.impala.catalog.CatalogTest.testStats(), com.cloudera.impala.analysis.AuthorizationTest.TestTPCHCleanup(), and com.cloudera.impala.catalog.CatalogServiceCatalog.updateLastDdlTime().
|
inlineinherited |
Returns a list of databases that match dbPattern. See filterStringsByPattern for details of the pattern match semantics.
dbPattern may be null (and thus matches everything).
Definition at line 136 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.dbCache_, and com.cloudera.impala.catalog.Catalog.filterStringsByPattern().
Referenced by com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogObjects(), com.cloudera.impala.testutil.ImpaladTestCatalog.ImpaladTestCatalog(), and com.cloudera.impala.testutil.BlockIdGenerator.main().
|
inlineinherited |
Returns the function that best matches 'desc' that is registered with the catalog using 'mode' to check for matching. If desc matches multiple functions in the catalog, it will return the function with the strictest matching mode.
Definition at line 270 of file Catalog.java.
References com.cloudera.impala.catalog.Function.dbName(), and com.cloudera.impala.catalog.Catalog.getDb().
Referenced by com.cloudera.impala.catalog.Catalog.getTCatalogObject().
|
inline |
Definition at line 56 of file ImpaladTestCatalog.java.
|
inlineinherited |
Returns the HdfsPartition object for the given dbName/tableName and partition spec. This will trigger a metadata load if the table metadata is not yet cached.
DatabaseNotFoundException | - If the database does not exist. |
TableNotFoundException | - If the table does not exist. |
PartitionNotFoundException | - If the partition does not exist. |
TableLoadingException | - If there is an error loading the table metadata. |
Definition at line 361 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.getTable().
Referenced by com.cloudera.impala.catalog.Catalog.containsHdfsPartition().
|
inlineinherited |
Returns a managed meta store client from the client connection pool.
Definition at line 326 of file Catalog.java.
Referenced by com.cloudera.impala.catalog.ImpaladCatalog.getTablePath(), and com.cloudera.impala.catalog.CatalogServiceCatalog.invalidateTable().
|
inline |
Overrides ImpaladCatalog.getTable to load the table metadata if it is missing.
Definition at line 71 of file ImpaladTestCatalog.java.
References com.cloudera.impala.catalog.Catalog.getDb(), and com.cloudera.impala.catalog.Table.isLoaded().
|
inlineinherited |
Returns a list of tables in the supplied database that match tablePattern. See filterStringsByPattern for details of the pattern match semantics.
dbName must not be null, but tablePattern may be null (and thus matches everything).
Table names are returned unqualified.
Definition at line 173 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.filterStringsByPattern(), and com.cloudera.impala.catalog.Catalog.getDb().
|
inlineinherited |
Returns the HDFS path where the metastore would create the given table. If the table has a "location" set, that will be returned. Otherwise the path will be resolved based on the location of the parent database. The metastore folder hierarchy is: <warehouse directory>="">/<db name>="">.db/
for items in the default database which will be: <warehouse directory>="">/
method handles both of these cases.
Definition at line 205 of file ImpaladCatalog.java.
References com.cloudera.impala.catalog.Catalog.getMetaStoreClient().
|
inlineinherited |
Gets the thrift representation of a catalog object, given the "object description". The object description is just a TCatalogObject with only the catalog object type and object name set. If the object is not found, a CatalogException is thrown.
Definition at line 399 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.getDataSource(), com.cloudera.impala.catalog.Catalog.getDb(), com.cloudera.impala.catalog.Catalog.getFunction(), com.cloudera.impala.catalog.Catalog.getHdfsCachePool(), com.cloudera.impala.catalog.Role.getName(), com.cloudera.impala.catalog.Role.getPrivileges(), com.cloudera.impala.catalog.Catalog.getTable(), and pool.
|
inlineinherited |
Returns true if the ImpaladCatalog is ready to accept requests (has received and processed a valid catalog topic update from the StateStore), false otherwise.
Definition at line 443 of file ImpaladCatalog.java.
Referenced by com.cloudera.impala.analysis.Analyzer.getCatalog().
|
inlineinherited |
Removes a data source from the in-memory map of data sources.
Definition at line 205 of file Catalog.java.
|
inlineinherited |
Removes a database from the metadata cache. Returns the value removed or null if not database was removed as part of this operation. Used by DROP DATABASE statements.
Definition at line 126 of file Catalog.java.
|
inlineinherited |
Removes a function from the catalog. Increments the catalog version and returns the Function object that was removed if the function existed, otherwise returns null.
Definition at line 285 of file Catalog.java.
References com.cloudera.impala.catalog.Function.dbName(), and com.cloudera.impala.catalog.Catalog.getDb().
|
inlineinherited |
Removes a table from the catalog and returns the table that was removed, or null if the table/database does not exist.
Definition at line 157 of file Catalog.java.
References com.cloudera.impala.catalog.Catalog.getDb().
|
inline |
Reloads all metadata from the source catalog.
Definition at line 63 of file ImpaladTestCatalog.java.
|
inlineinherited |
Definition at line 446 of file ImpaladCatalog.java.
Referenced by com.cloudera.impala.testutil.ImpaladTestCatalog.ImpaladTestCatalog().
|
inlineinherited |
Updates the internal Catalog based on the given TCatalogUpdateReq. This method: 1) Updates all databases in the Catalog 2) Updates all tables, views, and functions in the Catalog 3) Removes all dropped tables, views, and functions 4) Removes all dropped databases
This method is called once per statestore heartbeat and is guaranteed the same object will not be in both the "updated" list and the "removed" list (it is a detail handled by the statestore). Catalog updates are ordered by the object type with the dependent objects coming first. That is, database "foo" will always come before table "foo.bar". Synchronized because updateCatalog() can be called by during a statestore update or during a direct-DDL operation and catalogServiceId_ and lastSyncedCatalogVersion_ must be protected.
Definition at line 112 of file ImpaladCatalog.java.
References com.cloudera.impala.catalog.ImpaladCatalog.addCatalogObject(), com.cloudera.impala.catalog.ImpaladCatalog.catalogServiceId_, com.cloudera.impala.catalog.ImpaladCatalog.catalogUpdateEventNotifier_, com.cloudera.impala.catalog.ImpaladCatalog.INITIAL_CATALOG_SERVICE_ID, com.cloudera.impala.catalog.ImpaladCatalog.lastSyncedCatalogVersion_, and com.cloudera.impala.catalog.ImpaladCatalog.removeCatalogObject().
|
inlineinherited |
Causes the calling thread to wait until a catalog update notification has been sent or the given timeout has been reached. A timeout value of 0 indicates an indefinite wait. Does not protect against spurious wakeups, so this should be called in a loop.
Definition at line 164 of file ImpaladCatalog.java.
References com.cloudera.impala.catalog.ImpaladCatalog.catalogUpdateEventNotifier_.
|
protectedinherited |
Definition at line 67 of file Catalog.java.
Referenced by com.cloudera.impala.testutil.CatalogServiceTestCatalog.getAuthPolicy(), com.cloudera.impala.catalog.ImpaladCatalog.getAuthPolicy(), com.cloudera.impala.catalog.CatalogServiceCatalog.getAuthPolicy(), com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogObjects(), and com.cloudera.impala.testutil.ImpaladTestCatalog.ImpaladTestCatalog().
|
staticinherited |
Definition at line 61 of file Catalog.java.
Referenced by com.cloudera.impala.analysis.ExtractFromExpr.analyze(), com.cloudera.impala.analysis.FunctionName.analyze(), com.cloudera.impala.analysis.CreateFunctionStmtBase.analyze(), com.cloudera.impala.analysis.CastExpr.analyze(), com.cloudera.impala.catalog.Catalog.Catalog(), com.cloudera.impala.catalog.ScalarFunction.createBuiltin(), com.cloudera.impala.catalog.ScalarFunction.createBuiltinSearchDesc(), and com.cloudera.impala.analysis.Expr.getBuiltinFunction().
|
protectedinherited |
|
protectedinherited |
Definition at line 72 of file Catalog.java.
Referenced by com.cloudera.impala.catalog.Catalog.getDbNames(), and com.cloudera.impala.catalog.CatalogServiceCatalog.reset().
|
staticinherited |
Definition at line 58 of file Catalog.java.
Referenced by com.cloudera.impala.analysis.AnalyzerTest.AnalysisError(), com.cloudera.impala.analysis.UseStmt.analyze(), com.cloudera.impala.analysis.AuditingTest.AnalyzeAccessEvents(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeAuthStmtsTest(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeCreateDropRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeGrantRevokePriv(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeGrantRevokeRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeShowGrantRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeShowRoles(), com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk(), com.cloudera.impala.analysis.AuthorizationTest.AuthorizationTest(), com.cloudera.impala.analysis.AnalyzerTest.createAnalyzerUsingHiveColLabels(), com.cloudera.impala.testutil.TestUtils.createQueryContext(), com.cloudera.impala.analysis.AuthorizationTest.TestFunction(), com.cloudera.impala.analysis.AuthorizationTest.TestLocalGroupPolicyProvider(), com.cloudera.impala.analysis.AuthorizationTest.TestShortUsernameUsed(), and com.cloudera.impala.analysis.AuthorizationTest.TestWithIncorrectConfig().
|
protectedinherited |
Definition at line 84 of file Catalog.java.
Referenced by com.cloudera.impala.catalog.CatalogServiceCatalog.getCatalogObjects(), and com.cloudera.impala.catalog.CatalogServiceCatalog.CachePoolReader.run().
|
staticinherited |
|
protectedinherited |
Definition at line 63 of file Catalog.java.
|
private |
Definition at line 32 of file ImpaladTestCatalog.java.
Referenced by com.cloudera.impala.testutil.ImpaladTestCatalog.ImpaladTestCatalog().