OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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,

Detailed Description

Definition at line 38 of file InputMetadata.h.

Constructor & Destructor Documentation

InputTableInfoCache::InputTableInfoCache ( Executor executor)

Definition at line 24 of file InputMetadata.cpp.

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

Member Function Documentation

void InputTableInfoCache::clear ( )

Definition at line 74 of file InputMetadata.cpp.

References cache_, and gpu_enabled::swap().

74  {
75  decltype(cache_)().swap(cache_);
76 }
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:

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

Definition at line 57 of file InputMetadata.cpp.

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

57  {
58  const auto it = cache_.find(table_id);
59  if (it != cache_.end()) {
60  const auto& table_info = it->second;
61  return copy_table_info(table_info);
62  }
63  const auto cat = executor_->getCatalog();
64  CHECK(cat);
65  const auto td = cat->getMetadataForTable(table_id);
66  CHECK(td);
67  const auto shard_tables = cat->getPhysicalTablesDescriptors(td);
68  auto table_info = build_table_info(shard_tables);
69  auto it_ok = cache_.emplace(table_id, copy_table_info(table_info));
70  CHECK(it_ok.second);
71  return copy_table_info(table_info);
72 }
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:206
std::unordered_map< int, Fragmenter_Namespace::TableInfo > cache_
Definition: InputMetadata.h:47

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 47 of file InputMetadata.h.

Referenced by clear(), and getTableInfo().

Executor* InputTableInfoCache::executor_

Definition at line 48 of file InputMetadata.h.

Referenced by getTableInfo().

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