Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::Catalog Class Reference

#include <catalog.h>

Collaboration diagram for impala::Catalog:

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_
 

Detailed Description

The Catalog is a proxy for the Java-side JniCatalog class. The interface is a set of wrapper functions for methods called over JNI.

Definition at line 29 of file catalog.h.

Constructor & Destructor Documentation

Catalog::Catalog ( )

Member Function Documentation

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_.

Member Data Documentation

jclass impala::Catalog::catalog_class_
private

Descriptor of Java Catalog class itself, used to create a new instance.

Definition at line 102 of file catalog.h.

Referenced by Catalog().

jmethodID impala::Catalog::catalog_ctor_
private

Definition at line 116 of file catalog.h.

Referenced by Catalog().

jmethodID impala::Catalog::exec_ddl_id_
private

Definition at line 106 of file catalog.h.

Referenced by Catalog(), and ExecDdl().

jmethodID impala::Catalog::get_catalog_object_id_
private

Definition at line 108 of file catalog.h.

Referenced by Catalog(), and GetCatalogObject().

jmethodID impala::Catalog::get_catalog_objects_id_
private

Definition at line 109 of file catalog.h.

Referenced by Catalog(), and GetAllCatalogObjects().

jmethodID impala::Catalog::get_catalog_version_id_
private

Definition at line 110 of file catalog.h.

Referenced by Catalog(), and GetCatalogVersion().

jmethodID impala::Catalog::get_db_names_id_
private

Definition at line 111 of file catalog.h.

Referenced by Catalog(), and GetDbNames().

jmethodID impala::Catalog::get_functions_id_
private

Definition at line 113 of file catalog.h.

Referenced by Catalog(), and GetFunctions().

jmethodID impala::Catalog::get_table_names_id_
private

Definition at line 112 of file catalog.h.

Referenced by Catalog(), and GetTableNames().

jmethodID impala::Catalog::prioritize_load_id_
private

Definition at line 114 of file catalog.h.

Referenced by Catalog(), and PrioritizeLoad().

jmethodID impala::Catalog::reset_metadata_id_
private

Definition at line 107 of file catalog.h.

Referenced by Catalog(), and ResetMetadata().

jmethodID impala::Catalog::sentry_admin_check_id_
private

Definition at line 115 of file catalog.h.

Referenced by Catalog(), and SentryAdminCheck().

jmethodID impala::Catalog::update_metastore_id_
private

Definition at line 105 of file catalog.h.

Referenced by Catalog(), and UpdateCatalog().


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