OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RenderHandler.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: RenderHandler.h
19  * Author: Chris Root
20  *
21  * Created on Dec 18, 2019, 10:00 AM
22  */
23 
24 #pragma once
25 
27 #include "gen-cpp/OmniSci.h"
28 
29 class DBHandler;
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 RenderHandler(DBHandler* db_handler,
51  const size_t render_mem_bytes,
52  const size_t max_conncurrent_render_sessions,
53  const bool compositor_use_last_gpu,
54  const bool enable_auto_clear_render_mem,
55  const int render_oom_retry_threshold,
56  const bool renderer_use_vulkan_driver,
57  const SystemParameters system_parameters);
59 
60  private:
61  void disconnect(const TSessionId& session);
62  void render_vega(TRenderResult& _return,
63  const std::shared_ptr<Catalog_Namespace::SessionInfo> session_info,
64  const int64_t widget_id,
65  const std::string& vega_json,
66  const int32_t compression_level,
67  const std::string& nonce);
68 
69  void start_render_query(TPendingRenderQuery& _return,
70  const TSessionId& session,
71  const int64_t widget_id,
72  const int16_t node_idx,
73  const std::string& vega_json);
74 
75  void execute_next_render_step(TRenderStepResult& _return,
76  const TPendingRenderQuery& pending_render,
77  const TRenderAggDataMap& merged_data);
78 
80  TPixelTableRowResult& _return,
81  const std::shared_ptr<Catalog_Namespace::SessionInfo> session_info,
82  const int64_t widget_id,
83  const TPixel& pixel,
84  const std::map<std::string, std::vector<std::string>>& table_col_names,
85  const bool column_format,
86  const int32_t pixelRadius,
87  const std::string& nonce);
88 
89  void clear_gpu_memory();
90  void clear_cpu_memory();
91 
92  QueryRenderer::QueryRenderManager* get_render_manager();
93 
94  void shutdown();
95 
96  std::unique_ptr<Impl> impl_;
97 
98  friend class DBHandler;
99 };
void start_render_query(TPendingRenderQuery &_return, const TSessionId &session, const int64_t widget_id, const int16_t node_idx, const std::string &vega_json)
void clear_cpu_memory()
void execute_next_render_step(TRenderStepResult &_return, const TPendingRenderQuery &pending_render, const TRenderAggDataMap &merged_data)
void disconnect(const TSessionId &session)
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)
QueryRenderer::QueryRenderManager * get_render_manager()
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)
std::unique_ptr< Impl > impl_
Definition: RenderHandler.h:96
void clear_gpu_memory()
RenderHandler(DBHandler *db_handler, const size_t render_mem_bytes, const size_t max_conncurrent_render_sessions, const bool compositor_use_last_gpu, const bool enable_auto_clear_render_mem, const int render_oom_retry_threshold, const bool renderer_use_vulkan_driver, const SystemParameters system_parameters)