18 #ifndef FOEDUS_STORAGE_MASSTREE_MASSTREE_STORAGE_PIMPL_HPP_
19 #define FOEDUS_STORAGE_MASSTREE_MASSTREE_STORAGE_PIMPL_HPP_
132 uint8_t current_layer,
223 template <
typename PAYLOAD>
258 bool follow_volatile,
259 uint32_t* remaining_pages);
264 bool follow_volatile,
265 uint32_t* remaining_pages);
295 bool install_volatile,
301 bool install_volatile,
338 uint32_t desired_count,
339 bool disable_no_record_split);
351 static_assert(
sizeof(MasstreeStoragePimpl) <=
kPageSize,
"MasstreeStoragePimpl is too large");
354 "MasstreeStorageControlBlock is too large.");
358 #endif // FOEDUS_STORAGE_MASSTREE_MASSTREE_STORAGE_PIMPL_HPP_
ErrorCode prefetch_pages_follow(thread::Thread *context, DualPagePointer *pointer, bool vol_on, bool snp_on, KeySlice from, KeySlice to)
ErrorCode peek_volatile_page_boundaries_this_layer(const MasstreePage *layer_root, const memory::GlobalVolatilePageResolver &resolver, const MasstreeStorage::PeekBoundariesArguments &args)
const StorageName & get_name() const
DualPagePointer root_page_pointer_
Points to the root page (or something equivalent).
ErrorCode peek_volatile_page_boundaries(Engine *engine, const MasstreeStorage::PeekBoundariesArguments &args)
Defined in masstree_storage_peek.cpp.
soc::SharedMutex status_mutex_
ErrorCode find_border_physical(thread::Thread *context, MasstreePage *layer_root, uint8_t current_layer, bool for_writes, KeySlice slice, MasstreeBorderPage **border) __attribute__((always_inline))
Find a border node in the layer that corresponds to the given key slice.
MasstreeMetadata meta_
metadata of this storage.
Represents a pointer to another page (usually a child page).
The storage has been marked for drop and can't be used.
uint16_t PayloadLength
Represents a byte-length of a payload in this package.
ErrorCode peek_volatile_page_boundaries_this_layer_recurse(const MasstreeIntermediatePage *cur, const memory::GlobalVolatilePageResolver &resolver, const MasstreeStorage::PeekBoundariesArguments &args)
ErrorStack fatify_first_root(thread::Thread *context, uint32_t desired_count, bool disable_no_record_split)
Defined in masstree_storage_fatify.cpp.
Definitions of IDs in this package and a few related constant values.
uint16_t SlotIndex
Index of a record in a (border) page.
ErrorCode peek_volatile_page_boundaries_next_layer(const MasstreePage *layer_root, const memory::GlobalVolatilePageResolver &resolver, const MasstreeStorage::PeekBoundariesArguments &args)
Forward declarations of classes in log manager package.
ErrorCode reserve_record_normalized(thread::Thread *context, KeySlice key, PayloadLength payload_count, PayloadLength physical_payload_hint, RecordLocation *result)
ErrorCode locate_record_normalized(thread::Thread *context, KeySlice key, bool for_writes, RecordLocation *result)
Identifies page and record for the normalized key.
uint32_t StorageId
Unique ID for storage.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Represents a record of write-access during a transaction.
Represents one thread running on one NUMA core.
ErrorCode retrieve_part_general(thread::Thread *context, const RecordLocation &location, void *payload, PayloadLength payload_offset, PayloadLength payload_count)
ErrorCode follow_page(thread::Thread *context, bool for_writes, storage::DualPagePointer *pointer, MasstreePage **page)
Thread::follow_page_pointer() for masstree.
ErrorStack verify_single_thread_border(thread::Thread *context, KeySlice low_fence, HighFence high_fence, MasstreeBorderPage *page)
Result of track_moved_record().
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.
Represents one border page in Masstree Storage.
Brings error stacktrace information as return value of functions.
ErrorCode prefetch_pages_normalized(thread::Thread *context, bool install_volatile, bool cache_snapshot, KeySlice from, KeySlice to)
defined in masstree_storage_prefetch.cpp
ErrorCode overwrite_general(thread::Thread *context, const RecordLocation &location, const void *be_key, KeyLength key_length, const void *payload, PayloadLength payload_offset, PayloadLength payload_count)
implementation of overwrite_record family.
The storage has been created and ready for use.
uint64_t KeySlice
Each key slice is an 8-byte integer.
Holds a set of read-only file objects for snapshot files.
ErrorCode retrieve_general(thread::Thread *context, const RecordLocation &location, void *payload, PayloadLength *payload_capacity)
implementation of get_record family.
ErrorStack hcc_reset_all_temperature_stat_follow(VolatilePagePointer page_id)
Definitions of IDs in this package and a few related constant values.
uint16_t KeyLength
Represents a byte-length of a key in this package.
MasstreeStorageControlBlock()=delete
Common base of MasstreeIntermediatePage and MasstreeBorderPage.
Forward declarations of classes in cache package.
ErrorStack load(const StorageControlBlock &snapshot_block)
DualPagePointer * get_first_root_pointer_address()
A mutex that can be placed in shared memory and used from multiple processes.
const DualPagePointer & get_first_root_pointer() const
The MCS reader-writer lock variant of LockableXctId.
ErrorStack fatify_first_root_double(thread::Thread *context, bool disable_no_record_split)
ErrorCode insert_general(thread::Thread *context, const RecordLocation &location, const void *be_key, KeyLength key_length, const void *payload, PayloadLength payload_count)
implementation of insert_record family.
Forward declarations of classes in storage package.
MasstreeStorageControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definitions of IDs in this package and a few related constant values.
ErrorCode reserve_record(thread::Thread *context, const void *key, KeyLength key_length, PayloadLength payload_count, PayloadLength physical_payload_hint, RecordLocation *result)
Like locate_record(), this is also a logical operation.
Arguments for peek_volatile_page_boundaries()
ErrorCode register_record_write_log(thread::Thread *context, const RecordLocation &location, log::RecordLogType *log_entry)
Used in the following methods.
ErrorStack hcc_reset_all_temperature_stat_recurse(MasstreePage *parent)
Database engine object that holds all resources and provides APIs.
ErrorCode get_first_root(thread::Thread *context, bool for_write, MasstreeIntermediatePage **root)
Root-node related, such as a method to retrieve 1st-root, to grow, etc.
MasstreeStoragePimpl(MasstreeStorage *storage)
Engine * get_engine() const
ErrorStack debugout_single_thread_recurse(Engine *engine, cache::SnapshotFileSet *fileset, MasstreePage *parent, bool follow_volatile, uint32_t *remaining_pages)
Pimpl object of MasstreeStorage.
Attachable Resources on Shared Memory.
Represents a Masstree storage.
Used only for debugging as this is not space efficient.
Forward declarations of classes in memory package.
ErrorCode increment_general(thread::Thread *context, const RecordLocation &location, const void *be_key, KeyLength key_length, PAYLOAD *value, PayloadLength payload_offset)
implementation of increment_record family.
ErrorCode prefetch_pages_normalized_recurse(thread::Thread *context, bool install_volatile, bool cache_snapshot, KeySlice from, KeySlice to, MasstreePage *page)
StorageStatus status_
Status of the storage.
ErrorCode delete_general(thread::Thread *context, const RecordLocation &location, const void *be_key, KeyLength key_length)
implementation of delete_record family.
const MasstreeMetadata & get_meta() const
Shared data of this storage type.
ErrorCode follow_layer(thread::Thread *context, bool for_writes, MasstreeBorderPage *parent, SlotIndex record_index, MasstreePage **page) __attribute__((always_inline))
Follows to next layer's root page.
ErrorStack hcc_reset_all_temperature_stat()
For stupid reasons (I'm lazy!) these are defined in _debug.cpp.
ErrorStack verify_single_thread(thread::Thread *context)
These are defined in masstree_storage_verify.cpp.
ErrorStack verify_single_thread_intermediate(thread::Thread *context, KeySlice low_fence, HighFence high_fence, MasstreeIntermediatePage *page)
ErrorStack drop()
Storage-wide operations, such as drop, create, etc.
~MasstreeStorageControlBlock()=delete
ErrorStack create(const MasstreeMetadata &metadata)
Represents one intermediate page in Masstree Storage.
ErrorStack debugout_single_thread_follow(Engine *engine, cache::SnapshotFileSet *fileset, const DualPagePointer &pointer, bool follow_volatile, uint32_t *remaining_pages)
Base class for log type of record-wise operation.
Forward declarations of classes in masstree storage package.
ErrorCode upsert_general(thread::Thread *context, const RecordLocation &location, const void *be_key, KeyLength key_length, const void *payload, PayloadLength payload_count)
implementation of upsert_record family.
#define ALWAYS_INLINE
A function suffix to hint that the function should always be inlined.
A base layout of shared data for all storage types.
MasstreeStorageControlBlock * get_control_block() const
return value of MasstreeStoragePimpl::locate_record()/reserve_record().
const uint16_t kPageSize
A constant defining the page size (in bytes) of both snapshot pages and volatile pages.
ErrorStack verify_single_thread_layer(thread::Thread *context, uint8_t layer, MasstreePage *layer_root)
ErrorCode
Enum of error codes defined in error_code.xmacro.
static ErrorCode check_next_layer_bit(xct::XctId observed) __attribute__((always_inline))
ErrorCode approximate_count_root_children(thread::Thread *context, uint32_t *out)
Returns the count of direct children in the first-root node.
bool first_root_locked_
Used to synchronize updates to root_page_pointer_.
xct::TrackMovedRecordResult track_moved_record(xct::RwLockableXctId *old_address, xct::WriteXctAccess *write_set) __attribute__((always_inline))
StorageStatus
Status of a storage.
ErrorCode locate_record(thread::Thread *context, const void *key, KeyLength key_length, bool for_writes, RecordLocation *result)
Identifies page and record for the key.
ErrorStack debugout_single_thread(Engine *engine, bool volatile_only, uint32_t max_pages)
These are defined in masstree_storage_debug.cpp.