OmniSciDB  04ee39c94c
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::TableInfocache_
 
Executorexecutor_
 

Detailed Description

Definition at line 38 of file InputMetadata.h.

Constructor & Destructor Documentation

◆ InputTableInfoCache()

InputTableInfoCache::InputTableInfoCache ( Executor executor)

Definition at line 24 of file InputMetadata.cpp.

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

Member Function Documentation

◆ clear()

void InputTableInfoCache::clear ( )

Definition at line 72 of file InputMetadata.cpp.

References cache_.

Referenced by Executor::clearMetaInfoCache().

72  {
73  decltype(cache_)().swap(cache_);
74 }
std::unordered_map< int, Fragmenter_Namespace::TableInfo > cache_
Definition: InputMetadata.h:47
+ Here is the caller graph for this function:

◆ getTableInfo()

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

Definition at line 55 of file InputMetadata.cpp.

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

Referenced by Executor::getTableInfo().

55  {
56  const auto it = cache_.find(table_id);
57  if (it != cache_.end()) {
58  const auto& table_info = it->second;
59  return copy_table_info(table_info);
60  }
61  const auto cat = executor_->getCatalog();
62  CHECK(cat);
63  const auto td = cat->getMetadataForTable(table_id);
64  CHECK(td);
65  const auto shard_tables = cat->getPhysicalTablesDescriptors(td);
66  auto table_info = build_table_info(shard_tables);
67  auto it_ok = cache_.emplace(table_id, copy_table_info(table_info));
68  CHECK(it_ok.second);
69  return copy_table_info(table_info);
70 }
Fragmenter_Namespace::TableInfo copy_table_info(const Fragmenter_Namespace::TableInfo &table_info)
Executor * executor_
Definition: InputMetadata.h:48
#define CHECK(condition)
Definition: Logger.h:187
std::unordered_map< int, Fragmenter_Namespace::TableInfo > cache_
Definition: InputMetadata.h:47
Fragmenter_Namespace::TableInfo build_table_info(const std::vector< const TableDescriptor *> &shard_tables)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ cache_

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

Definition at line 47 of file InputMetadata.h.

Referenced by clear(), and getTableInfo().

◆ executor_

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: