Class File_Namespace::GlobalFileMgr

class GlobalFileMgr : public AbstractBufferMgr

Subclassed by File_Namespace::CachingGlobalFileMgr

Public Functions

GlobalFileMgr(const int32_t deviceId, std::shared_ptr<ForeignStorageInterface> fsi, std::string basePath = ".", const size_t num_reader_threads = 0, const size_t defaultPageSize = DEFAULT_PAGE_SIZE)

Constructor.

~GlobalFileMgr()
AbstractBuffer *createBuffer(const ChunkKey &key, size_t pageSize = 0, const size_t numBytes = 0)

Creates a chunk with the specified key and page size.

bool isBufferOnDevice(const ChunkKey &key)
void deleteBuffer(const ChunkKey &key, const bool purge = true)

Deletes the chunk with the specified key.

void deleteBuffersWithPrefix(const ChunkKey &keyPrefix, const bool purge = true)
AbstractBuffer *getBuffer(const ChunkKey &key, const size_t numBytes = 0)

Returns the a pointer to the chunk with the specified key.

void fetchBuffer(const ChunkKey &key, AbstractBuffer *destBuffer, const size_t numBytes)
AbstractBuffer *putBuffer(const ChunkKey &key, AbstractBuffer *d, const size_t numBytes = 0)

Puts the contents of d into the Chunk with the given key.

Return

AbstractBuffer*

Parameters
  • key: - Unique identifier for a Chunk.

  • d: - An object representing the source data for the Chunk.

AbstractBuffer *alloc(const size_t numBytes)
void free(AbstractBuffer *buffer)
MgrType getMgrType()
std::string getStringMgrType()
std::string printSlabs()
size_t getMaxSize()
size_t getInUseSize()
size_t getAllocated()
bool isAllocationCapped()
void init()
void getChunkMetadataVecForKeyPrefix(ChunkMetadataVector &chunkMetadataVec, const ChunkKey &keyPrefix)
void checkpoint()

Fsyncs data files, writes out epoch and fsyncs that.

void checkpoint(const int32_t db_id, const int32_t tb_id)
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.

size_t getNumChunks()
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 getDefaultPageSize() const
void writeFileMgrData(FileMgr *fileMgr = 0)
int32_t getDBVersion() const
bool getDBConvert() const
void setDBConvert(bool val)
void removeTableRelatedDS(const int32_t db_id, const int32_t tb_id)
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)

Protected Attributes

std::shared_ptr<ForeignStorageInterface> fsi_

Private Functions

AbstractBufferMgr *findFileMgrUnlocked(const int32_t db_id, const int32_t tb_id)
void deleteFileMgr(const int32_t db_id, const int32_t tb_id)
bool existsDiffBetweenFileMgrParamsAndFileMgr(FileMgr *file_mgr, const FileMgrParams &file_mgr_params) const

Private Members

std::string basePath_
size_t num_reader_threads_

The OS file system path containing the files.

int32_t epoch_

number of threads used when loading data

size_t defaultPageSize_
int32_t omnisci_db_version_

default page size, used to set FileMgr defaultPageSize_

bool dbConvert_

DB version for DataMgr DS and corresponding file buffer read/write code

std::map<TablePair, std::shared_ptr<FileMgr>> ownedFileMgrs_

true if conversion should be done between different “omnisci_db_version_”

std::map<TablePair, AbstractBufferMgr *> allFileMgrs_
std::map<TablePair, int32_t> max_rollback_epochs_per_table_
std::map<TablePair, StorageStats> lazy_initialized_stats_
mapd_shared_mutex fileMgrs_mutex_