Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
catalog-op-executor.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 
16 #ifndef IMPALA_EXEC_CATALOG_OP_EXECUTOR_H
17 #define IMPALA_EXEC_CATALOG_OP_EXECUTOR_H
18 
19 #include <boost/scoped_ptr.hpp>
20 #include "gen-cpp/TCLIService_types.h"
21 #include "gen-cpp/Frontend_types.h"
22 
23 namespace impala {
24 
25 class ExecEnv;
26 class Frontend;
27 class Status;
28 class RuntimeProfile;
29 
35  public:
37  : env_(env), fe_(fe), profile_(profile) {}
38 
40  Status Exec(const TCatalogOpRequest& catalog_op);
41 
45  Status GetCatalogObject(const TCatalogObject& object_desc, TCatalogObject* result);
46 
50  Status ExecComputeStats(const TComputeStatsParams& compute_stats_params,
51  const apache::hive::service::cli::thrift::TTableSchema& tbl_stats_schema,
52  const apache::hive::service::cli::thrift::TRowSet& tbl_stats_data,
53  const apache::hive::service::cli::thrift::TTableSchema& col_stats_schema,
54  const apache::hive::service::cli::thrift::TRowSet& col_stats_data);
55 
59  Status PrioritizeLoad(const TPrioritizeLoadRequest& req,
60  TPrioritizeLoadResponse* result);
61 
65  Status SentryAdminCheck(const TSentryAdminCheckRequest& re);
66 
70  const TDdlExecResponse* ddl_exec_response() const { return exec_response_.get(); }
71 
77  const TCatalogUpdateResult* update_catalog_result() const {
78  return catalog_update_result_.get();
79  }
80 
81  private:
84  static void SetTableStats(
85  const apache::hive::service::cli::thrift::TTableSchema& tbl_stats_schema,
86  const apache::hive::service::cli::thrift::TRowSet& tbl_stats_data,
87  const std::vector<TPartitionStats>& existing_part_stats,
88  TAlterTableUpdateStatsParams* params);
89  static void SetColumnStats(
90  const apache::hive::service::cli::thrift::TTableSchema& col_stats_schema,
91  const apache::hive::service::cli::thrift::TRowSet& col_stats_data,
92  TAlterTableUpdateStatsParams* params);
93 
95  boost::scoped_ptr<TDdlExecResponse> exec_response_;
96 
98  boost::scoped_ptr<TCatalogUpdateResult> catalog_update_result_;
99 
103 
106  void HandleDropFunction(const TDropFunctionParams&);
107  void HandleDropDataSource(const TDropDataSourceParams&);
108 };
109 
110 }
111 
112 #endif
Status GetCatalogObject(const TCatalogObject &object_desc, TCatalogObject *result)
Status Exec(const TCatalogOpRequest &catalog_op)
Executes the given catalog operation against the catalog server.
CatalogOpExecutor(ExecEnv *env, Frontend *fe, RuntimeProfile *profile)
boost::scoped_ptr< TCatalogUpdateResult > catalog_update_result_
Result of executing a DDL request using the CatalogService.
const TDdlExecResponse * ddl_exec_response() const
static void SetTableStats(const apache::hive::service::cli::thrift::TTableSchema &tbl_stats_schema, const apache::hive::service::cli::thrift::TRowSet &tbl_stats_data, const std::vector< TPartitionStats > &existing_part_stats, TAlterTableUpdateStatsParams *params)
void HandleDropFunction(const TDropFunctionParams &)
Status SentryAdminCheck(const TSentryAdminCheckRequest &re)
static void SetColumnStats(const apache::hive::service::cli::thrift::TTableSchema &col_stats_schema, const apache::hive::service::cli::thrift::TRowSet &col_stats_data, TAlterTableUpdateStatsParams *params)
boost::scoped_ptr< TDdlExecResponse > exec_response_
Response from executing the DDL request, see ddl_exec_response().
Status ExecComputeStats(const TComputeStatsParams &compute_stats_params, const apache::hive::service::cli::thrift::TTableSchema &tbl_stats_schema, const apache::hive::service::cli::thrift::TRowSet &tbl_stats_data, const apache::hive::service::cli::thrift::TTableSchema &col_stats_schema, const apache::hive::service::cli::thrift::TRowSet &col_stats_data)
Status PrioritizeLoad(const TPrioritizeLoadRequest &req, TPrioritizeLoadResponse *result)
void HandleDropDataSource(const TDropDataSourceParams &)
const TCatalogUpdateResult * update_catalog_result() const