18 #ifndef FOEDUS_STORAGE_MASSTREE_MASSTREE_STORAGE_HPP_
19 #define FOEDUS_STORAGE_MASSTREE_MASSTREE_STORAGE_HPP_
82 bool install_volatile,
187 template <
typename PAYLOAD>
231 template <
typename PAYLOAD>
258 return insert_record(context, key, key_length, payload, payload_count, payload_count);
369 return upsert_record(context, key, key_length, payload, payload_count, payload_count);
467 template <
typename PAYLOAD>
497 template <
typename PAYLOAD>
519 template <
typename PAYLOAD>
531 template <
typename PAYLOAD>
551 bool volatile_only =
false,
552 uint32_t max_pages = 1024U);
608 uint32_t desired_count,
609 bool disable_no_record_split =
true);
625 #endif // FOEDUS_STORAGE_MASSTREE_MASSTREE_STORAGE_HPP_
uint32_t found_boundary_capacity_
[IN] capacity of found_boundaries_.
const KeySlice kInfimumSlice
ErrorCode get_record_normalized(thread::Thread *context, KeySlice key, void *payload, PayloadLength *payload_capacity, bool read_only)
Retrieves an entire record of the given primitive key in this Masstree.
const KeySlice * prefix_slices_
[IN] slices of higher layers that lead to the B-trie layer of interest.
uint16_t PayloadLength
Represents a byte-length of a payload in this package.
friend std::ostream & operator<<(std::ostream &o, const MasstreeStorage &v)
Definitions of IDs in this package and a few related constant values.
uint16_t SlotIndex
Index of a record in a (border) page.
#define CXX11_NULLPTR
Used in public headers in place of "nullptr" of C++11.
Log type of CREATE MASSTREE STORAGE operation.
ErrorCode increment_record_normalized(thread::Thread *context, KeySlice key, PAYLOAD *value, PayloadLength payload_offset)
For primitive key.
uint32_t StorageId
Unique ID for storage.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
KeySlice to_
[IN] lists up page boundaries up to this slice
Represents a record of write-access during a transaction.
ErrorStack create(const Metadata &metadata)
Represents one thread running on one NUMA core.
ErrorCode upsert_record(thread::Thread *context, const void *key, KeyLength key_length, const void *payload, PayloadLength payload_count) __attribute__((always_inline))
Inserts a new record of the given key or replaces the existing one, or so-called upsert.
Result of track_moved_record().
Forward declarations of classes in root package.
Brings error stacktrace information as return value of functions.
ErrorCode upsert_record_normalized(thread::Thread *context, KeySlice key) __attribute__((always_inline))
Upserts a new record without payload of the given primitive key in this Masstree. ...
uint64_t KeySlice
Each key slice is an 8-byte integer.
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.
ErrorCode upsert_record_normalized(thread::Thread *context, KeySlice key, const void *payload, PayloadLength payload_count) __attribute__((always_inline))
Upserts a new record of the given primitive key in this Masstree.
MasstreeStorage & operator=(const MasstreeStorage &other)
ErrorCode get_record_part_normalized(thread::Thread *context, KeySlice key, void *payload, PayloadLength payload_offset, PayloadLength payload_count, bool read_only)
Retrieves a part of the given primitive key in this Masstree.
The MCS reader-writer lock variant of LockableXctId.
ErrorCode upsert_record(thread::Thread *context, const void *key, KeyLength key_length) __attribute__((always_inline))
Upserts a new record without payload of the given key in this Masstree.
Represents one key-value store.
xct::TrackMovedRecordResult track_moved_record(xct::RwLockableXctId *old_address, xct::WriteXctAccess *write_set)
Resolves a "moved" record.
uint8_t Layer
Represents the depth of a B-trie layer.
ErrorCode get_record_primitive(thread::Thread *context, const void *key, KeyLength key_length, PAYLOAD *payload, PayloadLength payload_offset, bool read_only)
Retrieves a part of the given key in this Masstree as a primitive value.
ErrorCode prefetch_pages_normalized(thread::Thread *context, bool install_volatile, bool cache_snapshot, KeySlice from=kInfimumSlice, KeySlice to=kSupremumSlice)
Prefetch data pages in this storage.
Forward declarations of classes in storage package.
Definitions of IDs in this package and a few related constant values.
ErrorCode insert_record_normalized(thread::Thread *context, KeySlice key) __attribute__((always_inline))
Inserts a new record without payload of the given primitive key in this Masstree. ...
uint32_t prefix_slice_count_
[IN] size of prefix_slices_.
Arguments for peek_volatile_page_boundaries()
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
MasstreeMetadata ThisMetadata
ErrorStack fatify_first_root(thread::Thread *context, uint32_t desired_count, bool disable_no_record_split=true)
Deliberately causes splits under the volatile root of first layer, or "fatify" it.
ErrorCode peek_volatile_page_boundaries(Engine *engine, const PeekBoundariesArguments &args)
Checks the volatile pages of this storage to give hints to decide page boundary keys.
ErrorCode get_record(thread::Thread *context, const void *key, KeyLength key_length, void *payload, PayloadLength *payload_capacity, bool read_only)
Retrieves an entire record of the given key in this Masstree.
Database engine object that holds all resources and provides APIs.
uint32_t * found_boundary_count_
[OUT] number of found_boundaries_ entries returned
static SlotIndex estimate_records_per_page(Layer layer, KeyLength key_length, PayloadLength payload_length)
KeySlice * found_boundaries_
[OUT] fence-slices of border pages between from-to
ErrorCode overwrite_record_normalized(thread::Thread *context, KeySlice key, const void *payload, PayloadLength payload_offset, PayloadLength payload_count)
Overwrites a part of one record of the given primitive key in this Masstree.
Pimpl object of MasstreeStorage.
ErrorStack load(const StorageControlBlock &snapshot_block)
ErrorCode delete_record_normalized(thread::Thread *context, KeySlice key)
Deletes a record of the given primitive key from this Masstree.
Represents a Masstree storage.
ErrorStack debugout_single_thread(Engine *engine, bool volatile_only=false, uint32_t max_pages=1024U)
A super-expensive and single-thread only debugging feature to write out gigantic human-readable texts...
ErrorStack verify_single_thread(thread::Thread *context)
ErrorCode delete_record(thread::Thread *context, const void *key, KeyLength key_length)
Deletes a record of the given key from this Masstree.
ErrorStack hcc_reset_all_temperature_stat()
Resets all volatile pages' temperature stat to be zero in this storage.
ErrorCode insert_record_normalized(thread::Thread *context, KeySlice key, const void *payload, PayloadLength payload_count) __attribute__((always_inline))
Inserts a new record of the given primitive key in this Masstree.
Shared data of this storage type.
ErrorCode get_record_part(thread::Thread *context, const void *key, KeyLength key_length, void *payload, PayloadLength payload_offset, PayloadLength payload_count, bool read_only)
Retrieves a part of the given key in this Masstree.
ErrorCode increment_record(thread::Thread *context, const void *key, KeyLength key_length, PAYLOAD *value, PayloadLength payload_offset)
This one further optimizes overwrite methods for the frequent use case of incrementing some data in p...
ErrorCode get_record_primitive_normalized(thread::Thread *context, KeySlice key, PAYLOAD *payload, PayloadLength payload_offset, bool read_only)
Retrieves a part of the given primitive key in this Masstree as a primitive value.
ErrorCode overwrite_record_primitive_normalized(thread::Thread *context, KeySlice key, PAYLOAD payload, PayloadLength payload_offset)
Overwrites a part of one record of the given primitive key in this Masstree as a primitive value...
MasstreeStoragePimpl ThisPimpl
const KeySlice kSupremumSlice
ErrorCode overwrite_record(thread::Thread *context, const void *key, KeyLength key_length, const void *payload, PayloadLength payload_offset, PayloadLength payload_count)
Overwrites a part of one record of the given key in this Masstree.
Forward declarations of classes in masstree storage package.
Forward declarations of classes in thread package.
ErrorCode overwrite_record_primitive(thread::Thread *context, const void *key, KeyLength key_length, PAYLOAD payload, PayloadLength payload_offset)
Overwrites a part of one record of the given key in this Masstree as a primitive value.
#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.
ErrorCode insert_record(thread::Thread *context, const void *key, KeyLength key_length, const void *payload, PayloadLength payload_count) __attribute__((always_inline))
Inserts a new record of the given key in this Masstree.
ErrorCode
Enum of error codes defined in error_code.xmacro.
KeySlice from_
[IN] lists up page boundaries from this slice
const MasstreeMetadata * get_masstree_metadata() const
MasstreeCreateLogType ThisCreateLogType
ErrorCode insert_record(thread::Thread *context, const void *key, KeyLength key_length) __attribute__((always_inline))
Inserts a new record without payload of the given key in this Masstree.