|
libfoedus-core
FOEDUS Core Library
|
Represents an append/scan-only store. More...
Represents an append/scan-only store.
Definition at line 41 of file sequential_storage.hpp.
#include <sequential_storage.hpp>


Public Types | |
| typedef SequentialStoragePimpl | ThisPimpl |
| typedef SequentialCreateLogType | ThisCreateLogType |
| typedef SequentialMetadata | ThisMetadata |
Public Member Functions | |
| SequentialStorage () | |
| SequentialStorage (Engine *engine, SequentialStorageControlBlock *control_block) | |
| SequentialStorage (Engine *engine, StorageControlBlock *control_block) | |
| SequentialStorage (Engine *engine, StorageId id) | |
| SequentialStorage (Engine *engine, const StorageName &name) | |
| SequentialStorage (const SequentialStorage &other) | |
| SequentialStorage & | operator= (const SequentialStorage &other) |
| const SequentialMetadata * | get_sequential_metadata () const |
| ErrorStack | create (const Metadata &metadata) |
| ErrorStack | load (const StorageControlBlock &snapshot_block) |
| ErrorStack | drop () |
| ErrorCode | append_record (thread::Thread *context, const void *payload, uint16_t payload_count) |
| Append one record to this sequential storage. More... | |
| void | apply_append_record (thread::Thread *context, const SequentialAppendLogType *log_entry) |
| Used to apply the effect of appending to volatile list. More... | |
| ErrorCode | optimistic_read_truncate_epoch (thread::Thread *context, Epoch *out) const |
| Obtains the current value of truncate-epoch in an OCC-fashion. More... | |
| Epoch | get_truncate_epoch () const |
| This version doesn't protect the read in a xct. More... | |
| ErrorStack | truncate (Epoch new_truncate_epoch, Epoch *commit_epoch) |
| Discards all records in this storage before the given epoch. More... | |
| void | apply_truncate (const SequentialTruncateLogType &the_log) |
Public Member Functions inherited from foedus::storage::Storage< SequentialStorageControlBlock > | |
| Storage () | |
| Storage (Engine *engine, SequentialStorageControlBlock *control_block) | |
| Storage (Engine *engine, StorageControlBlock *control_block) | |
| Storage (Engine *engine, StorageId id) | |
| Shorthand for engine->get_storage_manager()->get_storage(id) More... | |
| Storage (Engine *engine, const StorageName &name) | |
| Shorthand for engine->get_storage_manager()->get_storage(name) More... | |
| Storage (const Storage &other) | |
| Storage & | operator= (const Storage &other) |
| StorageId | get_id () const |
| Returns the unique ID of this storage. More... | |
| StorageType | get_type () const |
| Returns the type of this storage. More... | |
| const StorageName & | get_name () const |
| Returns the unique name of this storage. More... | |
| const Metadata * | get_metadata () const |
| Returns the metadata of this storage. More... | |
| bool | exists () const |
| Returns whether this storage is already created. More... | |
Public Member Functions inherited from foedus::Attachable< SequentialStorageControlBlock > | |
| Attachable () | |
| Attachable (Engine *engine) | |
| Attachable (Engine *engine, SequentialStorageControlBlock *control_block) | |
| Attachable (SequentialStorageControlBlock *control_block) | |
| Attachable (const Attachable &other) | |
| virtual | ~Attachable () |
| Attachable & | operator= (const Attachable &other) |
| virtual void | attach (SequentialStorageControlBlock *control_block) |
| Attaches to the given shared memory. More... | |
| bool | is_attached () const |
| Returns whether the object has been already attached to some shared memory. More... | |
| SequentialStorageControlBlock * | get_control_block () const |
| Engine * | get_engine () const |
| void | set_engine (Engine *engine) |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const SequentialStorage &v) |
Additional Inherited Members | |
Protected Attributes inherited from foedus::Attachable< SequentialStorageControlBlock > | |
| Engine * | engine_ |
| Most attachable object stores an engine pointer (local engine), so we define it here. More... | |
| SequentialStorageControlBlock * | control_block_ |
| The shared data on shared memory that has been initialized in some SOC or master engine. More... | |
Definition at line 44 of file sequential_storage.hpp.
Definition at line 45 of file sequential_storage.hpp.
Definition at line 43 of file sequential_storage.hpp.
| foedus::storage::sequential::SequentialStorage::SequentialStorage | ( | ) |
Definition at line 35 of file sequential_storage.cpp.
| foedus::storage::sequential::SequentialStorage::SequentialStorage | ( | Engine * | engine, |
| SequentialStorageControlBlock * | control_block | ||
| ) |
Definition at line 36 of file sequential_storage.cpp.
References ASSERT_ND, foedus::storage::Storage< SequentialStorageControlBlock >::exists(), foedus::storage::Storage< SequentialStorageControlBlock >::get_type(), and foedus::storage::kSequentialStorage.

| foedus::storage::sequential::SequentialStorage::SequentialStorage | ( | Engine * | engine, |
| StorageControlBlock * | control_block | ||
| ) |
Definition at line 40 of file sequential_storage.cpp.
References ASSERT_ND, foedus::storage::Storage< SequentialStorageControlBlock >::exists(), foedus::storage::Storage< SequentialStorageControlBlock >::get_type(), and foedus::storage::kSequentialStorage.

