OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RenderInfo.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, 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 #pragma once
18 
19 #include "Analyzer/Analyzer.h"
20 #include "Catalog/Catalog.h"
24 
25 namespace QueryRenderer {
26 struct RenderSessionKey;
27 }
28 
29 class RenderInfo {
30  public:
31  std::unique_ptr<RenderAllocatorMap> render_allocator_map_ptr;
32  const ::QueryRenderer::RenderSessionKey& render_session_key;
33 
34  // Info for all the column targets retrieved in in a query. Used to extract column/table
35  // info when rendering.
36  std::vector<std::shared_ptr<Analyzer::TargetEntry>> targets;
37 
38  // All the "selected from" tables in a query. Includes resolved and un-resolved views.
39  std::unordered_set<std::string> table_names;
40 
41  RenderInfo(const ::QueryRenderer::RenderSessionKey& in_render_session_key,
42  const RenderQueryOptions& in_render_query_opts,
43  const bool force_non_in_situ_data = false);
44 
46  std::shared_ptr<Catalog_Namespace::SessionInfo const> getSessionInfoPtr() const;
47  void setForceNonInSituData();
48  bool isForcedNonInSitu() const;
49  bool queryRanWithInSituData() const;
50  bool hasInSituData() const;
51  bool isInSituDataFlagUnset() const;
52  bool couldRunInSitu() const;
53  bool isPotentialInSituRender() const;
54  bool useCudaBuffers() const;
55  void disableCudaBuffers();
56 
57  std::shared_ptr<QueryRenderer::QueryDataLayout> getQueryVboLayout() const;
58  void setQueryVboLayout(
59  const std::shared_ptr<QueryRenderer::QueryDataLayout>& vbo_layout);
60  std::shared_ptr<QueryRenderer::QueryDataLayout> getQuerySsboLayout() const;
61  void setQuerySsboLayout(
62  const std::shared_ptr<QueryRenderer::QueryDataLayout>& ssbo_layout);
63 
65 
66  bool setInSituDataIfUnset(const bool is_in_situ_data);
67 
68  void reset(std::unique_ptr<RenderQueryOptions> in_query_opts,
69  const bool in_force_non_in_situ_data);
70 
71  private:
74  in_situ_data; // Should be set to true if query results can be written directly to
75  // CUDA-mapped buffers for rendering. Should be set to false
76  // otherwise, meaning results are written to CPU first, and buffered
77  // back to GPU for rendering. An alternative meaning is that when
78  // false, you've encountered a non-projection query. Can only be set
79  // once for the lifetime of the object.
82 
83  std::shared_ptr<QueryRenderer::QueryDataLayout> query_vbo_layout;
84  std::shared_ptr<QueryRenderer::QueryDataLayout> query_ssbo_layout;
86 };
Defines data structures for the semantic analysis phase of query processing.
bool hasInSituData() const
Definition: RenderInfo.cpp:58
void disableCudaBuffers()
Definition: RenderInfo.cpp:78
bool isForcedNonInSitu() const
Definition: RenderInfo.cpp:48
const ::QueryRenderer::RenderSessionKey & render_session_key
Definition: RenderInfo.h:32
bool useCudaBuffers() const
Definition: RenderInfo.cpp:73
std::shared_ptr< Catalog_Namespace::SessionInfo const > getSessionInfoPtr() const
Definition: RenderInfo.cpp:38
void setForceNonInSituData()
Definition: RenderInfo.cpp:44
std::shared_ptr< QueryRenderer::QueryDataLayout > getQuerySsboLayout() const
Definition: RenderInfo.cpp:92
std::vector< std::shared_ptr< Analyzer::TargetEntry > > targets
Definition: RenderInfo.h:36
bool queryRanWithInSituData() const
Definition: RenderInfo.cpp:53
bool setInSituDataIfUnset(const bool is_in_situ_data)
Definition: RenderInfo.cpp:102
RenderInfo(const ::QueryRenderer::RenderSessionKey &in_render_session_key, const RenderQueryOptions &in_render_query_opts, const bool force_non_in_situ_data=false)
Definition: RenderInfo.cpp:20
bool couldRunInSitu() const
const Catalog_Namespace::SessionInfo & getSessionInfo() const
Definition: RenderInfo.cpp:28
std::unordered_set< std::string > table_names
Definition: RenderInfo.h:39
This file contains the class specification and related data structures for Catalog.
const RenderQueryOptions & getRenderQueryOptions() const
Definition: RenderInfo.cpp:107
std::shared_ptr< QueryRenderer::QueryDataLayout > getQueryVboLayout() const
Definition: RenderInfo.cpp:82
InSituState in_situ_data
Definition: RenderInfo.h:74
RenderQueryOptions render_query_opts_
Definition: RenderInfo.h:85
void reset(std::unique_ptr< RenderQueryOptions > in_query_opts, const bool in_force_non_in_situ_data)
Definition: RenderInfo.cpp:112
std::shared_ptr< QueryRenderer::QueryDataLayout > query_ssbo_layout
Definition: RenderInfo.h:84
bool force_non_in_situ_data
Definition: RenderInfo.h:80
bool isInSituDataFlagUnset() const
Definition: RenderInfo.cpp:63
bool cuda_using_buffers_
Definition: RenderInfo.h:81
std::unique_ptr< RenderAllocatorMap > render_allocator_map_ptr
Definition: RenderInfo.h:31
void setQuerySsboLayout(const std::shared_ptr< QueryRenderer::QueryDataLayout > &ssbo_layout)
Definition: RenderInfo.cpp:97
bool isPotentialInSituRender() const
Definition: RenderInfo.cpp:68
void setQueryVboLayout(const std::shared_ptr< QueryRenderer::QueryDataLayout > &vbo_layout)
Definition: RenderInfo.cpp:87
std::shared_ptr< QueryRenderer::QueryDataLayout > query_vbo_layout
Definition: RenderInfo.h:83