OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RowSetMemoryOwner Class Referencefinal

#include <RowSetMemoryOwner.h>

+ Inheritance diagram for RowSetMemoryOwner:
+ Collaboration diagram for RowSetMemoryOwner:

Classes

struct  CountDistinctBitmapBuffer
 

Public Types

enum  StringTranslationType { StringTranslationType::SOURCE_INTERSECTION, StringTranslationType::SOURCE_UNION }
 

Public Member Functions

 RowSetMemoryOwner (const size_t arena_block_size, const size_t num_kernel_threads=0)
 
int8_t * allocate (const size_t num_bytes, const size_t thread_idx=0) override
 
int8_t * allocateCountDistinctBuffer (const size_t num_bytes, const size_t thread_idx=0)
 
void addCountDistinctBuffer (int8_t *count_distinct_buffer, const size_t bytes, const bool physical_buffer)
 
void addCountDistinctSet (CountDistinctSet *count_distinct_set)
 
void addGroupByBuffer (int64_t *group_by_buffer)
 
void addVarlenBuffer (void *varlen_buffer)
 
void addVarlenInputBuffer (Data_Namespace::AbstractBuffer *buffer)
 
std::string * addString (const std::string &str)
 
std::vector< int64_t > * addArray (const std::vector< int64_t > &arr)
 
StringDictionaryProxyaddStringDict (std::shared_ptr< StringDictionary > str_dict, const int dict_id, const int64_t generation)
 
