18 #ifndef FOEDUS_STORAGE_HASH_HASH_STORAGE_HPP_
19 #define FOEDUS_STORAGE_HASH_HASH_STORAGE_HPP_
108 bool volatile_only =
false,
109 bool intermediate_only =
false,
110 uint32_t max_pages = 1024U);
129 template <
typename KEY>
159 uint16_t* payload_capacity,
162 return get_record(context, key, key_length, c, payload, payload_capacity, read_only);
166 template <
typename KEY>
171 uint16_t* payload_capacity,
174 return get_record(context, &key,
sizeof(key), c, payload, payload_capacity, read_only);
184 uint16_t* payload_capacity,
205 uint16_t payload_offset,
206 uint16_t payload_count,
221 template <
typename KEY>
226 uint16_t payload_offset,
227 uint16_t payload_count,
248 uint16_t payload_offset,
249 uint16_t payload_count,
265 template <
typename PAYLOAD>
271 uint16_t payload_offset,
274 return get_record_primitive<PAYLOAD>(
285 template <
typename KEY,
typename PAYLOAD>
290 uint16_t payload_offset,
293 return get_record_primitive<PAYLOAD>(
304 template <
typename PAYLOAD>
311 uint16_t payload_offset,
332 uint16_t payload_count) {
334 return insert_record(context, key, key_length, c, payload, payload_count, payload_count);
338 template <
typename KEY>
343 uint16_t payload_count) {
345 return insert_record(context, &key,
sizeof(key), c, payload, payload_count, payload_count);
361 uint16_t payload_count,
362 uint16_t physical_payload_hint);
381 template <
typename KEY>
417 uint16_t payload_count) {
419 return upsert_record(context, key, key_length, c, payload, payload_count, payload_count);
423 template <
typename KEY>
428 uint16_t payload_count) {
430 return upsert_record(context, &key,
sizeof(key), c, payload, payload_count, payload_count);
440 uint16_t payload_count,
441 uint16_t physical_payload_hint);
464 uint16_t payload_offset,
465 uint16_t payload_count) {
478 template <
typename KEY>
483 uint16_t payload_offset,
484 uint16_t payload_count) {
486 return overwrite_record(context, &key,
sizeof(key), c, payload, payload_offset, payload_count);
496 uint16_t payload_offset,
497 uint16_t payload_count);
510 template <
typename PAYLOAD>
516 uint16_t payload_offset) {
522 template <
typename KEY,
typename PAYLOAD>
527 uint16_t payload_offset) {
533 template <
typename PAYLOAD>
540 uint16_t payload_offset);
556 template <
typename PAYLOAD>
562 uint16_t payload_offset) {
564 return increment_record(context, key, key_length, c, value, payload_offset);
568 template <
typename KEY,
typename PAYLOAD>
573 uint16_t payload_offset) {
575 return increment_record(context, &key,
sizeof(key), c, value, payload_offset);
579 template <
typename PAYLOAD>
586 uint16_t payload_offset);
591 #endif // FOEDUS_STORAGE_HASH_HASH_STORAGE_HPP_
ErrorCode insert_record(thread::Thread *context, const void *key, uint16_t key_length, const void *payload, uint16_t payload_count)
Inserts a new record of the given key in this hash storage.
ErrorCode delete_record(thread::Thread *context, KEY key)
Overlord to receive key as a primitive type.
ErrorCode get_record_part(thread::Thread *context, KEY key, void *payload, uint16_t payload_offset, uint16_t payload_count, bool read_only)
Overlord to receive key as a primitive type.
Definitions of IDs in this package and a few related constant values.
HashMetadata ThisMetadata
ErrorCode overwrite_record(thread::Thread *context, KEY key, const void *payload, uint16_t payload_offset, uint16_t payload_count)
Overlord to receive key as a primitive type.
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.
uint8_t get_levels() const
ErrorCode get_record(thread::Thread *context, KEY key, void *payload, uint16_t *payload_capacity, bool read_only)
Overlord to receive key as a primitive type.
Forward declarations of classes in transaction package.
Result of track_moved_record().
HashCombo combo(const void *key, uint16_t key_length) const
Prepares a set of information that are used in many places, extracted from the given key...
ErrorCode increment_record(thread::Thread *context, KEY key, PAYLOAD *value, uint16_t payload_offset)
Overlord to receive key as a primitive type.
Forward declarations of classes in root package.
Brings error stacktrace information as return value of functions.
ErrorCode get_record(thread::Thread *context, const void *key, uint16_t key_length, void *payload, uint16_t *payload_capacity, bool read_only)
Retrieves an entire payload of the given key in this hash storage.
ErrorCode increment_record(thread::Thread *context, const void *key, uint16_t key_length, PAYLOAD *value, uint16_t payload_offset)
This one further optimizes overwrite methods for the frequent use case of incrementing some data in p...
HashCreateLogType ThisCreateLogType
ErrorStack load(const StorageControlBlock &snapshot_block)
ErrorCode insert_record(thread::Thread *context, KEY key, const void *payload, uint16_t payload_count)
Overlord to receive key as a primitive type.
ErrorCode overwrite_record(thread::Thread *context, const void *key, uint16_t key_length, const void *payload, uint16_t payload_offset, uint16_t payload_count)
Overwrites a part of one record of the given key in this hash storage.
xct::TrackMovedRecordResult track_moved_record(xct::RwLockableXctId *old_address, xct::WriteXctAccess *write_set)
Resolves a "moved" record.
ErrorStack verify_single_thread(Engine *engine)
The MCS reader-writer lock variant of LockableXctId.
Represents one key-value store.
uint8_t get_bin_bits() const
Pimpl object of HashStorage.
ErrorCode get_record_part(thread::Thread *context, const void *key, uint16_t key_length, void *payload, uint16_t payload_offset, uint16_t payload_count, bool read_only)
Retrieves a part of the given key in this hash storage.
Forward declarations of classes in storage package.
Definitions of IDs in this package and a few related constant values.
ErrorCode get_record_primitive(thread::Thread *context, KEY key, PAYLOAD *payload, uint16_t payload_offset, bool read_only)
Overlord to receive key as a primitive type.
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
Database engine object that holds all resources and provides APIs.
ErrorCode upsert_record(thread::Thread *context, const void *key, uint16_t key_length, const void *payload, uint16_t payload_count)
Inserts a new record of the given key or replaces the existing one in this hash storage, or so-called upsert.
Shared data of this storage type.
HashStoragePimpl ThisPimpl
A set of information that are used in many places, extracted from the given key.
ErrorCode get_record_primitive(thread::Thread *context, const void *key, uint16_t key_length, PAYLOAD *payload, uint16_t payload_offset, bool read_only)
Retrieves a part of the given key in this storage as a primitive value.
Represents a key-value store based on a dense and regular hash.
HashBin get_bin_count() const
ErrorCode upsert_record(thread::Thread *context, KEY key, const void *payload, uint16_t payload_count)
Overlord to receive key as a primitive type.
friend std::ostream & operator<<(std::ostream &o, const HashStorage &v)
uint8_t get_bin_shifts() const
ErrorCode overwrite_record_primitive(thread::Thread *context, const void *key, uint16_t key_length, PAYLOAD payload, uint16_t payload_offset)
Overwrites a part of one record of the given key in this storage as a primitive value.
uint64_t HashBin
Represents a bin of a hash value.
ErrorStack hcc_reset_all_temperature_stat()
Resets all volatile pages' temperature stat to be zero in this storage.
ErrorStack debugout_single_thread(Engine *engine, bool volatile_only=false, bool intermediate_only=false, uint32_t max_pages=1024U)
A super-expensive and single-thread only debugging feature to write out gigantic human-readable texts...
const HashMetadata * get_hash_metadata() const
ErrorCode delete_record(thread::Thread *context, const void *key, uint16_t key_length)
Deletes a record of the given key from this hash storage.
Definitions of IDs in this package and a few related constant values.
Forward declarations of classes in thread package.
A base layout of shared data for all storage types.
ErrorCode overwrite_record_primitive(thread::Thread *context, KEY key, PAYLOAD payload, uint16_t payload_offset)
Overlord to receive key as a primitive type.
HashCombo combo(KEY *key) const
Overlord to receive key as a primitive type.
ErrorCode
Enum of error codes defined in error_code.xmacro.
uint16_t get_root_children() const
Forward declarations of classes in hash storage package.
HashStorage & operator=(const HashStorage &other)
Log type of CREATE HASH STORAGE operation.
ErrorStack create(const Metadata &metadata)