MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Private 属性 | 所有成员列表
Catalog类 参考

Store metadata, such as table statistics. 更多...

#include <catalog.h>

Public 成员函数

 Catalog (const Catalog &)=delete
 
Catalogoperator= (const Catalog &)=delete
 
const TableStatsget_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 Catalogget_instance ()
 Gets the singleton instance of the Catalog. 更多...
 

Private 属性

mutex mutex_
 
unordered_map< int, TableStatstable_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.

成员函数说明

◆ get_instance()

static Catalog & Catalog::get_instance ( )
inlinestatic

Gets the singleton instance of the Catalog.

This method ensures there is only one instance of the Catalog.

返回
A reference to the singleton instance of the Catalog.

◆ get_table_stats()

const TableStats & Catalog::get_table_stats ( int  table_id)

Retrieves table statistics for a given table_id.

参数
table_idThe identifier of the table for which statistics are requested.
返回
A constant reference to the TableStats of the specified table_id.

◆ update_table_stats()

void Catalog::update_table_stats ( int  table_id,
const TableStats table_stats 
)

Updates table statistics for a given table.

参数
table_idThe identifier of the table for which statistics are updated.
table_statsThe new table statistics to be set.

类成员变量说明

◆ table_stats_

unordered_map<int, TableStats> Catalog::table_stats_
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.


该类的文档由以下文件生成: