OmniSciDB
a5dc49c757
|
#include <CachingGlobalFileMgr.h>
Public Member Functions | |
CachingGlobalFileMgr (int32_t device_id, std::shared_ptr< ForeignStorageInterface > fsi, const std::string &base_path, size_t num_reader_threads, foreign_storage::ForeignStorageCache *disk_cache, size_t defaultPageSize=DEFAULT_PAGE_SIZE) | |
AbstractBuffer * | createBuffer (const ChunkKey &chunk_key, const size_t page_size, const size_t initial_size) override |
void | deleteBuffer (const ChunkKey &chunk_key, const bool purge) override |
void | deleteBuffersWithPrefix (const ChunkKey &chunk_key_prefix, const bool purge) override |
void | getChunkMetadataVecForKeyPrefix (ChunkMetadataVector &chunk_metadata, const ChunkKey &keyPrefix) override |
void | fetchBuffer (const ChunkKey &chunk_key, AbstractBuffer *destination_buffer, const size_t num_bytes) override |
AbstractBuffer * | putBuffer (const ChunkKey &chunk_key, AbstractBuffer *source_buffer, const size_t num_bytes) override |
void | checkpoint () override |
void | checkpoint (const int db_id, const int tb_id) override |
void | removeTableRelatedDS (const int db_id, const int table_id) override |
void | removeCachedData (const int db_id, const int table_id) |
Public Member Functions inherited from File_Namespace::GlobalFileMgr | |
GlobalFileMgr (const int32_t device_id, std::shared_ptr< ForeignStorageInterface > fsi, std::string base_path=".", const size_t num_reader_threads=0, const size_t page_size=DEFAULT_PAGE_SIZE, const size_t metadata_page_size=DEFAULT_METADATA_PAGE_SIZE) | |
Constructor. More... | |
~GlobalFileMgr () override | |
AbstractBuffer * | createBuffer (const ChunkKey &key, size_t pageSize=0, const size_t numBytes=0) override |
Creates a chunk with the specified key and page size. More... | |
bool | isBufferOnDevice (const ChunkKey &key) override |
void | deleteBuffer (const ChunkKey &key, const bool purge=true) override |
Deletes the chunk with the specified key. More... | |
void | deleteBuffersWithPrefix (const ChunkKey &keyPrefix, const bool purge=true) override |
AbstractBuffer * | getBuffer (const ChunkKey &key, const size_t numBytes=0) override |
Returns the a pointer to the chunk with the specified key. More... | |
void | fetchBuffer (const ChunkKey &key, AbstractBuffer *destBuffer, const size_t numBytes) override |
AbstractBuffer * | putBuffer (const ChunkKey &key, AbstractBuffer *d, const size_t numBytes=0) override |
Puts the contents of d into the Chunk with the given key. More... | |
AbstractBuffer * | alloc (const size_t numBytes) override |
void | free (AbstractBuffer *buffer) override |
MgrType | getMgrType () override |
std::string | getStringMgrType () override |
std::string | printSlabs () override |
size_t | getMaxSize () override |
size_t | getInUseSize () override |
size_t | getAllocated () override |
bool | isAllocationCapped () override |
void | init () |
void | getChunkMetadataVecForKeyPrefix (ChunkMetadataVector &chunkMetadataVec, const ChunkKey &keyPrefix) override |
void | checkpoint () override |
Fsyncs data files, writes out epoch and fsyncs that. More... | |
void | checkpoint (const int32_t db_id, const int32_t tb_id) override |
size_t | getNumReaderThreads () |
Returns number of threads defined by parameter num-reader-threads which should be used during initial load and consequent read of data. More... | |
size_t | getNumChunks () override |
void | compactDataFiles (const int32_t db_id, const int32_t tb_id) |
AbstractBufferMgr * | findFileMgr (const int32_t db_id, const int32_t tb_id) |
void | setFileMgrParams (const int32_t db_id, const int32_t tb_id, const FileMgrParams &file_mgr_params) |
AbstractBufferMgr * | getFileMgr (const int32_t db_id, const int32_t tb_id) |
AbstractBufferMgr * | getFileMgr (const ChunkKey &key) |
std::string | getBasePath () const |
size_t | getPageSize () const |
size_t | getMetadataPageSize () const |
void | writeFileMgrData (FileMgr *fileMgr=0) |
bool | getDBConvert () const |
void | setDBConvert (bool val) |
void | removeTableRelatedDS (const int32_t db_id, const int32_t tb_id) override |
void | setTableEpoch (const int32_t db_id, const int32_t tb_id, const int32_t start_epoch) |
size_t | getTableEpoch (const int32_t db_id, const int32_t tb_id) |
void | resetTableEpochFloor (const int32_t db_id, const int32_t tb_id) |
StorageStats | getStorageStats (const int32_t db_id, const int32_t tb_id) |
std::shared_ptr< FileMgr > | getSharedFileMgr (const int db_id, const int table_id) |
void | setFileMgr (const int db_id, const int table_id, std::shared_ptr< FileMgr > file_mgr) |
void | closeFileMgr (const int32_t db_id, const int32_t tb_id) |
Private Member Functions | |
bool | isChunkPrefixCacheable (const ChunkKey &chunk_prefix) const |
Private Attributes | |
foreign_storage::ForeignStorageCache * | disk_cache_ |
std::set< ChunkKey > | cached_chunk_keys_ |
Additional Inherited Members | |
Static Public Attributes inherited from File_Namespace::GlobalFileMgr | |
static constexpr int32_t | db_version_ {2} |
Protected Attributes inherited from File_Namespace::GlobalFileMgr | |
std::shared_ptr < ForeignStorageInterface > | fsi_ |
Definition at line 26 of file CachingGlobalFileMgr.h.
File_Namespace::CachingGlobalFileMgr::CachingGlobalFileMgr | ( | int32_t | device_id, |
std::shared_ptr< ForeignStorageInterface > | fsi, | ||
const std::string & | base_path, | ||
size_t | num_reader_threads, | ||
foreign_storage::ForeignStorageCache * | disk_cache, | ||
size_t | defaultPageSize = DEFAULT_PAGE_SIZE |
||
) |
Definition at line 22 of file CachingGlobalFileMgr.cpp.
References CHECK, and disk_cache_.
|
override |
Definition at line 129 of file CachingGlobalFileMgr.cpp.
References cached_chunk_keys_, foreign_storage::ForeignStorageCache::checkpoint(), File_Namespace::GlobalFileMgr::checkpoint(), disk_cache_, File_Namespace::GlobalFileMgr::fetchBuffer(), get_table_prefix(), File_Namespace::GlobalFileMgr::getBuffer(), isChunkPrefixCacheable(), and foreign_storage::ForeignStorageCache::putBuffer().
|
override |
Definition at line 145 of file CachingGlobalFileMgr.cpp.
References cached_chunk_keys_, foreign_storage::ForeignStorageCache::checkpoint(), File_Namespace::GlobalFileMgr::checkpoint(), disk_cache_, File_Namespace::GlobalFileMgr::fetchBuffer(), File_Namespace::GlobalFileMgr::getBuffer(), isChunkPrefixCacheable(), Data_Namespace::AbstractBuffer::isDirty(), and foreign_storage::ForeignStorageCache::putBuffer().
|
override |
Definition at line 34 of file CachingGlobalFileMgr.cpp.
References cached_chunk_keys_, File_Namespace::GlobalFileMgr::createBuffer(), and isChunkPrefixCacheable().
|
override |
Definition at line 44 of file CachingGlobalFileMgr.cpp.
References cached_chunk_keys_, File_Namespace::GlobalFileMgr::deleteBuffer(), foreign_storage::ForeignStorageCache::deleteBufferIfExists(), disk_cache_, and isChunkPrefixCacheable().
|
override |
Definition at line 52 of file CachingGlobalFileMgr.cpp.
References cached_chunk_keys_, CHECK, foreign_storage::ForeignStorageCache::clearForTablePrefix(), File_Namespace::GlobalFileMgr::deleteBuffersWithPrefix(), disk_cache_, get_table_key(), has_table_prefix(), and isChunkPrefixCacheable().
|
override |
Definition at line 90 of file CachingGlobalFileMgr.cpp.
References CHECK, Data_Namespace::AbstractBuffer::copyTo(), disk_cache_, File_Namespace::GlobalFileMgr::fetchBuffer(), File_Namespace::GlobalFileMgr::findFileMgr(), get_table_prefix(), foreign_storage::ForeignStorageCache::getCachedChunkIfExists(), has_table_prefix(), isChunkPrefixCacheable(), and foreign_storage::ForeignStorageCache::putBuffer().
|
override |
Definition at line 70 of file CachingGlobalFileMgr.cpp.
References foreign_storage::ForeignStorageCache::cacheMetadataVec(), CHECK, disk_cache_, foreign_storage::ForeignStorageCache::getCachedMetadataVecForKeyPrefix(), File_Namespace::GlobalFileMgr::getChunkMetadataVecForKeyPrefix(), has_table_prefix(), foreign_storage::ForeignStorageCache::hasCachedMetadataForKeyPrefix(), and isChunkPrefixCacheable().
|
private |
Definition at line 190 of file CachingGlobalFileMgr.cpp.
References CHECK, CHUNK_KEY_DB_IDX, CHUNK_KEY_TABLE_IDX, File_Namespace::GlobalFileMgr::fsi_, and has_table_prefix().
Referenced by checkpoint(), createBuffer(), deleteBuffer(), deleteBuffersWithPrefix(), fetchBuffer(), getChunkMetadataVecForKeyPrefix(), putBuffer(), and removeCachedData().
|
override |
Definition at line 119 of file CachingGlobalFileMgr.cpp.
References disk_cache_, isChunkPrefixCacheable(), foreign_storage::ForeignStorageCache::putBuffer(), and File_Namespace::GlobalFileMgr::putBuffer().
void File_Namespace::CachingGlobalFileMgr::removeCachedData | ( | const int | db_id, |
const int | table_id | ||
) |
Definition at line 170 of file CachingGlobalFileMgr.cpp.
References cached_chunk_keys_, foreign_storage::ForeignStorageCache::clearForTablePrefix(), disk_cache_, and isChunkPrefixCacheable().
Referenced by removeTableRelatedDS().
|
override |
Definition at line 185 of file CachingGlobalFileMgr.cpp.
References removeCachedData(), and File_Namespace::GlobalFileMgr::removeTableRelatedDS().
|
private |
Definition at line 67 of file CachingGlobalFileMgr.h.
Referenced by checkpoint(), createBuffer(), deleteBuffer(), deleteBuffersWithPrefix(), and removeCachedData().
|
private |
Definition at line 66 of file CachingGlobalFileMgr.h.
Referenced by CachingGlobalFileMgr(), checkpoint(), deleteBuffer(), deleteBuffersWithPrefix(), fetchBuffer(), getChunkMetadataVecForKeyPrefix(), putBuffer(), and removeCachedData().