taco-db  0.1.0
BootstrapCatCache.h
Go to the documentation of this file.
1 #ifndef CATALOG_BOOTSTRAPCATCACHE_H
2 #define CATALOG_BOOTSTRAPCATCACHE_H
3 
4 #include "tdb.h"
5 
6 #include <absl/container/flat_hash_map.h>
7 
8 #include "catalog/systables.h"
9 #include "catalog/TableDesc.h"
11 
12 namespace taco {
13 
22 public:
30 
32 
37  void Init();
38 
39  const SysTable_Table *FindTable(Oid oid);
40 
41  const SysTable_Type *FindType(Oid oid);
42 
43  std::vector<const SysTable_Column*> FindColumns(Oid tabid);
44 
45  const TableDesc *FindTableDesc(Oid oid);
46 
48 
49 private:
54  void CreateTableDesc(const std::vector<const SysTable_Column*> &columns);
55 
60 
61  absl::flat_hash_map<Oid, const SysTable_Table*> m_tabid_lookup_table;
62  absl::flat_hash_map<Oid, const SysTable_Type*> m_typid_lookup_table;
63  absl::flat_hash_map<Oid, const SysTable_Function*> m_funcid_lookup_table;
64 
65  std::vector<std::unique_ptr<TableDesc>> m_table_desc;
66  absl::flat_hash_map<Oid, const TableDesc *> m_table_desc_lookup_table;
67 
68 };
69 
70 } // namespace taco
71 
72 #endif // CATALOG_BOOTSTRAP_CATCACHE_H
taco::BootstrapCatCache::~BootstrapCatCache
~BootstrapCatCache()
Definition: BootstrapCatCache.cpp:9
taco::SysTable_Function
SysTable_Function is an in-memory cached record in the system catalog SysTable_Function.
Definition: Function.h:16
taco::BootstrapCatCache::BootstrapCatCache
BootstrapCatCache()
Initializes the data in the bootstrap systables.
Definition: bootstrap_data.cpp:13
taco::BootstrapCatCache::m_table_desc_lookup_table
absl::flat_hash_map< Oid, const TableDesc * > m_table_desc_lookup_table
Definition: BootstrapCatCache.h:66
taco::TableDesc
Definition: TableDesc.h:11
taco::BootstrapCatCache::m_funcid_lookup_table
absl::flat_hash_map< Oid, const SysTable_Function * > m_funcid_lookup_table
Definition: BootstrapCatCache.h:63
taco::BootstrapCatCache::m_tabid_lookup_table
absl::flat_hash_map< Oid, const SysTable_Table * > m_tabid_lookup_table
Definition: BootstrapCatCache.h:61
taco::BootstrapCatCache::FindColumns
std::vector< const SysTable_Column * > FindColumns(Oid tabid)
Definition: BootstrapCatCache.cpp:84
taco
Definition: datum.h:28
taco::num_bootstrap_functions
constexpr const int num_bootstrap_functions
Definition: bootstrap_data.h:14
taco::BootstrapCatCache::FindType
const SysTable_Type * FindType(Oid oid)
Definition: BootstrapCatCache.cpp:68
taco::BootstrapCatCache::m_function
SysTable_Function m_function[num_bootstrap_functions]
Definition: BootstrapCatCache.h:59
taco::BootstrapCatCache::FindTableDesc
const TableDesc * FindTableDesc(Oid oid)
Definition: BootstrapCatCache.cpp:95
taco::num_bootstrap_types
constexpr const int num_bootstrap_types
Definition: bootstrap_data.h:13
TableDesc.h
tdb.h
taco::BootstrapCatCache::m_type
SysTable_Type m_type[num_bootstrap_types]
Definition: BootstrapCatCache.h:57
taco::SysTable_Type
SysTable_Type is an in-memory cached record in the system catalog SysTable_Type.
Definition: Type.h:16
systables.h
taco::BootstrapCatCache::m_table
SysTable_Table m_table[num_bootstrap_tables]
Definition: BootstrapCatCache.h:56
taco::num_bootstrap_tables
constexpr const int num_bootstrap_tables
Definition: bootstrap_data.h:12
taco::BootstrapCatCache::FindTable
const SysTable_Table * FindTable(Oid oid)
Definition: BootstrapCatCache.cpp:60
taco::SysTable_Table
SysTable_Table is an in-memory cached record in the system catalog SysTable_Table.
Definition: Table.h:16
taco::BootstrapCatCache
BootstrapCatCache stores hard-coded data needed to bootstrap the entire database catalog.
Definition: BootstrapCatCache.h:21
taco::BootstrapCatCache::m_table_desc
std::vector< std::unique_ptr< TableDesc > > m_table_desc
Definition: BootstrapCatCache.h:65
taco::BootstrapCatCache::CreateTableDesc
void CreateTableDesc(const std::vector< const SysTable_Column * > &columns)
Creates a TableDesc object for a systable table that consists of the `‘columns’', and insert it into ...
Definition: BootstrapCatCache.cpp:104
taco::Oid
uint32_t Oid
Definition: tdb_base.h:211
bootstrap_data.h
taco::BootstrapCatCache::m_typid_lookup_table
absl::flat_hash_map< Oid, const SysTable_Type * > m_typid_lookup_table
Definition: BootstrapCatCache.h:62
taco::BootstrapCatCache::Init
void Init()
Finishes the initialization of the bootstrap catalog cache.
Definition: BootstrapCatCache.cpp:12
taco::BootstrapCatCache::FindFunction
const SysTable_Function * FindFunction(Oid oid)
Definition: BootstrapCatCache.cpp:76
taco::num_bootstrap_columns
constexpr const int num_bootstrap_columns
Definition: bootstrap_data.h:15
taco::SysTable_Column
SysTable_Column is an in-memory cached record in the system catalog SysTable_Column.
Definition: Column.h:16
taco::BootstrapCatCache::m_column
SysTable_Column m_column[num_bootstrap_columns]
Definition: BootstrapCatCache.h:58