libfoedus-core
FOEDUS Core Library
|
Implementation of SortedBuffer that is backed by fully in-memory buffer. More...
Implementation of SortedBuffer that is backed by fully in-memory buffer.
After all mappers are completed, the reducer actually skips dumping the last buffer because anyway it needs to read it back (BTW, if this is the only buffer, everything becomes in-memory, so efficient). In that case, we just sort the last buffer and provides it to composers as it is. This object is used in such cases.
Definition at line 225 of file log_buffer.hpp.
#include <log_buffer.hpp>
Public Member Functions | |
InMemorySortedBuffer (char *buffer, uint64_t buffer_size) | |
~InMemorySortedBuffer () override | |
std::string | to_string () const override |
Returns a short string that briefly describes this object. More... | |
ErrorCode | wind (uint64_t next_absolute_pos) override |
Loads next data block to be consumed by the caller (composer). More... | |
void | describe (std::ostream *o) const override |
Writes out a detailed description of this object to stream. More... | |
![]() | |
SortedBuffer (char *buffer, uint64_t buffer_size, uint64_t total_size) | |
virtual | ~SortedBuffer () |
uint64_t | to_relative_pos (uint64_t absolute_pos) const |
uint64_t | to_absolute_pos (uint64_t relative_pos) const |
const char * | get_buffer () const |
Returns the buffer memory. More... | |
uint64_t | get_buffer_size () const |
Returns the size of buffer memory. More... | |
uint64_t | get_offset () const |
Returns the absolute byte position of the buffer's beginning in the entire file. More... | |
uint64_t | get_total_size () const |
Returns the total size of the underlying stream (eg file size). More... | |
storage::StorageId | get_cur_block_storage_id () const |
uint32_t | get_cur_block_log_count () const |
uint64_t | get_cur_block_abosulte_begin () const |
Current storage block's beginning in absolute byte position in the file. More... | |
uint64_t | get_cur_block_abosulte_end () const |
Current storage block's end in absolute byte position in the file. More... | |
uint32_t | get_cur_block_shortest_key_length () const |
Current storage block's shortest key length. More... | |
uint32_t | get_cur_block_longest_key_length () const |
Current storage block's longest key length. More... | |
void | set_current_block (storage::StorageId storage_id, uint32_t log_count, uint64_t abosulte_begin, uint64_t abosulte_end, uint32_t shortest_key_length, uint32_t longest_key_length) |
bool | is_valid_current_block () const |
void | invalidate_current_block () |
void | assert_checks () |
Additional Inherited Members | |
![]() | |
void | describe_base_elements (std::ostream *o) const |
![]() | |
char *const | buffer_ |
const uint64_t | buffer_size_ |
uint64_t | offset_ |
see get_offset() More... | |
const uint64_t | total_size_ |
see get_total_size() More... | |
storage::StorageId | cur_block_storage_id_ |
If this is zero, this buffer is not set for reading any block. More... | |
uint32_t | cur_block_log_count_ |
uint64_t | cur_block_abosulte_begin_ |
see get_cur_block_abosulte_begin() More... | |
uint64_t | cur_block_abosulte_end_ |
see get_cur_block_abosulte_end() More... | |
uint32_t | cur_block_shortest_key_length_ |
additional statistics for masstree/hash More... | |
uint32_t | cur_block_longest_key_length_ |
additional statistics for masstree/hash More... | |
|
inline |
Definition at line 227 of file log_buffer.hpp.
|
inlineoverride |
Definition at line 230 of file log_buffer.hpp.
|
overridevirtual |
Writes out a detailed description of this object to stream.
Implements foedus::snapshot::SortedBuffer.
Definition at line 49 of file log_buffer.cpp.
References foedus::snapshot::SortedBuffer::describe_base_elements().
|
inlineoverridevirtual |
Returns a short string that briefly describes this object.
Implements foedus::snapshot::SortedBuffer.
Definition at line 232 of file log_buffer.hpp.
|
inlineoverridevirtual |
Loads next data block to be consumed by the caller (composer).
[in] | next_absolute_pos | the absolute byte position that will be guaranteed to be within the buffer after this method call. Note that this position might not become 0-th byte position after this method call because the buffer might be backed by an aligned File I/O. |
Implements foedus::snapshot::SortedBuffer.
Definition at line 233 of file log_buffer.hpp.
References ASSERT_ND, foedus::snapshot::SortedBuffer::buffer_size_, and foedus::kErrorCodeOk.