OmniSciDB
085a039ca4
|
#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... | |
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 |
mapd_shared_mutex | table_mutex_ |
Definition at line 91 of file CachingFileMgr.h.
File_Namespace::TableFileMgr::TableFileMgr | ( | const std::string & | table_path | ) |
Definition at line 744 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 94 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 814 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 779 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 803 of file CachingFileMgr.cpp.
References heavyai::file_size(), table_mutex_, and table_path_.
void File_Namespace::TableFileMgr::incrementEpoch | ( | ) |
increment the epoch for this subdir (not synced to disk).
Definition at line 770 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 798 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 784 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 819 of file CachingFileMgr.cpp.
References table_mutex_, and wrapper_file_path_.
|
private |
Definition at line 135 of file CachingFileMgr.h.
Referenced by getEpoch(), incrementEpoch(), TableFileMgr(), and writeAndSyncEpochToDisk().
|
private |
Definition at line 137 of file CachingFileMgr.h.
Referenced by TableFileMgr(), writeAndSyncEpochToDisk(), and ~TableFileMgr().
|
private |
Definition at line 133 of file CachingFileMgr.h.
Referenced by TableFileMgr().
|
private |
Definition at line 136 of file CachingFileMgr.h.
Referenced by incrementEpoch(), and writeAndSyncEpochToDisk().
|
mutableprivate |
Definition at line 139 of file CachingFileMgr.h.
Referenced by deleteWrapperFile(), getEpoch(), getReservedSpace(), incrementEpoch(), removeDiskContent(), writeAndSyncEpochToDisk(), and writeWrapperFile().
|
private |
Definition at line 132 of file CachingFileMgr.h.
Referenced by getReservedSpace(), removeDiskContent(), and TableFileMgr().
|
private |
Definition at line 134 of file CachingFileMgr.h.
Referenced by deleteWrapperFile(), and writeWrapperFile().