OmniSciDB  3a86f6ec37
LeafAggregator.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef LEAFAGGREGATOR_H
18 #define LEAFAGGREGATOR_H
19 
20 #include "../AggregatedResult.h"
21 #include "Catalog/Catalog.h"
22 #include "DataMgr/MemoryLevel.h"
23 #include "LeafHostInfo.h"
26 #include "gen-cpp/OmniSci.h"
27 
28 #include "Logger/Logger.h"
29 
30 namespace Catalog_Namespace {
31 class SessionInfo;
32 } // namespace Catalog_Namespace
33 
34 class ResultSet;
35 
37  public:
38  LeafAggregator(const std::vector<LeafHostInfo>& leaves) { CHECK(leaves.empty()); }
39 
41  const std::string& query_ra,
42  const ExecutionOptions& eo,
43  const bool is_update_delete) {
44  CHECK(false);
45  return {nullptr, {}};
46  }
47 
49  const Catalog_Namespace::SessionInfo& parent_session_info) {
50  CHECK(false);
51  }
52 
53  std::map<size_t, TQueryResult> forwardQueryToLeaves(
54  const Catalog_Namespace::SessionInfo& parent_session_info,
55  const std::string& query_str) {
56  CHECK(false);
57  return {};
58  }
59 
60  TQueryResult forwardQueryToLeaf(
61  const Catalog_Namespace::SessionInfo& parent_session_info,
62  const std::string& query_str,
63  const size_t leaf_idx) {
64  CHECK(false);
65  return {};
66  }
67 
68  void insertDataToLeaf(const Catalog_Namespace::SessionInfo& parent_session_info,
69  const size_t leaf_idx,
70  const TInsertData& thrift_insert_data) {
71  CHECK(false);
72  }
73 
75  const Catalog_Namespace::SessionInfo& parent_session_info,
76  const int32_t db_id,
77  const int32_t table_id) {
78  CHECK(false);
79  }
80 
81  int32_t get_table_epochLeaf(const Catalog_Namespace::SessionInfo& parent_session_info,
82  const int32_t db_id,
83  const int32_t table_id) {
84  CHECK(false);
85  return 0;
86  }
87 
88  void set_table_epochLeaf(const Catalog_Namespace::SessionInfo& parent_session_info,
89  const int32_t db_id,
90  const int32_t table_id,
91  const int32_t new_epoch) {
92  CHECK(false);
93  }
94 
95  std::vector<Catalog_Namespace::TableEpochInfo> getLeafTableEpochs(
96  const Catalog_Namespace::SessionInfo& parent_session_info,
97  const int32_t db_id,
98  const int32_t table_id) {
99  CHECK(false);
100  return {};
101  }
102 
104  const Catalog_Namespace::SessionInfo& parent_session_info,
105  const int32_t db_id,
106  const std::vector<Catalog_Namespace::TableEpochInfo>& table_epochs) {
107  CHECK(false);
108  }
109 
110  void connect(const Catalog_Namespace::SessionInfo& parent_session_info,
111  const std::string& user,
112  const std::string& passwd,
113  const std::string& dbname) {
114  CHECK(false);
115  }
116 
117  void disconnect(const TSessionId session) { CHECK(false); }
118 
119  void switch_database(const TSessionId session, const std::string& dbname) {
120  CHECK(false);
121  }
122 
123  void clone_session(const TSessionId session1, const TSessionId session2) {
124  CHECK(false);
125  };
126 
127  void interrupt(const TSessionId query_session, const TSessionId interrupt_session) {
128  CHECK(false);
129  }
130 
131  void set_execution_mode(const TSessionId session, const TExecuteMode::type mode) {
132  CHECK(false);
133  }
134 
135  size_t leafCount() const { return 0; }
136 
137  std::vector<TServerStatus> getLeafStatus(TSessionId session) {
138  CHECK(false);
139  return {};
140  }
141 
142  std::vector<TNodeMemoryInfo> getLeafMemoryInfo(
143  TSessionId session,
144  Data_Namespace::MemoryLevel memory_level) {
145  CHECK(false);
146  return {};
147  }
148 
149  TClusterHardwareInfo getHardwareInfo(TSessionId session) {
150  CHECK(false);
151  return {};
152  }
153 
154  void clear_leaf_cpu_memory(const TSessionId session) { CHECK(false); }
155 
156  void clear_leaf_gpu_memory(const TSessionId session) { CHECK(false); }
157 
158  std::vector<size_t> query_get_outer_fragment_counts(
159  const Catalog_Namespace::SessionInfo& parent_session_info,
160  std::string& sql_query) {
161  CHECK(false);
162  return {};
163  }
164 };
165 
166 #endif // LEAFAGGREGATOR_H
int32_t get_table_epochLeaf(const Catalog_Namespace::SessionInfo &parent_session_info, const int32_t db_id, const int32_t table_id)
std::vector< size_t > query_get_outer_fragment_counts(const Catalog_Namespace::SessionInfo &parent_session_info, std::string &sql_query)
void set_execution_mode(const TSessionId session, const TExecuteMode::type mode)
AggregatedResult execute(const Catalog_Namespace::SessionInfo &parent_session_info, const std::string &query_ra, const ExecutionOptions &eo, const bool is_update_delete)
void leafCatalogConsistencyCheck(const Catalog_Namespace::SessionInfo &parent_session_info)
void clone_session(const TSessionId session1, const TSessionId session2)
ResultSet(const std::vector< TargetInfo > &targets, const ExecutorDeviceType device_type, const QueryMemoryDescriptor &query_mem_desc, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const Catalog_Namespace::Catalog *catalog, const unsigned block_size, const unsigned grid_size)
Definition: ResultSet.cpp:56
void clear_leaf_gpu_memory(const TSessionId session)
void connect(const Catalog_Namespace::SessionInfo &parent_session_info, const std::string &user, const std::string &passwd, const std::string &dbname)
void checkpointLeafShardsWithAutoRollback(const Catalog_Namespace::SessionInfo &parent_session_info, const int32_t db_id, const int32_t table_id)
void switch_database(const TSessionId session, const std::string &dbname)
void disconnect(const TSessionId session)
This file contains the class specification and related data structures for Catalog.
LeafAggregator(const std::vector< LeafHostInfo > &leaves)
void clear_leaf_cpu_memory(const TSessionId session)
std::map< size_t, TQueryResult > forwardQueryToLeaves(const Catalog_Namespace::SessionInfo &parent_session_info, const std::string &query_str)
TClusterHardwareInfo getHardwareInfo(TSessionId session)
TQueryResult forwardQueryToLeaf(const Catalog_Namespace::SessionInfo &parent_session_info, const std::string &query_str, const size_t leaf_idx)
std::vector< TNodeMemoryInfo > getLeafMemoryInfo(TSessionId session, Data_Namespace::MemoryLevel memory_level)
void set_table_epochLeaf(const Catalog_Namespace::SessionInfo &parent_session_info, const int32_t db_id, const int32_t table_id, const int32_t new_epoch)
#define CHECK(condition)
Definition: Logger.h:197
void insertDataToLeaf(const Catalog_Namespace::SessionInfo &parent_session_info, const size_t leaf_idx, const TInsertData &thrift_insert_data)
size_t leafCount() const
std::vector< TServerStatus > getLeafStatus(TSessionId session)
void setLeafTableEpochs(const Catalog_Namespace::SessionInfo &parent_session_info, const int32_t db_id, const std::vector< Catalog_Namespace::TableEpochInfo > &table_epochs)
std::vector< Catalog_Namespace::TableEpochInfo > getLeafTableEpochs(const Catalog_Namespace::SessionInfo &parent_session_info, const int32_t db_id, const int32_t table_id)
void interrupt(const TSessionId query_session, const TSessionId interrupt_session)