18 #ifndef FOEDUS_STORAGE_SEQUENTIAL_SEQUENTIAL_STORAGE_PIMPL_HPP_
19 #define FOEDUS_STORAGE_SEQUENTIAL_SEQUENTIAL_STORAGE_PIMPL_HPP_
47 namespace sequential {
188 uint16_t payload_count);
195 template <
typename HANDLER>
199 for (uint16_t node = 0; node < nodes; ++node) {
202 for (uint16_t local_ordinal = 0; local_ordinal < threads_per_node; ++local_ordinal) {
222 static_assert(
sizeof(SequentialStoragePimpl) <=
kPageSize,
"SequentialStoragePimpl is too large");
225 "SequentialStorageControlBlock is too large.");
229 #endif // FOEDUS_STORAGE_SEQUENTIAL_SEQUENTIAL_STORAGE_PIMPL_HPP_
Represents a pointer to another page (usually a child page).
The storage has been marked for drop and can't be used.
void append_record(thread::Thread *context, xct::XctId owner_id, const void *payload, uint16_t payload_count)
Appends an already-commited record to this volatile list.
Definitions of IDs in this package and a few related constant values.
Lock-free list of records stored in the volatile part of sequential storage.
StorageStatus status_
Status of the storage.
ErrorStack load(const StorageControlBlock &snapshot_block)
std::atomic< Epoch::EpochInteger > cur_truncate_epoch_
The min epoch value (truncate-epoch) for all valid records in 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.
uint32_t PagePoolOffset
Offset in PagePool that compactly represents the page address (unlike 8 bytes pointer).
soc::SharedMutex status_mutex_
SequentialStoragePimpl(SequentialStorage *storage)
ErrorStack initialize_head_tail_pages()
xct::RwLockableXctId cur_truncate_epoch_tid_
Protects accesses to cur_truncate_epoch_.
Represents a pointer to a volatile page with modification count for preventing ABA.
Forward declarations of classes in root package.
Persistent status part of Transaction ID.
SequentialPage * get_tail(const memory::LocalPageResolver &resolver, thread::ThreadId thread_id) const
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.
The storage has been created and ready for use.
Represents one data page in Sequential Storage.
DualPagePointer root_page_pointer_
Points to the root page (or something equivalent).
const EngineOptions & get_options() const
ThreadLocalOrdinal thread_count_per_group_
Number of Thread in each ThreadGroup.
A mutex that can be placed in shared memory and used from multiple processes.
VolatilePagePointer tail_pointer_pages_[kPointerPageCount]
Same above, but for tail pointers.
The MCS reader-writer lock variant of LockableXctId.
Represents an append/scan-only store.
Forward declarations of classes in sequential storage package.
Forward declarations of classes in storage package.
memory::PagePoolOffset get_offset() const
ErrorStack truncate(Epoch new_truncate_epoch, Epoch *commit_epoch)
ErrorCode optimistic_read_truncate_epoch(thread::Thread *context, Epoch *out) const
SequentialStorageControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
SequentialStoragePimpl()=delete
Database engine object that holds all resources and provides APIs.
void apply_truncate(const SequentialTruncateLogType &the_log)
NumaNodeMemoryRef * get_node_memory(foedus::thread::ThreadGroupId group) const
Engine * get_engine() const
const uint16_t kPointerPageCount
Each poiner page can contain 2^10 pointers (as the node is implicit, PagePoolOffset suffices) and we ...
Definitions of IDs in this package and a few related constant values.
Attachable Resources on Shared Memory.
uint16_t group_count_
Number of ThreadGroup in the engine.
ErrorCode for_every_page(HANDLER handler) const
Traverse all pages and call back the handler for every page.
Forward declarations of classes in memory package.
memory::PagePoolOffset * get_head_pointer(thread::ThreadId thread_id) const
ThreadId compose_thread_id(ThreadGroupId node, ThreadLocalOrdinal local_core)
Returns a globally unique ID of Thread (core) for the given node and ordinal in the node...
const uint16_t kPointersPerPage
#define CHECK_ERROR_CODE(x)
This macro calls x and checks its returned error code.
thread::ThreadOptions thread_
SequentialPage * get_head(const memory::LocalPageResolver &resolver, thread::ThreadId thread_id) const
uint16_t ThreadId
Typedef for a global ID of Thread (core), which is unique across NUMA nodes.
SequentialStoragePimpl(Engine *engine, SequentialStorageControlBlock *control_block)
Log type of TRUNCATE SEQUENTIAL STORAGE operation.
ErrorStack create(const SequentialMetadata &metadata)
SequentialStorageControlBlock()=delete
PagePool * get_volatile_pool()
const LocalPageResolver & get_resolver() const
Gives an object to resolve an offset in this page pool (thus local) to an actual pointer and vice ver...
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Forward declarations of classes in thread package.
A base layout of shared data for all storage types.
SequentialStorageControlBlock * get_control_block() const
VolatilePagePointer head_pointer_pages_[kPointerPageCount]
Points to pages that store thread-private head pages to store thread-private volatile pages...
memory::EngineMemory * get_memory_manager() const
See Memory Manager.
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.
memory::PagePoolOffset * get_tail_pointer(thread::ThreadId thread_id) const
~SequentialStorageControlBlock()=delete
SequentialMetadata meta_
metadata of this storage.
memory::PagePoolOffset pointers_[kPointersPerPage]
const StorageName & get_name() const
Shared data of this storage type.
StorageStatus
Status of a storage.