25 const std::string& data_dir,
26 const size_t num_reader_threads,
28 : AbstractBufferMgr(0), disk_cache_config_(disk_cache_config) {
29 fsi_ = std::make_shared<ForeignStorageInterface>();
35 ? std::make_unique<foreign_storage::ForeignStorageCache>(disk_cache_config)
43 0,
fsi_, data_dir, num_reader_threads);
49 std::make_unique<foreign_storage::CachingForeignStorageMgr>(
disk_cache_.get());
56 const size_t page_size,
57 const size_t initial_size) {
59 chunk_key, page_size, initial_size);
69 ->deleteBuffersWithPrefix(chunk_key_prefix, purge);
73 const size_t num_bytes) {
79 const size_t num_bytes) {
81 chunk_key, destination_buffer, num_bytes);
86 const size_t num_bytes) {
88 chunk_key, source_buffer, num_bytes);
95 ->getChunkMetadataVecForKeyPrefix(chunk_metadata, key_prefix);
139 return PERSISTENT_STORAGE_MGR;
143 return ToString(PERSISTENT_STORAGE_MGR);
159 const int tb_id)
const {
163 dynamic_cast<File_Namespace::CachingGlobalFileMgr*>(
global_file_mgr_.get())) {
164 cfm->removeCachedData(db_id, tb_id);
184 auto table = catalog->getMetadataForTable(table_id,
false);
size_t getInUseSize() override
std::string getStringMgrType() override
std::vector< int > ChunkKey
size_t getAllocated() override
PersistentStorageMgr(const std::string &data_dir, const size_t num_reader_threads, const File_Namespace::DiskCacheConfig &disk_cache_config)
AbstractBuffer * alloc(const size_t num_bytes) override
void registerArrowForeignStorage(std::shared_ptr< ForeignStorageInterface > fsi)
void deleteBuffer(const ChunkKey &chunk_key, const bool purge) override
void registerArrowCsvForeignStorage(std::shared_ptr< ForeignStorageInterface > fsi)
File_Namespace::GlobalFileMgr * getGlobalFileMgr() const
foreign_storage::ForeignStorageMgr * getForeignStorageMgr() const
void checkpoint() override
This file contains the class specification and related data structures for Catalog.
size_t getMaxSize() override
foreign_storage::ForeignStorageCache * getDiskCache() const
static SysCatalog & instance()
AbstractBuffer * createBuffer(const ChunkKey &chunk_key, const size_t page_size, const size_t initial_size) override
std::shared_ptr< ForeignStorageInterface > fsi_
bool isForeignStorage(const ChunkKey &chunk_key) const
#define CHUNK_KEY_TABLE_IDX
void getChunkMetadataVecForKeyPrefix(ChunkMetadataVector &chunk_metadata, const ChunkKey &chunk_key_prefix) override
bool has_table_prefix(const ChunkKey &key)
An AbstractBuffer is a unit of data management for a data manager.
void deleteBuffersWithPrefix(const ChunkKey &chunk_key_prefix, const bool purge) override
MgrType getMgrType() override
bool isEnabledForFSI() const
std::shared_ptr< Catalog > getCatalog(const std::string &dbName)
size_t getNumChunks() override
std::unique_ptr< foreign_storage::ForeignStorageCache > disk_cache_
bool isEnabledForMutableTables() const
File_Namespace::DiskCacheConfig disk_cache_config_
AbstractBuffer * getBuffer(const ChunkKey &chunk_key, const size_t num_bytes) override
void removeTableRelatedDS(const int db_id, const int table_id) override
std::unique_ptr< File_Namespace::GlobalFileMgr > global_file_mgr_
AbstractBufferMgr * getStorageMgrForTableKey(const ChunkKey &table_key) const
void removeMutableTableCacheData(const int db_id, const int table_id) const
AbstractBuffer * putBuffer(const ChunkKey &chunk_key, AbstractBuffer *source_buffer, const size_t num_bytes) override
void fetchBuffer(const ChunkKey &chunk_key, AbstractBuffer *destination_buffer, const size_t num_bytes) override
bool isBufferOnDevice(const ChunkKey &chunk_key) override
static constexpr char const * FOREIGN_TABLE
std::unique_ptr< foreign_storage::ForeignStorageMgr > foreign_storage_mgr_
bool isAllocationCapped() override
std::string printSlabs() override
void free(AbstractBuffer *buffer) override