MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
Store metadata, such as table statistics. 更多...
#include <catalog.h>
Public 成员函数 | |
Catalog (const Catalog &)=delete | |
Catalog & | operator= (const Catalog &)=delete |
const TableStats & | get_table_stats (int table_id) |
Retrieves table statistics for a given table_id. 更多... | |
void | update_table_stats (int table_id, const TableStats &table_stats) |
Updates table statistics for a given table. 更多... | |
静态 Public 成员函数 | |
static Catalog & | get_instance () |
Gets the singleton instance of the Catalog. 更多... | |
Private 属性 | |
mutex | mutex_ |
unordered_map< int, TableStats > | table_stats_ |
A map storing the table statistics indexed by table_id. 更多... | |
Store metadata, such as table statistics.
The Catalog class provides methods to access and update metadata related to tables, such as table statistics. It is designed as a singleton to ensure a single point of management for the metadata.
|
inlinestatic |
const TableStats & Catalog::get_table_stats | ( | int | table_id | ) |
Retrieves table statistics for a given table_id.
table_id | The identifier of the table for which statistics are requested. |
void Catalog::update_table_stats | ( | int | table_id, |
const TableStats & | table_stats | ||
) |
Updates table statistics for a given table.
table_id | The identifier of the table for which statistics are updated. |
table_stats | The new table statistics to be set. |
|
private |
A map storing the table statistics indexed by table_id.
This map is currently not persisted and its persistence is planned via a system table. Table statistics storage.