Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
catalog.h
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef IMPALA_CATALOG_CATALOG_H
16 #define IMPALA_CATALOG_CATALOG_H
17 
18 #include <jni.h>
19 
20 #include "gen-cpp/Frontend_types.h"
21 #include "gen-cpp/CatalogInternalService_types.h"
22 #include "gen-cpp/CatalogService_types.h"
23 #include "common/status.h"
24 
25 namespace impala {
26 
29 class Catalog {
30  public:
33  Catalog();
34 
38  Status ExecDdl(const TDdlExecRequest& req, TDdlExecResponse* resp);
39 
43  Status UpdateCatalog(const TUpdateCatalogRequest& req,
44  TUpdateCatalogResponse* resp);
45 
49  Status ResetMetadata(const TResetMetadataRequest& req, TResetMetadataResponse* resp);
50 
54  Status GetCatalogVersion(long* version);
55 
61  Status GetAllCatalogObjects(long from_version, TGetAllCatalogObjectsResponse* resp);
62 
67  Status GetCatalogObject(const TCatalogObject& request, TCatalogObject* response);
68 
76  Status GetDbNames(const std::string* pattern, TGetDbsResult* table_names);
77 
83  Status GetTableNames(const std::string& db, const std::string* pattern,
84  TGetTablesResult* table_names);
85 
88  Status GetFunctions(const TGetFunctionsRequest& request,
89  TGetFunctionsResponse *response);
90 
93  Status PrioritizeLoad(const TPrioritizeLoadRequest& req);
94 
98  Status SentryAdminCheck(const TSentryAdminCheckRequest& req);
99 
100  private:
103 
104  jobject catalog_; // instance of com.cloudera.impala.service.JniCatalog
105  jmethodID update_metastore_id_; // JniCatalog.updateMetaastore()
106  jmethodID exec_ddl_id_; // JniCatalog.execDdl()
107  jmethodID reset_metadata_id_; // JniCatalog.resetMetdata()
108  jmethodID get_catalog_object_id_; // JniCatalog.getCatalogObject()
109  jmethodID get_catalog_objects_id_; // JniCatalog.getCatalogObjects()
110  jmethodID get_catalog_version_id_; // JniCatalog.getCatalogVersion()
111  jmethodID get_db_names_id_; // JniCatalog.getDbNames()
112  jmethodID get_table_names_id_; // JniCatalog.getTableNames()
113  jmethodID get_functions_id_; // JniCatalog.getFunctions()
114  jmethodID prioritize_load_id_; // JniCatalog.prioritizeLoad()
115  jmethodID sentry_admin_check_id_; // JniCatalog.checkUserSentryAdmin()
116  jmethodID catalog_ctor_;
117 };
118 
119 }
120 #endif
jmethodID get_catalog_object_id_
Definition: catalog.h:108
jmethodID get_functions_id_
Definition: catalog.h:113
jmethodID get_table_names_id_
Definition: catalog.h:112
Status ExecDdl(const TDdlExecRequest &req, TDdlExecResponse *resp)
Definition: catalog.cc:102
Status PrioritizeLoad(const TPrioritizeLoadRequest &req)
Definition: catalog.cc:135
jmethodID sentry_admin_check_id_
Definition: catalog.h:115
jmethodID update_metastore_id_
Definition: catalog.h:105
Status GetDbNames(const std::string *pattern, TGetDbsResult *table_names)
Definition: catalog.cc:116
jobject catalog_
Definition: catalog.h:104
Status GetAllCatalogObjects(long from_version, TGetAllCatalogObjectsResponse *resp)
Definition: catalog.cc:87
Status SentryAdminCheck(const TSentryAdminCheckRequest &req)
Definition: catalog.cc:139
Status UpdateCatalog(const TUpdateCatalogRequest &req, TUpdateCatalogResponse *resp)
Definition: catalog.cc:111
jmethodID catalog_ctor_
Definition: catalog.h:116
jmethodID get_catalog_version_id_
Definition: catalog.h:110
Status GetCatalogObject(const TCatalogObject &request, TCatalogObject *response)
Definition: catalog.cc:74
jmethodID reset_metadata_id_
Definition: catalog.h:107
jmethodID prioritize_load_id_
Definition: catalog.h:114
Status GetFunctions(const TGetFunctionsRequest &request, TGetFunctionsResponse *response)
Definition: catalog.cc:130
Status GetTableNames(const std::string &db, const std::string *pattern, TGetTablesResult *table_names)
Definition: catalog.cc:122
jclass catalog_class_
Descriptor of Java Catalog class itself, used to create a new instance.
Definition: catalog.h:102
jmethodID exec_ddl_id_
Definition: catalog.h:106
jmethodID get_catalog_objects_id_
Definition: catalog.h:109
Status ResetMetadata(const TResetMetadataRequest &req, TResetMetadataResponse *resp)
Definition: catalog.cc:106
jmethodID get_db_names_id_
Definition: catalog.h:111
Status GetCatalogVersion(long *version)
Definition: catalog.cc:79