OmniSciDB  addbbd5075
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MapDRenderHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 OmniSci, 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 /*
18  * File: MapDRenderHandler.h
19  * Author: Chris Root
20  *
21  * Created on Dec 18, 2019, 10:00 AM
22  */
23 
24 #pragma once
25 
26 #include "Shared/MapDParameters.h"
27 #include "gen-cpp/MapD.h"
28 
29 class MapDHandler;
30 
31 namespace Catalog_Namespace {
32 class SessionInfo;
33 }
34 
35 namespace QueryRenderer {
36 class QueryRenderManager;
37 } // namespace QueryRenderer
38 
39 namespace Parser {
40 class DDLStmt;
41 }
42 
44  public:
45  // forward declaration of the implementation class to be defined later.
46  // This is public as there can be certain functionality at lower levels that may want to
47  // work directly with the implementation layer.
48  class Impl;
49 
50  explicit MapDRenderHandler(MapDHandler* mapd_handler,
51  const size_t render_mem_bytes,
52  const size_t render_poly_cache_bytes,
53  const bool enable_auto_clear_render_mem,
54  const int render_oom_retry_threshold,
55  const MapDParameters mapd_parameters);
57 
58  private:
59  void disconnect(const TSessionId& session);
60  void render_vega(TRenderResult& _return,
61  const std::shared_ptr<Catalog_Namespace::SessionInfo> session_info,
62  const int64_t widget_id,
63  const std::string& vega_json,
64  const int32_t compression_level,
65  const std::string& nonce);
66 
67  void start_render_query(TPendingRenderQuery& _return,
68  const TSessionId& session,
69  const int64_t widget_id,
70  const int16_t node_idx,
71  const std::string& vega_json);
72 
73  void execute_next_render_step(TRenderStepResult& _return,
74  const TPendingRenderQuery& pending_render,
75  const TRenderAggDataMap& merged_data);
76 
78  TPixelTableRowResult& _return,
79  const std::shared_ptr<Catalog_Namespace::SessionInfo> session_info,
80  const int64_t widget_id,
81  const TPixel& pixel,
82  const std::map<std::string, std::vector<std::string>>& table_col_names,
83  const bool column_format,
84  const int32_t pixelRadius,
85  const std::string& nonce);
86 
87  void clear_gpu_memory();
88  void clear_cpu_memory();
89 
90  QueryRenderer::QueryRenderManager* get_render_manager();
91 
93  void shutdown();
94 
95  std::unique_ptr<Impl> impl_;
96 
97  friend class MapDHandler;
98 };
void get_result_row_for_pixel(TPixelTableRowResult &_return, const std::shared_ptr< Catalog_Namespace::SessionInfo > session_info, const int64_t widget_id, const TPixel &pixel, const std::map< std::string, std::vector< std::string >> &table_col_names, const bool column_format, const int32_t pixelRadius, const std::string &nonce)
QueryRenderer::QueryRenderManager * get_render_manager()
void render_vega(TRenderResult &_return, const std::shared_ptr< Catalog_Namespace::SessionInfo > session_info, const int64_t widget_id, const std::string &vega_json, const int32_t compression_level, const std::string &nonce)
void disconnect(const TSessionId &session)
void execute_next_render_step(TRenderStepResult &_return, const TPendingRenderQuery &pending_render, const TRenderAggDataMap &merged_data)
MapDRenderHandler(MapDHandler *mapd_handler, const size_t render_mem_bytes, const size_t render_poly_cache_bytes, const bool enable_auto_clear_render_mem, const int render_oom_retry_threshold, const MapDParameters mapd_parameters)
void handle_ddl(Parser::DDLStmt *)
void start_render_query(TPendingRenderQuery &_return, const TSessionId &session, const int64_t widget_id, const int16_t node_idx, const std::string &vega_json)
std::unique_ptr< Impl > impl_