OmniSciDB  f632821e96
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 74 of file InputMetadata.cpp.

References cache_.

Referenced by Executor::clearMetaInfoCache().

74  {
75  decltype(cache_)().swap(cache_);
76 }
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 57 of file InputMetadata.cpp.

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

Referenced by Executor::getTableInfo().

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 }
Fragmenter_Namespace::TableInfo copy_table_info(const Fragmenter_Namespace::TableInfo &table_info)
Executor * executor_
Definition: InputMetadata.h:48
std::string cat(Ts &&... args)
#define CHECK(condition)
Definition: Logger.h:197
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: