forked from heavyai/heavydb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderHandler.h
100 lines (82 loc) · 3.18 KB
/
RenderHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* Copyright 2019 OmniSci, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* File: RenderHandler.h
* Author: Chris Root
*
* Created on Dec 18, 2019, 10:00 AM
*/
#pragma once
#include "Shared/SystemParameters.h"
#include "gen-cpp/OmniSci.h"
class DBHandler;
namespace Catalog_Namespace {
class SessionInfo;
}
namespace QueryRenderer {
class QueryRenderManager;
} // namespace QueryRenderer
namespace Parser {
class DDLStmt;
}
class RenderHandler {
public:
// forward declaration of the implementation class to be defined later.
// This is public as there can be certain functionality at lower levels that may want to
// work directly with the implementation layer.
class Impl;
explicit 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);
~RenderHandler();
private:
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);
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 execute_next_render_step(TRenderStepResult& _return,
const TPendingRenderQuery& pending_render,
const TRenderAggDataMap& merged_data);
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);
void clear_gpu_memory();
void clear_cpu_memory();
std::string get_renderer_status_json() const;
bool validate_renderer_status_json(const std::string& other_renderer_status_json) const;
void shutdown();
std::unique_ptr<Impl> impl_;
friend class DBHandler;
};