18 #ifndef FOEDUS_SNAPSHOT_SNAPSHOT_WRITER_IMPL_HPP_
19 #define FOEDUS_SNAPSHOT_SNAPSHOT_WRITER_IMPL_HPP_
136 return dump_general(pool_memory_, from_page, count);
145 return dump_general(intermediate_memory_, from_page, count);
149 return "SnapshotWriter-" + std::to_string(numa_node_) + (append_ ?
"(append)" :
"");
187 const uint16_t numa_node_;
216 fs::Path get_snapshot_file_path()
const;
224 #endif // FOEDUS_SNAPSHOT_SNAPSHOT_WRITER_IMPL_HPP_
memory::PagePoolOffset resolve(storage::Page *page) __attribute__((always_inline))
Forward declarations of classes in filesystem package.
bool close()
Close the file and makes sure all writes become durable (including the directory entry).
Definitions of IDs in this package and a few related constant values.
ErrorCode expand_intermediate_memory(uint32_t required_pages, bool retain_content)
Expands intermediate_memory_ in case it is too small.
Typedefs of ID types used in snapshot package.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
uint32_t PagePoolOffset
Offset in PagePool that compactly represents the page address (unlike 8 bytes pointer).
Typedefs of ID types used in thread package.
Forward declarations of classes in root package.
memory::PagePoolOffset get_page_size() const __attribute__((always_inline))
Brings error stacktrace information as return value of functions.
Forward declarations of classes in snapshot manager package.
ErrorCode dump_intermediates(memory::PagePoolOffset from_page, uint32_t count)
Write out pages that are contiguous in the sub intermediate page pool.
SnapshotId get_snapshot_id() const
ErrorStack open()
Open the file so that the writer can start writing.
Analogue of boost::filesystem::path.
SnapshotWriter & operator=(const SnapshotWriter &other)=delete
uint64_t SnapshotPagePointer
Page ID of a snapshot page.
Database engine object that holds all resources and provides APIs.
memory::PagePoolOffset get_intermediate_size() const __attribute__((always_inline))
Just a marker to denote that the memory region represents a data page.
storage::Page * get_page_base() __attribute__((always_inline))
void * get_block() const
Returns the memory block.
friend std::ostream & operator<<(std::ostream &o, const SnapshotWriter &v)
uint16_t SnapshotId
Unique ID of Snapshot.
uint64_t get_size() const
Returns the byte size of the memory block.
storage::Page * get_intermediate_base() __attribute__((always_inline))
storage::Page * resolve(memory::PagePoolOffset offset) __attribute__((always_inline))
uint16_t get_numa_node() const
Represents an I/O stream on one file without filesystem caching.
Represents one memory block aligned to actual OS/hardware pages.
ErrorCode expand_pool_memory(uint32_t required_pages, bool retain_content)
Expands pool_memory_ in case it is too small.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
ErrorCode dump_pages(memory::PagePoolOffset from_page, uint32_t count)
Write out pages that are contiguous in the main page pool.
#define ALWAYS_INLINE
A function suffix to hint that the function should always be inlined.
storage::SnapshotPagePointer get_next_page_id() const
const uint16_t kPageSize
A constant defining the page size (in bytes) of both snapshot pages and volatile pages.
ErrorCode
Enum of error codes defined in error_code.xmacro.
Writes out one snapshot file for all data pages in one reducer.
std::string to_string() const