OmniSciDB  72c90bc290
 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 shared::TableKey &table_key)
 
void clear ()
 

Private Attributes

std::unordered_map
< shared::TableKey,
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 80 of file InputMetadata.cpp.

References cache_, and gpu_enabled::swap().

Referenced by Executor::clearMetaInfoCache().

80  {
81  decltype(cache_)().swap(cache_);
82 }
std::unordered_map< shared::TableKey, 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 shared::TableKey table_key)

Definition at line 62 of file InputMetadata.cpp.

References build_table_info(), cache_, cat(), CHECK, anonymous_namespace{InputMetadata.cpp}::copy_table_info(), shared::TableKey::db_id, Catalog_Namespace::SysCatalog::getCatalog(), Catalog_Namespace::SysCatalog::instance(), and shared::TableKey::table_id.

Referenced by Executor::getTableInfo().

63  {
64  const auto it = cache_.find(table_key);
65  if (it != cache_.end()) {
66  const auto& table_info = it->second;
67  return copy_table_info(table_info);
68  }
70  CHECK(cat);
71  const auto td = cat->getMetadataForTable(table_key.table_id);
72  CHECK(td);
73  const auto shard_tables = cat->getPhysicalTablesDescriptors(td);
74  auto table_info = build_table_info(shard_tables);
75  auto it_ok = cache_.emplace(table_key, copy_table_info(table_info));
76  CHECK(it_ok.second);
77  return copy_table_info(table_info);
78 }
std::string cat(Ts &&...args)
Fragmenter_Namespace::TableInfo copy_table_info(const Fragmenter_Namespace::TableInfo &table_info)
Fragmenter_Namespace::TableInfo build_table_info(const std::vector< const TableDescriptor * > &shard_tables)
static SysCatalog & instance()
Definition: SysCatalog.h:343
std::shared_ptr< Catalog > getCatalog(const std::string &dbName)
std::unordered_map< shared::TableKey, Fragmenter_Namespace::TableInfo > cache_
Definition: InputMetadata.h:47
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::unordered_map<shared::TableKey, 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.


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