OmniSciDB
a5dc49c757
|
#include <CachingFileMgr.h>
Public Member Functions | |
TableFileMgr (const std::string &table_path) | |
~TableFileMgr () | |
void | incrementEpoch () |
increment the epoch for this subdir (not synced to disk). More... | |
void | writeAndSyncEpochToDisk () |
Write and flush the epoch to the epoch file on disk. More... | |
int32_t | getEpoch () const |
Returns the current epoch (locked) More... | |
void | removeDiskContent () const |
Removes all disk data for the subdir. More... | |
size_t | getReservedSpace () const |
Returns the disk space used (in bytes) for the subdir. More... | |
void | deleteWrapperFile () const |
Deletes only the wrapper file on disk. More... | |
void | writeWrapperFile (const std::string &doc) const |
Writes wrapper file to disk. More... | |
bool | hasWrapperFile () const |
Private Attributes | |
std::string | table_path_ |
std::string | epoch_file_path_ |
std::string | wrapper_file_path_ |
Epoch | epoch_ |
bool | is_checkpointed_ = true |
FILE * | epoch_file_ = nullptr |
heavyai::shared_mutex | table_mutex_ |
Definition at line 98 of file CachingFileMgr.h.
File_Namespace::TableFileMgr::TableFileMgr | ( | const std::string & | table_path | ) |
Definition at line 757 of file CachingFileMgr.cpp.
References Epoch::byte_size(), CHECK, File_Namespace::create(), epoch_, epoch_file_, epoch_file_path_, heavyai::file_size(), incrementEpoch(), File_Namespace::open(), File_Namespace::read(), Epoch::storage_ptr(), table_path_, and writeAndSyncEpochToDisk().
|
inline |
Definition at line 101 of file CachingFileMgr.h.
References File_Namespace::close(), and epoch_file_.
void File_Namespace::TableFileMgr::deleteWrapperFile | ( | ) | const |
Deletes only the wrapper file on disk.
Definition at line 827 of file CachingFileMgr.cpp.
References table_mutex_, and wrapper_file_path_.
int32_t File_Namespace::TableFileMgr::getEpoch | ( | ) | const |
Returns the current epoch (locked)
Definition at line 792 of file CachingFileMgr.cpp.
References Epoch::ceiling(), epoch_, and table_mutex_.
size_t File_Namespace::TableFileMgr::getReservedSpace | ( | ) | const |
Returns the disk space used (in bytes) for the subdir.
Definition at line 816 of file CachingFileMgr.cpp.
References heavyai::file_size(), table_mutex_, and table_path_.
bool File_Namespace::TableFileMgr::hasWrapperFile | ( | ) | const |
Checks if data wrapper file has been written to disk/cached.
Definition at line 842 of file CachingFileMgr.cpp.
References table_mutex_, and wrapper_file_path_.
void File_Namespace::TableFileMgr::incrementEpoch | ( | ) |
increment the epoch for this subdir (not synced to disk).
Definition at line 783 of file CachingFileMgr.cpp.
References Epoch::ceiling(), CHECK, epoch_, Epoch::increment(), is_checkpointed_, Epoch::max_allowable_epoch(), and table_mutex_.
Referenced by TableFileMgr().
void File_Namespace::TableFileMgr::removeDiskContent | ( | ) | const |
Removes all disk data for the subdir.
Definition at line 811 of file CachingFileMgr.cpp.
References table_mutex_, and table_path_.
void File_Namespace::TableFileMgr::writeAndSyncEpochToDisk | ( | ) |
Write and flush the epoch to the epoch file on disk.
Definition at line 797 of file CachingFileMgr.cpp.
References Epoch::byte_size(), CHECK, epoch_, epoch_file_, heavyai::fsync(), is_checkpointed_, Epoch::storage_ptr(), table_mutex_, and File_Namespace::write().
Referenced by TableFileMgr().
void File_Namespace::TableFileMgr::writeWrapperFile | ( | const std::string & | doc | ) | const |
Writes wrapper file to disk.
Definition at line 832 of file CachingFileMgr.cpp.
References table_mutex_, and wrapper_file_path_.
|
private |
Definition at line 147 of file CachingFileMgr.h.
Referenced by getEpoch(), incrementEpoch(), TableFileMgr(), and writeAndSyncEpochToDisk().
|
private |
Definition at line 149 of file CachingFileMgr.h.
Referenced by TableFileMgr(), writeAndSyncEpochToDisk(), and ~TableFileMgr().
|
private |
Definition at line 145 of file CachingFileMgr.h.
Referenced by TableFileMgr().
|
private |
Definition at line 148 of file CachingFileMgr.h.
Referenced by incrementEpoch(), and writeAndSyncEpochToDisk().
|
mutableprivate |
Definition at line 151 of file CachingFileMgr.h.
Referenced by deleteWrapperFile(), getEpoch(), getReservedSpace(), hasWrapperFile(), incrementEpoch(), removeDiskContent(), writeAndSyncEpochToDisk(), and writeWrapperFile().
|
private |
Definition at line 144 of file CachingFileMgr.h.
Referenced by getReservedSpace(), removeDiskContent(), and TableFileMgr().
|
private |
Definition at line 146 of file CachingFileMgr.h.
Referenced by deleteWrapperFile(), hasWrapperFile(), and writeWrapperFile().