std::string generate_translation_map_key (const int32_t source_proxy_id, const int32_t dest_proxy_id, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
 
const
StringDictionaryProxy::IdMap
addStringProxyIntersectionTranslationMap (const StringDictionaryProxy *source_proxy, const StringDictionaryProxy *dest_proxy, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
 
const
StringDictionaryProxy::IdMap
addStringProxyUnionTranslationMap (const StringDictionaryProxy *source_proxy, StringDictionaryProxy *dest_proxy, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
 
const
StringOps_Namespace::StringOps * 
getStringOps (const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
 
StringDictionaryProxygetStringDictProxy (const int dict_id) const
 
StringDictionaryProxygetOrAddStringDictProxy (const int dict_id_in, const bool with_generation, const Catalog_Namespace::Catalog *catalog)
 
void addLiteralStringDictProxy (std::shared_ptr< StringDictionaryProxy > lit_str_dict_proxy)
 
StringDictionaryProxygetLiteralStringDictProxy () const
 
const
StringDictionaryProxy::IdMap
getOrAddStringProxyTranslationMap (const int source_dict_id_in, const int dest_dict_id_in, const bool with_generation, const StringTranslationType translation_map_type, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos, const Catalog_Namespace::Catalog *catalog)
 
void addColBuffer (const void *col_buffer)
 
 ~RowSetMemoryOwner ()
 
std::shared_ptr
< RowSetMemoryOwner
cloneStrDictDataOnly ()
 
void setDictionaryGenerations (StringDictionaryGenerations generations)
 
StringDictionaryGenerationsgetStringDictionaryGenerations ()
 
quantile::TDigestnullTDigest (double const q)
 

Private Attributes

std::vector
< CountDistinctBitmapBuffer
count_distinct_bitmaps_
 
std::vector< CountDistinctSet * > count_distinct_sets_
 
std::vector< int64_t * > group_by_buffers_
 
std::vector< void * > varlen_buffers_
 
std::list< std::string > strings_
 
std::list< std::vector< int64_t > > arrays_
 
std::unordered_map< int,
std::shared_ptr
< StringDictionaryProxy > > 
str_dict_proxy_owned_
 
std::map< std::string,
StringDictionaryProxy::IdMap
str_proxy_intersection_translation_maps_owned_
 
std::map< std::string,
StringDictionaryProxy::IdMap
str_proxy_union_translation_maps_owned_
 
std::shared_ptr
< StringDictionaryProxy
lit_str_dict_proxy_
 
StringDictionaryGenerations string_dictionary_generations_
 
std::vector< void * > col_buffers_
 
std::vector
< Data_Namespace::AbstractBuffer * > 
varlen_input_buffers_
 
std::vector< std::unique_ptr
< quantile::TDigest > > 
t_digests_
 
std::map< std::string,
std::shared_ptr
< StringOps_Namespace::StringOps > > 
string_ops_owned_
 
size_t arena_block_size_
 
std::vector< std::unique_ptr
< Arena > > 
allocators_
 
std::mutex state_mutex_
 

Friends

class ResultSet
 
class QueryExecutionContext
 

Additional Inherited Members

- Protected Member Functions inherited from SimpleAllocator
 ~SimpleAllocator ()=default
 

Detailed Description

Handles allocations and outputs for all stages in a query, either explicitly or via a managed allocator object

Definition at line 47 of file RowSetMemoryOwner.h.

Member Enumeration Documentation

Enumerator
SOURCE_INTERSECTION 
SOURCE_UNION 

Definition at line 57 of file RowSetMemoryOwner.h.

57 { SOURCE_INTERSECTION, SOURCE_UNION };

Constructor & Destructor Documentation

RowSetMemoryOwner::RowSetMemoryOwner ( const size_t  arena_block_size,
const size_t  num_kernel_threads = 0 
)
inline

Definition at line 49 of file RowSetMemoryOwner.h.

References allocators_, and CHECK.

50  : arena_block_size_(arena_block_size) {
51  for (size_t i = 0; i < num_kernel_threads + 1; i++) {
52  allocators_.emplace_back(std::make_unique<DramArena>(arena_block_size));
53  }
54  CHECK(!allocators_.empty());
55  }
std::vector< std::unique_ptr< Arena > > allocators_
#define CHECK(condition)
Definition: Logger.h:223
RowSetMemoryOwner::~RowSetMemoryOwner ( )
inline

Definition at line 245 of file RowSetMemoryOwner.h.

References CHECK, col_buffers_, count_distinct_sets_, group_by_buffers_, varlen_buffers_, and varlen_input_buffers_.

245  {
246  for (auto count_distinct_set : count_distinct_sets_) {
247  delete count_distinct_set;
248  }
249  for (auto group_by_buffer : group_by_buffers_) {
250  free(group_by_buffer);
251  }
252  for (auto varlen_buffer : varlen_buffers_) {
253  free(varlen_buffer);
254  }
255  for (auto varlen_input_buffer : varlen_input_buffers_) {
256  CHECK(varlen_input_buffer);
257  varlen_input_buffer->unPin();
258  }
259  for (auto col_buffer : col_buffers_) {
260  free(col_buffer);
261  }
262  }
std::vector< CountDistinctSet * > count_distinct_sets_
std::vector< void * > col_buffers_
std::vector< void * > varlen_buffers_
std::vector< Data_Namespace::AbstractBuffer * > varlen_input_buffers_
#define CHECK(condition)
Definition: Logger.h:223
std::vector< int64_t * > group_by_buffers_

Member Function Documentation

std::vector<int64_t>* RowSetMemoryOwner::addArray ( const std::vector< int64_t > &  arr)
inline

Definition at line 117 of file RowSetMemoryOwner.h.

References arrays_, and state_mutex_.

117  {
118  std::lock_guard<std::mutex> lock(state_mutex_);
119  arrays_.emplace_back(arr);
120  return &arrays_.back();
121  }
std::list< std::vector< int64_t > > arrays_
void RowSetMemoryOwner::addColBuffer ( const void *  col_buffer)
inline

Definition at line 240 of file RowSetMemoryOwner.h.

References col_buffers_, and state_mutex_.

240  {
241  std::lock_guard<std::mutex> lock(state_mutex_);
242  col_buffers_.push_back(const_cast<void*>(col_buffer));
243  }
std::vector< void * > col_buffers_
void RowSetMemoryOwner::addCountDistinctBuffer ( int8_t *  count_distinct_buffer,
const size_t  bytes,
const bool  physical_buffer 
)
inline

Definition at line 74 of file RowSetMemoryOwner.h.

References count_distinct_bitmaps_, and state_mutex_.

Referenced by allocateCountDistinctBuffer().

76  {
77  std::lock_guard<std::mutex> lock(state_mutex_);
78  count_distinct_bitmaps_.emplace_back(
79  CountDistinctBitmapBuffer{count_distinct_buffer, bytes, physical_buffer});
80  }
std::vector< CountDistinctBitmapBuffer > count_distinct_bitmaps_

+ Here is the caller graph for this function:

void RowSetMemoryOwner::addCountDistinctSet ( CountDistinctSet count_distinct_set)
inline

Definition at line 82 of file RowSetMemoryOwner.h.

References count_distinct_sets_, and state_mutex_.

82  {
83  std::lock_guard<std::mutex> lock(state_mutex_);
84  count_distinct_sets_.push_back(count_distinct_set);
85  }
std::vector< CountDistinctSet * > count_distinct_sets_
void RowSetMemoryOwner::addGroupByBuffer ( int64_t *  group_by_buffer)
inline

Definition at line 87 of file RowSetMemoryOwner.h.

References group_by_buffers_, and state_mutex_.

87  {
88  std::lock_guard<std::mutex> lock(state_mutex_);
89  group_by_buffers_.push_back(group_by_buffer);
90  }
std::vector< int64_t * > group_by_buffers_
void RowSetMemoryOwner::addLiteralStringDictProxy ( std::shared_ptr< StringDictionaryProxy lit_str_dict_proxy)
inline

Definition at line 221 of file RowSetMemoryOwner.h.

References lit_str_dict_proxy_, and state_mutex_.

222  {
223  std::lock_guard<std::mutex> lock(state_mutex_);
224  lit_str_dict_proxy_ = lit_str_dict_proxy;
225  }
std::shared_ptr< StringDictionaryProxy > lit_str_dict_proxy_
std::string* RowSetMemoryOwner::addString ( const std::string &  str)
inline

Definition at line 111 of file RowSetMemoryOwner.h.

References state_mutex_, and strings_.

111  {
112  std::lock_guard<std::mutex> lock(state_mutex_);
113  strings_.emplace_back(str);
114  return &strings_.back();
115  }
std::list< std::string > strings_
StringDictionaryProxy* RowSetMemoryOwner::addStringDict ( std::shared_ptr< StringDictionary str_dict,
const int  dict_id,
const int64_t  generation 
)
inline

Definition at line 123 of file RowSetMemoryOwner.h.

References CHECK_EQ, state_mutex_, and str_dict_proxy_owned_.

125  {
126  std::lock_guard<std::mutex> lock(state_mutex_);
127  auto it = str_dict_proxy_owned_.find(dict_id);
128  if (it != str_dict_proxy_owned_.end()) {
129  CHECK_EQ(it->second->getDictionary(), str_dict.get());
130  it->second->updateGeneration(generation);
131  return it->second.get();
132  }
134  .emplace(
135  dict_id,
136  std::make_shared<StringDictionaryProxy>(str_dict, dict_id, generation))
137  .first;
138  return it->second.get();
139  }
#define CHECK_EQ(x, y)
Definition: Logger.h:231
std::unordered_map< int, std::shared_ptr< StringDictionaryProxy > > str_dict_proxy_owned_
const StringDictionaryProxy::IdMap* RowSetMemoryOwner::addStringProxyIntersectionTranslationMap ( const StringDictionaryProxy source_proxy,
const StringDictionaryProxy dest_proxy,
const std::vector< StringOps_Namespace::StringOpInfo > &  string_op_infos 
)
inline

Definition at line 155 of file RowSetMemoryOwner.h.

References StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxy(), generate_translation_map_key(), StringDictionary::getDictId(), StringDictionaryProxy::getDictionary(), state_mutex_, and str_proxy_intersection_translation_maps_owned_.

158  {
159  std::lock_guard<std::mutex> lock(state_mutex_);
160  const auto map_key =
162  dest_proxy->getDictionary()->getDictId(),
163  string_op_infos);
164  auto it = str_proxy_intersection_translation_maps_owned_.find(map_key);
167  .emplace(map_key,
169  dest_proxy, string_op_infos))
170  .first;
171  }
172  return &it->second;
173  }
std::string generate_translation_map_key(const int32_t source_proxy_id, const int32_t dest_proxy_id, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
StringDictionary * getDictionary() const noexcept
std::map< std::string, StringDictionaryProxy::IdMap > str_proxy_intersection_translation_maps_owned_
int32_t getDictId() const noexcept
IdMap buildIntersectionTranslationMapToOtherProxy(const StringDictionaryProxy *dest_proxy, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos) const
Builds a vectorized string_id translation map from this proxy to dest_proxy.

+ Here is the call graph for this function:

const StringDictionaryProxy::IdMap* RowSetMemoryOwner::addStringProxyUnionTranslationMap ( const StringDictionaryProxy source_proxy,
StringDictionaryProxy dest_proxy,
const std::vector< StringOps_Namespace::StringOpInfo > &  string_op_infos 
)
inline

Definition at line 175 of file RowSetMemoryOwner.h.

References StringDictionaryProxy::buildUnionTranslationMapToOtherProxy(), generate_translation_map_key(), StringDictionary::getDictId(), StringDictionaryProxy::getDictionary(), state_mutex_, and str_proxy_union_translation_maps_owned_.

178  {
179  std::lock_guard<std::mutex> lock(state_mutex_);
180  const auto map_key =
182  dest_proxy->getDictionary()->getDictId(),
183  string_op_infos);
184  auto it = str_proxy_union_translation_maps_owned_.find(map_key);
185  if (it == str_proxy_union_translation_maps_owned_.end()) {
187  .emplace(map_key,
189  dest_proxy, string_op_infos))
190  .first;
191  }
192  return &it->second;
193  }
std::string generate_translation_map_key(const int32_t source_proxy_id, const int32_t dest_proxy_id, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
StringDictionary * getDictionary() const noexcept
std::map< std::string, StringDictionaryProxy::IdMap > str_proxy_union_translation_maps_owned_
IdMap buildUnionTranslationMapToOtherProxy(StringDictionaryProxy *dest_proxy, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_types) const
int32_t getDictId() const noexcept

+ Here is the call graph for this function:

void RowSetMemoryOwner::addVarlenBuffer ( void *  varlen_buffer)
inline

Definition at line 92 of file RowSetMemoryOwner.h.

References state_mutex_, and varlen_buffers_.

92  {
93  std::lock_guard<std::mutex> lock(state_mutex_);
94  if (std::find(varlen_buffers_.begin(), varlen_buffers_.end(), varlen_buffer) ==
95  varlen_buffers_.end()) {
96  varlen_buffers_.push_back(varlen_buffer);
97  }
98  }
std::vector< void * > varlen_buffers_
void RowSetMemoryOwner::addVarlenInputBuffer ( Data_Namespace::AbstractBuffer buffer)
inline

Adds a GPU buffer containing a variable length input column. Variable length inputs on GPU are referenced in output projected targets and should not be freed until the query results have been resolved.

Definition at line 105 of file RowSetMemoryOwner.h.

References CHECK_EQ, Data_Namespace::AbstractBuffer::getType(), Data_Namespace::GPU_LEVEL, state_mutex_, and varlen_input_buffers_.

105  {
106  std::lock_guard<std::mutex> lock(state_mutex_);
108  varlen_input_buffers_.push_back(buffer);
109  }
#define CHECK_EQ(x, y)
Definition: Logger.h:231
virtual MemoryLevel getType() const =0
std::vector< Data_Namespace::AbstractBuffer * > varlen_input_buffers_

+ Here is the call graph for this function:

int8_t* RowSetMemoryOwner::allocate ( const size_t  num_bytes,
const size_t  thread_idx = 0 
)
inlineoverridevirtual

Implements SimpleAllocator.

Definition at line 59 of file RowSetMemoryOwner.h.

References allocators_, CHECK_LT, and state_mutex_.

Referenced by anonymous_namespace{QueryMemoryInitializer.cpp}::alloc_group_by_buffer(), and allocateCountDistinctBuffer().

59  {
60  CHECK_LT(thread_idx, allocators_.size());
61  auto allocator = allocators_[thread_idx].get();
62  std::lock_guard<std::mutex> lock(state_mutex_);
63  return reinterpret_cast<int8_t*>(allocator->allocate(num_bytes));
64  }
std::vector< std::unique_ptr< Arena > > allocators_
#define CHECK_LT(x, y)
Definition: Logger.h:233

+ Here is the caller graph for this function:

int8_t* RowSetMemoryOwner::allocateCountDistinctBuffer ( const size_t  num_bytes,
const size_t  thread_idx = 0 
)
inline

Definition at line 66 of file RowSetMemoryOwner.h.

References addCountDistinctBuffer(), and allocate().

67  {
68  int8_t* buffer = allocate(num_bytes, thread_idx);
69  std::memset(buffer, 0, num_bytes);
70  addCountDistinctBuffer(buffer, num_bytes, /*physical_buffer=*/true);
71  return buffer;
72  }
void addCountDistinctBuffer(int8_t *count_distinct_buffer, const size_t bytes, const bool physical_buffer)
int8_t * allocate(const size_t num_bytes, const size_t thread_idx=0) override

+ Here is the call graph for this function:

std::shared_ptr<RowSetMemoryOwner> RowSetMemoryOwner::cloneStrDictDataOnly ( )
inline

Definition at line 264 of file RowSetMemoryOwner.h.

References arena_block_size_, lit_str_dict_proxy_, and str_dict_proxy_owned_.

264  {
265  auto rtn = std::make_shared<RowSetMemoryOwner>(arena_block_size_, /*num_kernels=*/1);
266  rtn->str_dict_proxy_owned_ = str_dict_proxy_owned_;
267  rtn->lit_str_dict_proxy_ = lit_str_dict_proxy_;
268  return rtn;
269  }
std::unordered_map< int, std::shared_ptr< StringDictionaryProxy > > str_dict_proxy_owned_
std::shared_ptr< StringDictionaryProxy > lit_str_dict_proxy_
std::string RowSetMemoryOwner::generate_translation_map_key ( const int32_t  source_proxy_id,
const int32_t  dest_proxy_id,
const std::vector< StringOps_Namespace::StringOpInfo > &  string_op_infos 
)
inline

Definition at line 141 of file RowSetMemoryOwner.h.

Referenced by addStringProxyIntersectionTranslationMap(), addStringProxyUnionTranslationMap(), and getStringOps().

144  {
145  std::ostringstream oss;
146  oss << "{source_dict_id: " << source_proxy_id << ", dest_dict_id: " << dest_proxy_id
147  << " StringOps: " << string_op_infos << "}";
148  // for (const auto& string_op_info : string_op_infos) {
149  // oss << "{" << string_op_info.toString() << "}";
150  //}
151  // oss << "]";
152  return oss.str();
153  }

+ Here is the caller graph for this function:

StringDictionaryProxy* RowSetMemoryOwner::getLiteralStringDictProxy ( ) const
inline

Definition at line 227 of file RowSetMemoryOwner.h.

References lit_str_dict_proxy_, and state_mutex_.

227  {
228  std::lock_guard<std::mutex> lock(state_mutex_);
229  return lit_str_dict_proxy_.get();
230  }
std::shared_ptr< StringDictionaryProxy > lit_str_dict_proxy_
StringDictionaryProxy * RowSetMemoryOwner::getOrAddStringDictProxy ( const int  dict_id_in,
const bool  with_generation,
const Catalog_Namespace::Catalog catalog 
)

Definition at line 548 of file Execute.cpp.

References CHECK, CHECK_EQ, CHECK_LE, g_cache_string_hash, Catalog_Namespace::Catalog::getDatabaseId(), Catalog_Namespace::Catalog::getMetadataForDict(), dict_ref_t::literalsDictId, and REGULAR_DICT.

551  {
552  const int dict_id{dict_id_in < 0 ? REGULAR_DICT(dict_id_in) : dict_id_in};
553  CHECK(catalog);
554  const auto dd = catalog->getMetadataForDict(dict_id);
555  if (dd) {
556  CHECK(dd->stringDict);
557  CHECK_LE(dd->dictNBits, 32);
558  const int64_t generation =
559  with_generation ? string_dictionary_generations_.getGeneration(dict_id) : -1;
560  return addStringDict(dd->stringDict, dict_id, generation);
561  }
563  if (!lit_str_dict_proxy_) {
564  DictRef literal_dict_ref(catalog->getDatabaseId(), DictRef::literalsDictId);
565  std::shared_ptr<StringDictionary> tsd = std::make_shared<StringDictionary>(
566  literal_dict_ref, "", false, true, g_cache_string_hash);
568  std::make_shared<StringDictionaryProxy>(tsd, literal_dict_ref.dictId, 0);
569  }
570  return lit_str_dict_proxy_.get();
571 }
#define CHECK_EQ(x, y)
Definition: Logger.h:231
int64_t getGeneration(const uint32_t id) const
StringDictionaryProxy * addStringDict(std::shared_ptr< StringDictionary > str_dict, const int dict_id, const int64_t generation)
std::shared_ptr< StringDictionaryProxy > lit_str_dict_proxy_
int getDatabaseId() const
Definition: Catalog.h:284
const DictDescriptor * getMetadataForDict(int dict_ref, bool loadDict=true) const
Definition: Catalog.cpp:1673
StringDictionaryGenerations string_dictionary_generations_
#define REGULAR_DICT(TRANSIENTID)
Definition: sqltypes.h:261
#define CHECK_LE(x, y)
Definition: Logger.h:234
bool g_cache_string_hash
#define CHECK(condition)
Definition: Logger.h:223
static constexpr int32_t literalsDictId
Definition: DictRef.h:15

+ Here is the call graph for this function:

const StringDictionaryProxy::IdMap * RowSetMemoryOwner::getOrAddStringProxyTranslationMap ( const int  source_dict_id_in,
const int  dest_dict_id_in,
const bool  with_generation,
const StringTranslationType  translation_map_type,
const std::vector< StringOps_Namespace::StringOpInfo > &  string_op_infos,
const Catalog_Namespace::Catalog catalog 
)

Definition at line 610 of file Execute.cpp.

References SOURCE_INTERSECTION.

616  {
617  const auto source_proxy =
618  getOrAddStringDictProxy(source_dict_id_in, with_generation, catalog);
619  auto dest_proxy = getOrAddStringDictProxy(dest_dict_id_in, with_generation, catalog);
622  source_proxy, dest_proxy, string_op_infos);
623  } else {
624  return addStringProxyUnionTranslationMap(source_proxy, dest_proxy, string_op_infos);
625  }
626 }
StringDictionaryProxy * getOrAddStringDictProxy(const int dict_id_in, const bool with_generation, const Catalog_Namespace::Catalog *catalog)
Definition: Execute.cpp:548
const StringDictionaryProxy::IdMap * addStringProxyUnionTranslationMap(const StringDictionaryProxy *source_proxy, StringDictionaryProxy *dest_proxy, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
const StringDictionaryProxy::IdMap * addStringProxyIntersectionTranslationMap(const StringDictionaryProxy *source_proxy, const StringDictionaryProxy *dest_proxy, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
StringDictionaryGenerations& RowSetMemoryOwner::getStringDictionaryGenerations ( )
inline

Definition at line 275 of file RowSetMemoryOwner.h.

References string_dictionary_generations_.

275  {
277  }
StringDictionaryGenerations string_dictionary_generations_
StringDictionaryProxy* RowSetMemoryOwner::getStringDictProxy ( const int  dict_id) const
inline

Definition at line 209 of file RowSetMemoryOwner.h.

References CHECK, state_mutex_, and str_dict_proxy_owned_.

209  {
210  std::lock_guard<std::mutex> lock(state_mutex_);
211  auto it = str_dict_proxy_owned_.find(dict_id);
212  CHECK(it != str_dict_proxy_owned_.end());
213  return it->second.get();
214  }
std::unordered_map< int, std::shared_ptr< StringDictionaryProxy > > str_dict_proxy_owned_
#define CHECK(condition)
Definition: Logger.h:223
const StringOps_Namespace::StringOps* RowSetMemoryOwner::getStringOps ( const std::vector< StringOps_Namespace::StringOpInfo > &  string_op_infos)
inline

Definition at line 195 of file RowSetMemoryOwner.h.

References generate_translation_map_key(), state_mutex_, and string_ops_owned_.

196  {
197  std::lock_guard<std::mutex> lock(state_mutex_);
198  const auto map_key = generate_translation_map_key(0, 0, string_op_infos);
199  auto it = string_ops_owned_.find(map_key);
200  if (it == string_ops_owned_.end()) {
201  it = string_ops_owned_
202  .emplace(map_key,
203  std::make_shared<StringOps_Namespace::StringOps>(string_op_infos))
204  .first;
205  }
206  return it->second.get();
207  }
std::string generate_translation_map_key(const int32_t source_proxy_id, const int32_t dest_proxy_id, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos)
std::map< std::string, std::shared_ptr< StringOps_Namespace::StringOps > > string_ops_owned_

+ Here is the call graph for this function:

quantile::TDigest * RowSetMemoryOwner::nullTDigest ( double const  q)

Definition at line 628 of file Execute.cpp.

References g_approx_quantile_buffer, and g_approx_quantile_centroids.

628  {
629  std::lock_guard<std::mutex> lock(state_mutex_);
630  return t_digests_
631  .emplace_back(std::make_unique<quantile::TDigest>(
633  .get();
634 }
size_t g_approx_quantile_buffer
Definition: Execute.cpp:158
std::vector< std::unique_ptr< quantile::TDigest > > t_digests_
size_t g_approx_quantile_centroids
Definition: Execute.cpp:159
void RowSetMemoryOwner::setDictionaryGenerations ( StringDictionaryGenerations  generations)
inline

Definition at line 271 of file RowSetMemoryOwner.h.

References string_dictionary_generations_.

271  {
272  string_dictionary_generations_ = generations;
273  }
StringDictionaryGenerations string_dictionary_generations_

Friends And Related Function Documentation

friend class QueryExecutionContext
friend

Definition at line 313 of file RowSetMemoryOwner.h.

friend class ResultSet
friend

Definition at line 312 of file RowSetMemoryOwner.h.

Member Data Documentation

std::vector<std::unique_ptr<Arena> > RowSetMemoryOwner::allocators_
private

Definition at line 308 of file RowSetMemoryOwner.h.

Referenced by allocate(), and RowSetMemoryOwner().

size_t RowSetMemoryOwner::arena_block_size_
private

Definition at line 307 of file RowSetMemoryOwner.h.

Referenced by cloneStrDictDataOnly().

std::list<std::vector<int64_t> > RowSetMemoryOwner::arrays_
private

Definition at line 293 of file RowSetMemoryOwner.h.

Referenced by addArray().

std::vector<void*> RowSetMemoryOwner::col_buffers_
private

Definition at line 301 of file RowSetMemoryOwner.h.

Referenced by addColBuffer(), and ~RowSetMemoryOwner().

std::vector<CountDistinctBitmapBuffer> RowSetMemoryOwner::count_distinct_bitmaps_
private

Definition at line 288 of file RowSetMemoryOwner.h.

Referenced by addCountDistinctBuffer().

std::vector<CountDistinctSet*> RowSetMemoryOwner::count_distinct_sets_
private

Definition at line 289 of file RowSetMemoryOwner.h.

Referenced by addCountDistinctSet(), and ~RowSetMemoryOwner().

std::vector<int64_t*> RowSetMemoryOwner::group_by_buffers_
private

Definition at line 290 of file RowSetMemoryOwner.h.

Referenced by addGroupByBuffer(), and ~RowSetMemoryOwner().

std::shared_ptr<StringDictionaryProxy> RowSetMemoryOwner::lit_str_dict_proxy_
private
std::unordered_map<int, std::shared_ptr<StringDictionaryProxy> > RowSetMemoryOwner::str_dict_proxy_owned_
private

Definition at line 294 of file RowSetMemoryOwner.h.

Referenced by addStringDict(), cloneStrDictDataOnly(), and getStringDictProxy().

std::map<std::string, StringDictionaryProxy::IdMap> RowSetMemoryOwner::str_proxy_intersection_translation_maps_owned_
private

Definition at line 296 of file RowSetMemoryOwner.h.

Referenced by addStringProxyIntersectionTranslationMap().

std::map<std::string, StringDictionaryProxy::IdMap> RowSetMemoryOwner::str_proxy_union_translation_maps_owned_
private

Definition at line 298 of file RowSetMemoryOwner.h.

Referenced by addStringProxyUnionTranslationMap().

StringDictionaryGenerations RowSetMemoryOwner::string_dictionary_generations_
private
std::map<std::string, std::shared_ptr<StringOps_Namespace::StringOps> > RowSetMemoryOwner::string_ops_owned_
private

Definition at line 305 of file RowSetMemoryOwner.h.

Referenced by getStringOps().

std::list<std::string> RowSetMemoryOwner::strings_
private

Definition at line 292 of file RowSetMemoryOwner.h.

Referenced by addString().

std::vector<std::unique_ptr<quantile::TDigest> > RowSetMemoryOwner::t_digests_
private

Definition at line 303 of file RowSetMemoryOwner.h.

std::vector<void*> RowSetMemoryOwner::varlen_buffers_
private

Definition at line 291 of file RowSetMemoryOwner.h.

Referenced by addVarlenBuffer(), and ~RowSetMemoryOwner().

std::vector<Data_Namespace::AbstractBuffer*> RowSetMemoryOwner::varlen_input_buffers_
private

Definition at line 302 of file RowSetMemoryOwner.h.

Referenced by addVarlenInputBuffer(), and ~RowSetMemoryOwner().


The documentation for this class was generated from the following files: