Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <catalog.h>
Public Member Functions | |
Catalog () | |
Status | ExecDdl (const TDdlExecRequest &req, TDdlExecResponse *resp) |
Status | UpdateCatalog (const TUpdateCatalogRequest &req, TUpdateCatalogResponse *resp) |
Status | ResetMetadata (const TResetMetadataRequest &req, TResetMetadataResponse *resp) |
Status | GetCatalogVersion (long *version) |
Status | GetAllCatalogObjects (long from_version, TGetAllCatalogObjectsResponse *resp) |
Status | GetCatalogObject (const TCatalogObject &request, TCatalogObject *response) |
Status | GetDbNames (const std::string *pattern, TGetDbsResult *table_names) |
Status | GetTableNames (const std::string &db, const std::string *pattern, TGetTablesResult *table_names) |
Status | GetFunctions (const TGetFunctionsRequest &request, TGetFunctionsResponse *response) |
Status | PrioritizeLoad (const TPrioritizeLoadRequest &req) |
Status | SentryAdminCheck (const TSentryAdminCheckRequest &req) |
Private Attributes | |
jclass | catalog_class_ |
Descriptor of Java Catalog class itself, used to create a new instance. More... | |
jobject | catalog_ |
jmethodID | update_metastore_id_ |
jmethodID | exec_ddl_id_ |
jmethodID | reset_metadata_id_ |
jmethodID | get_catalog_object_id_ |
jmethodID | get_catalog_objects_id_ |
jmethodID | get_catalog_version_id_ |
jmethodID | get_db_names_id_ |
jmethodID | get_table_names_id_ |
jmethodID | get_functions_id_ |
jmethodID | prioritize_load_id_ |
jmethodID | sentry_admin_check_id_ |
jmethodID | catalog_ctor_ |
The Catalog is a proxy for the Java-side JniCatalog class. The interface is a set of wrapper functions for methods called over JNI.
Catalog::Catalog | ( | ) |
Does all the work of initialising the JNI method stubs. If any method can't be found, or if there is any further exception, the constructor will terminate the process.
Definition at line 39 of file catalog.cc.
References catalog_, catalog_class_, catalog_ctor_, exec_ddl_id_, EXIT_IF_ERROR, EXIT_IF_EXC, impala::FlagToTLogLevel(), get_catalog_object_id_, get_catalog_objects_id_, get_catalog_version_id_, get_db_names_id_, get_functions_id_, get_table_names_id_, getJNIEnv(), impala::JniUtil::LoadJniMethod(), impala::JniUtil::LocalToGlobalRef(), prioritize_load_id_, reset_metadata_id_, sentry_admin_check_id_, and update_metastore_id_.
Status Catalog::ExecDdl | ( | const TDdlExecRequest & | req, |
TDdlExecResponse * | resp | ||
) |
Executes the given TDdlExecRequest and returns a response with details on the result of the operation. Returns OK if the operation was successful, otherwise a Status object with information on the error will be returned.
Definition at line 102 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and exec_ddl_id_.
Status Catalog::GetAllCatalogObjects | ( | long | from_version, |
TGetAllCatalogObjectsResponse * | resp | ||
) |
Gets all Catalog objects and the metadata that is applicable for the given request. Always returns all object names that exist in the Catalog, but allows for extended metadata for objects that were modified after the specified version. Returns OK if the operation was successful, otherwise a Status object with information on the error will be returned.
Definition at line 87 of file catalog.cc.
References catalog_, impala::DeserializeThriftMsg(), get_catalog_objects_id_, getJNIEnv(), impala::Status::OK, impala::JniLocalFrame::push(), RETURN_ERROR_IF_EXC, and RETURN_IF_ERROR.
Status Catalog::GetCatalogObject | ( | const TCatalogObject & | request, |
TCatalogObject * | response | ||
) |
Gets the Thrift representation of a Catalog object. The request is a TCatalogObject which has the desired TCatalogObjectType and name properly set. Returns OK if the operation was successful, otherwise a Status object with information on the error will be returned.
Definition at line 74 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and get_catalog_object_id_.
Status Catalog::GetCatalogVersion | ( | long * | version | ) |
Queries the catalog to get the current version and sets the 'version' output parameter to this value. Returns OK if the operation was successful, otherwise a Status object with information on the error will be returned.
Definition at line 79 of file catalog.cc.
References catalog_, get_catalog_version_id_, getJNIEnv(), impala::Status::OK, impala::JniLocalFrame::push(), and RETURN_IF_ERROR.
Status Catalog::GetDbNames | ( | const std::string * | pattern, |
TGetDbsResult * | table_names | ||
) |
Return all databases matching the optional argument 'pattern'. If pattern is NULL, match all databases otherwise match only those databases that match the pattern string. Patterns are "p1|p2|p3" where | denotes choice, and each pN may contain wildcards denoted by '*' which match all strings. TODO: GetDbNames() and GetTableNames() can probably be scraped in favor of GetAllCatalogObjects(). Consider removing them and moving everything to use that.
Definition at line 116 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and get_db_names_id_.
Status Catalog::GetFunctions | ( | const TGetFunctionsRequest & | request, |
TGetFunctionsResponse * | response | ||
) |
Gets all functions in the catalog matching the parameters in the given TFunctionsRequest.
Definition at line 130 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and get_functions_id_.
Status Catalog::GetTableNames | ( | const std::string & | db, |
const std::string * | pattern, | ||
TGetTablesResult * | table_names | ||
) |
Returns all matching table names, per Hive's "SHOW TABLES <pattern>". Each table name returned is unqualified. If pattern is NULL, match all tables otherwise match only those tables that match the pattern string. Patterns are "p1|p2|p3" where | denotes choice, and each pN may contain wildcards denoted by '*' which match all strings.
Definition at line 122 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and get_table_names_id_.
Status Catalog::PrioritizeLoad | ( | const TPrioritizeLoadRequest & | req | ) |
Prioritizes the loading of metadata for the catalog objects specified in the TPrioritizeLoadRequest.
Definition at line 135 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and prioritize_load_id_.
Status Catalog::ResetMetadata | ( | const TResetMetadataRequest & | req, |
TResetMetadataResponse * | resp | ||
) |
Resets the metadata of a single table or the entire catalog, based on the given TResetMetadataRequest. Returns OK if the operation was successful, otherwise a Status object with information on the error will be returned.
Definition at line 106 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and reset_metadata_id_.
Status Catalog::SentryAdminCheck | ( | const TSentryAdminCheckRequest & | req | ) |
Checks whether the requesting user has admin privileges on the Sentry Service and returns OK if they do. Returns a bad status if the user is not an admin or if there was an error executing the request.
Definition at line 139 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and sentry_admin_check_id_.
Status Catalog::UpdateCatalog | ( | const TUpdateCatalogRequest & | req, |
TUpdateCatalogResponse * | resp | ||
) |
Executes the given TUpdateCatalogRequest and returns a response with details on the result of the operation. Returns OK if the operation was successful, otherwise a Status object with information on the error will be returned.
Definition at line 111 of file catalog.cc.
References impala::JniUtil::CallJniMethod(), catalog_, and update_metastore_id_.
|
private |
Definition at line 104 of file catalog.h.
Referenced by Catalog(), ExecDdl(), GetAllCatalogObjects(), GetCatalogObject(), GetCatalogVersion(), GetDbNames(), GetFunctions(), GetTableNames(), PrioritizeLoad(), ResetMetadata(), SentryAdminCheck(), and UpdateCatalog().
|
private |
|
private |
|
private |
|
private |
Definition at line 108 of file catalog.h.
Referenced by Catalog(), and GetCatalogObject().
|
private |
Definition at line 109 of file catalog.h.
Referenced by Catalog(), and GetAllCatalogObjects().
|
private |
Definition at line 110 of file catalog.h.
Referenced by Catalog(), and GetCatalogVersion().
|
private |
Definition at line 111 of file catalog.h.
Referenced by Catalog(), and GetDbNames().
|
private |
Definition at line 113 of file catalog.h.
Referenced by Catalog(), and GetFunctions().
|
private |
Definition at line 112 of file catalog.h.
Referenced by Catalog(), and GetTableNames().
|
private |
Definition at line 114 of file catalog.h.
Referenced by Catalog(), and PrioritizeLoad().
|
private |
Definition at line 107 of file catalog.h.
Referenced by Catalog(), and ResetMetadata().
|
private |
Definition at line 115 of file catalog.h.
Referenced by Catalog(), and SentryAdminCheck().
|
private |
Definition at line 105 of file catalog.h.
Referenced by Catalog(), and UpdateCatalog().