20 #include <glog/logging.h>
33 namespace sequential {
76 return control_block_->optimistic_read_truncate_epoch(context, out);
87 uint64_t page_count = 0;
88 uint64_t record_count = 0;
95 o <<
"<SequentialStorage>"
96 <<
"<id>" << v.
get_id() <<
"</id>"
97 <<
"<name>" << v.
get_name() <<
"</name>"
99 <<
"<page_count>" << page_count <<
"</page_count>"
100 <<
"<record_count>" << record_count <<
"</record_count>"
101 <<
"</SequentialStorage>";
std::ostream & operator<<(std::ostream &o, const SequentialCursor &v)
Lock-free list of records stored in the volatile part of sequential storage.
ErrorStack load(const StorageControlBlock &snapshot_block)
StorageType get_type() const
Returns the type of this storage.
uint32_t StorageId
Unique ID for storage.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Represents one thread running on one NUMA core.
void apply_truncate(const SequentialTruncateLogType &the_log)
Brings error stacktrace information as return value of functions.
Engine * engine_
Most attachable object stores an engine pointer (local engine), so we define it here.
SequentialStorage & operator=(const SequentialStorage &other)
Represents one data page in Sequential Storage.
ErrorStack truncate(Epoch new_truncate_epoch, Epoch *commit_epoch)
Discards all records in this storage before the given epoch.
const SequentialMetadata * get_sequential_metadata() const
Represents an append/scan-only store.
Represents one key-value store.
ErrorStack truncate(Epoch new_truncate_epoch, Epoch *commit_epoch)
SequentialStorageControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
ErrorStack create(const Metadata &metadata)
const StorageName & get_name() const
Returns the unique name of this storage.
bool exists() const
Returns whether this storage is already created.
Database engine object that holds all resources and provides APIs.
void apply_truncate(const SequentialTruncateLogType &the_log)
StorageId get_id() const
Returns the unique ID of this storage.
Epoch get_truncate_epoch() const
This version doesn't protect the read in a xct.
ErrorCode for_every_page(HANDLER handler) const
Traverse all pages and call back the handler for every page.
ErrorCode optimistic_read_truncate_epoch(thread::Thread *context, Epoch *out) const
Obtains the current value of truncate-epoch in an OCC-fashion.
Declares all log types used in this storage type.
uint16_t get_record_count() const
Returns how many records in this page placed so far.
Log type of TRUNCATE SEQUENTIAL STORAGE operation.
ErrorStack create(const SequentialMetadata &metadata)
ErrorStack load(const StorageControlBlock &snapshot_block)
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
A base layout of shared data for all storage types.
ErrorCode
Enum of error codes defined in error_code.xmacro.
Shared data of this storage type.