libfoedus-core
FOEDUS Core Library
|
Holds a set of read-only file objects for snapshot files. More...
Holds a set of read-only file objects for snapshot files.
In essense, this is a map<snapshot_id, map<node_id, DirectIoFile*> >. Each thread memory internally maintains this file set. This is because DirectIoFile (or underlying linux read()) cannot be concurrently used. Each thread thus obtains its own file descriptors using this object. As it's thread-local, no synchronization is needed in this object.
This design might hit the maximum number of file descriptors per process. Check cat /proc/sys/fs/file-max if that happens. Google how to change it (soft AND hard limits).
Definition at line 52 of file snapshot_file_set.hpp.
#include <snapshot_file_set.hpp>
Friends | |
std::ostream & | operator<< (std::ostream &o, const SnapshotFileSet &v) |
|
explicit |
Definition at line 34 of file snapshot_file_set.cpp.
|
delete |
|
delete |
void foedus::cache::SnapshotFileSet::close_all | ( | ) |
Definition at line 47 of file snapshot_file_set.cpp.
Referenced by uninitialize_once().
|
inline |
Definition at line 59 of file snapshot_file_set.hpp.
|
inline |
Definition at line 65 of file snapshot_file_set.hpp.
References foedus::storage::extract_numa_node_from_snapshot_pointer(), and foedus::storage::extract_snapshot_id_from_snapshot_pointer().
Referenced by read_page(), and read_pages().
ErrorCode foedus::cache::SnapshotFileSet::get_or_open_file | ( | snapshot::SnapshotId | snapshot_id, |
thread::ThreadGroupId | node_id, | ||
fs::DirectIoFile ** | out | ||
) |
Definition at line 59 of file snapshot_file_set.cpp.
References ASSERT_ND, foedus::snapshot::SnapshotOptions::construct_snapshot_file_path(), foedus::Engine::get_options(), foedus::kErrorCodeOk, and foedus::EngineOptions::snapshot_.
|
overridevirtual |
Implements foedus::DefaultInitializable.
Definition at line 37 of file snapshot_file_set.cpp.
References foedus::kRetOk.
|
delete |
ErrorCode foedus::cache::SnapshotFileSet::read_page | ( | storage::SnapshotPagePointer | page_id, |
void * | out | ||
) |
Definition at line 95 of file snapshot_file_set.cpp.
References ASSERT_ND, CHECK_ERROR_CODE, foedus::storage::extract_local_page_id_from_snapshot_pointer(), get_or_open_file(), foedus::fs::DirectIoFile::kDirectIoSeekSet, foedus::kErrorCodeOk, foedus::fs::DirectIoFile::read_raw(), and foedus::fs::DirectIoFile::seek().
Referenced by foedus::storage::array::ArrayComposer::construct_root(), foedus::storage::hash::HashComposer::construct_root(), foedus::storage::sequential::SequentialComposer::construct_root(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_follow(), foedus::storage::masstree::MasstreePartitioner::design_partition(), foedus::storage::hash::TmpSnashotPage::init(), foedus::memory::EngineMemory::load_one_volatile_page(), foedus::storage::hash::ComposedBinsMergedStream::open_path(), foedus::thread::ThreadPimpl::read_a_snapshot_page(), and foedus::storage::StorageManagerPimpl::reinitialize_for_recovered_snapshot().
ErrorCode foedus::cache::SnapshotFileSet::read_pages | ( | storage::SnapshotPagePointer | page_id_begin, |
uint32_t | page_count, | ||
void * | out | ||
) |
Read contiguous pages in one shot.
Definition at line 107 of file snapshot_file_set.cpp.
References ASSERT_ND, CHECK_ERROR_CODE, foedus::storage::extract_local_page_id_from_snapshot_pointer(), get_or_open_file(), foedus::fs::DirectIoFile::kDirectIoSeekSet, foedus::kErrorCodeOk, foedus::fs::DirectIoFile::read_raw(), and foedus::fs::DirectIoFile::seek().
Referenced by foedus::storage::hash::ComposedBinsBuffer::next_pages(), and foedus::thread::ThreadPimpl::read_snapshot_pages().
|
overridevirtual |
Implements foedus::DefaultInitializable.
Definition at line 41 of file snapshot_file_set.cpp.
References close_all(), and SUMMARIZE_ERROR_BATCH.
|
friend |
Definition at line 127 of file snapshot_file_set.cpp.