Definition at line 44 of file sequential_storage.cpp.
| foedus::storage::sequential::SequentialStorage::SequentialStorage | ( | Engine * | engine, |
| const StorageName & | name | ||
| ) |
Definition at line 46 of file sequential_storage.cpp.
| foedus::storage::sequential::SequentialStorage::SequentialStorage | ( | const SequentialStorage & | other | ) |
Definition at line 48 of file sequential_storage.cpp.
| ErrorCode foedus::storage::sequential::SequentialStorage::append_record | ( | thread::Thread * | context, |
| const void * | payload, | ||
| uint16_t | payload_count | ||
| ) |
Append one record to this sequential storage.
| [in] | context | Thread context |
| [in] | payload | We copy from this buffer. Must be at least get_payload_size(). |
| [in] | payload_count | Length of payload. |
The strict ordering of the appended record is NOT guaranteed to be the commit serialization order. Sequential Storage storage essentially provides a set semantics, not a strictly ordered LIFO queue, to be more scalable. However, the orders are at least loosely ordered; the order largely represents when it was inserted.
Definition at line 56 of file sequential_storage_pimpl.cpp.
References foedus::xct::Xct::add_to_lock_free_write_set(), foedus::storage::sequential::SequentialAppendLogType::calculate_log_length(), foedus::thread::Thread::get_current_xct(), foedus::storage::Storage< SequentialStorageControlBlock >::get_id(), foedus::thread::Thread::get_thread_log_buffer(), foedus::kErrorCodeStrTooLongPayload, foedus::storage::sequential::kMaxPayload, foedus::storage::sequential::SequentialAppendLogType::populate(), and foedus::log::ThreadLogBuffer::reserve_new_log().

| void foedus::storage::sequential::SequentialStorage::apply_append_record | ( | thread::Thread * | context, |
| const SequentialAppendLogType * | log_entry | ||
| ) |
Used to apply the effect of appending to volatile list.
Definition at line 76 of file sequential_storage_pimpl.cpp.
References foedus::storage::sequential::SequentialStoragePimpl::append_record(), foedus::log::BaseLogType::header_, foedus::storage::sequential::SequentialAppendLogType::payload_, foedus::storage::sequential::SequentialAppendLogType::payload_count_, and foedus::log::LogHeader::xct_id_.
Referenced by foedus::storage::sequential::SequentialAppendLogType::apply_record().


| void foedus::storage::sequential::SequentialStorage::apply_truncate | ( | const SequentialTruncateLogType & | the_log | ) |
Definition at line 81 of file sequential_storage.cpp.
References foedus::storage::sequential::SequentialStoragePimpl::apply_truncate().
Referenced by foedus::storage::sequential::SequentialTruncateLogType::apply_storage().


| ErrorStack foedus::storage::sequential::SequentialStorage::create | ( | const Metadata & | metadata | ) |
Definition at line 61 of file sequential_storage.cpp.
References foedus::storage::sequential::SequentialStoragePimpl::create().

| ErrorStack foedus::storage::sequential::SequentialStorage::drop | ( | ) |
Definition at line 67 of file sequential_storage.cpp.
References foedus::storage::sequential::SequentialStoragePimpl::drop().

| const SequentialMetadata * foedus::storage::sequential::SequentialStorage::get_sequential_metadata | ( | ) | const |
Definition at line 57 of file sequential_storage.cpp.
References foedus::Attachable< SequentialStorageControlBlock >::control_block_.
| Epoch foedus::storage::sequential::SequentialStorage::get_truncate_epoch | ( | ) | const |
This version doesn't protect the read in a xct.
Handy, but use with care. You should use this method only in non-racy places (eg reporting/debugging etc).
Definition at line 70 of file sequential_storage.cpp.
References foedus::Attachable< SequentialStorageControlBlock >::control_block_.
Referenced by foedus::storage::sequential::operator<<().

| ErrorStack foedus::storage::sequential::SequentialStorage::load | ( | const StorageControlBlock & | snapshot_block | ) |
Definition at line 64 of file sequential_storage.cpp.
References foedus::storage::sequential::SequentialStoragePimpl::load().

| SequentialStorage & foedus::storage::sequential::SequentialStorage::operator= | ( | const SequentialStorage & | other | ) |
Definition at line 51 of file sequential_storage.cpp.
References foedus::Attachable< SequentialStorageControlBlock >::control_block_, foedus::Attachable< CONTROL_BLOCK >::control_block_, foedus::Attachable< SequentialStorageControlBlock >::engine_, and foedus::Attachable< CONTROL_BLOCK >::engine_.
| ErrorCode foedus::storage::sequential::SequentialStorage::optimistic_read_truncate_epoch | ( | thread::Thread * | context, |
| Epoch * | out | ||
| ) | const |
Obtains the current value of truncate-epoch in an OCC-fashion.
This method takes a read-set to protect this OCC-read. Thus it receives a thread context.
Definition at line 73 of file sequential_storage.cpp.
References foedus::Attachable< SequentialStorageControlBlock >::control_block_.
| ErrorStack foedus::storage::sequential::SequentialStorage::truncate | ( | Epoch | new_truncate_epoch, |
| Epoch * | commit_epoch | ||
| ) |
Discards all records in this storage before the given epoch.
| [in] | new_truncate_epoch | all records whose epoch is exclusively smaller than this will be logically deleted. |
| [out] | commit_epoch | The epoch when the truncate has happened. |
This method implements the special truncate feature as a metadata operation on this storage. This method starts and ends its own meta-transaction. So it does NOT receive a Thread context. In other words, you cannot invoke this operation as part of another transaction.
As far as a valid parameter is given, this method always succeeds because there is no race. If new_truncate_epoch <= get_truncate_epoch(), this method does nothing (not an error).
Definition at line 78 of file sequential_storage.cpp.
References foedus::storage::sequential::SequentialStoragePimpl::truncate().

|
friend |
Definition at line 86 of file sequential_storage.cpp.