OmniSciDB  4201147b46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InputTableInfoCache Class Reference

#include <InputMetadata.h>

+ Collaboration diagram for InputTableInfoCache:

Public Member Functions

 InputTableInfoCache (Executor *executor)
 
Fragmenter_Namespace::TableInfo getTableInfo (const int table_id)
 
void clear ()
 

Private Attributes

std::unordered_map< int,
Fragmenter_Namespace::TableInfo
cache_
 
Executorexecutor_
 

Detailed Description

Definition at line 38 of file InputMetadata.h.

Constructor & Destructor Documentation

InputTableInfoCache::InputTableInfoCache ( Executor executor)

Definition at line 29 of file InputMetadata.cpp.

29 : executor_(executor) {}
Executor * executor_
Definition: InputMetadata.h:48

Member Function Documentation

void InputTableInfoCache::clear ( )

Definition at line 79 of file InputMetadata.cpp.

References cache_, and gpu_enabled::swap().

Referenced by Executor::clearMetaInfoCache().

79  {
80  decltype(cache_)().swap(cache_);
81 }
std::unordered_map< int, Fragmenter_Namespace::TableInfo > cache_
Definition: InputMetadata.h:47
DEVICE void swap(ARGS &&...args)
Definition: gpu_enabled.h:114

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Fragmenter_Namespace::TableInfo InputTableInfoCache::getTableInfo ( const int  table_id)

Definition at line 62 of file InputMetadata.cpp.

References build_table_info(), cache_, cat(), CHECK, anonymous_namespace{InputMetadata.cpp}::copy_table_info(), and executor_.

Referenced by Executor::getTableInfo().

62  {
63  const auto it = cache_.find(table_id);
64  if (it != cache_.end()) {
65  const auto& table_info = it->second;
66  return copy_table_info(table_info);
67  }
68  const auto cat = executor_->getCatalog();
69  CHECK(cat);
70  const auto td = cat->getMetadataForTable(table_id);
71  CHECK(td);
72  const auto shard_tables = cat->getPhysicalTablesDescriptors(td);
73  auto table_info = build_table_info(shard_tables);
74  auto it_ok = cache_.emplace(table_id, copy_table_info(table_info));
75  CHECK(it_ok.second);
76  return copy_table_info(table_info);
77 }
std::string cat(Ts &&...args)
Fragmenter_Namespace::TableInfo copy_table_info(const Fragmenter_Namespace::TableInfo &table_info)
Executor * executor_
Definition: InputMetadata.h:48
Fragmenter_Namespace::TableInfo build_table_info(const std::vector< const TableDescriptor * > &shard_tables)
#define CHECK(condition)
Definition: Logger.h:222
std::unordered_map< int, Fragmenter_Namespace::TableInfo > cache_
Definition: InputMetadata.h:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::unordered_map<int, Fragmenter_Namespace::TableInfo> InputTableInfoCache::cache_
private

Definition at line 47 of file InputMetadata.h.

Referenced by clear(), and getTableInfo().

Executor* InputTableInfoCache::executor_
private

Definition at line 48 of file InputMetadata.h.

Referenced by getTableInfo().


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