20 #include <glog/logging.h>
44 VLOG(0) <<
"This masstree has no volatile pages. Maybe the composer is executed as part of"
66 uint8_t this_layer = layer_root->
get_layer();
95 VLOG(0) <<
"Interesting. concurrent thread affected the search. local retry";
107 for (
SlotIndex i = 0; i < key_count; ++i) {
109 if (
LIKELY(cur_slice < slice)) {
112 if (cur_slice > slice) {
123 LOG(INFO) <<
"Slice not found during peeking. Gives up finding a page boundary hint";
132 LOG(INFO) <<
"Encountered invalid page during peeking. Gives up finding a page boundary hint";
173 uint8_t begin_index = 0;
174 uint8_t begin_mini_index = 0;
196 if (boundary >= args.
to_) {
199 if (boundary > args.
from_) {
207 VLOG(0) <<
"Found too many boundaries while peeking. stops here.";
214 if (needs_recurse && !pointer.
is_null()) {
ErrorCode peek_volatile_page_boundaries_this_layer(const MasstreePage *layer_root, const memory::GlobalVolatilePageResolver &resolver, const MasstreeStorage::PeekBoundariesArguments &args)
uint32_t found_boundary_capacity_
[IN] capacity of found_boundaries_.
const KeySlice kInfimumSlice
void prefetch_additional_if_needed(SlotIndex key_count) const __attribute__((always_inline))
SlotIndex get_key_count() const __attribute__((always_inline))
physical key count (those keys might be deleted) in this page.
ErrorCode peek_volatile_page_boundaries(Engine *engine, const MasstreeStorage::PeekBoundariesArguments &args)
Defined in masstree_storage_peek.cpp.
const KeySlice * prefix_slices_
[IN] slices of higher layers that lead to the B-trie layer of interest.
KeySlice get_slice(SlotIndex index) const __attribute__((always_inline))
ErrorCode peek_volatile_page_boundaries_this_layer_recurse(const MasstreeIntermediatePage *cur, const memory::GlobalVolatilePageResolver &resolver, const MasstreeStorage::PeekBoundariesArguments &args)
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)
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
KeySlice to_
[IN] lists up page boundaries up to this slice
bool is_border() const __attribute__((always_inline))
void prefetch_general() const __attribute__((always_inline))
prefetch upto keys/separators, whether this page is border or interior.
const GlobalVolatilePageResolver & get_global_volatile_page_resolver() const
Returns the page resolver to convert volatile page ID to page pointer.
Represents a pointer to a volatile page with modification count for preventing ABA.
MiniPage & get_minipage(uint8_t index) __attribute__((always_inline))
Represents one border page in Masstree Storage.
DualPagePointer * get_next_layer(SlotIndex index) __attribute__((always_inline))
void prefetch() const
prefetch upto separators.
uint64_t KeySlice
Each key slice is an 8-byte integer.
Common base of MasstreeIntermediatePage and MasstreeBorderPage.
#define LIKELY(x)
Hints that x is highly likely true.
const DualPagePointer & get_first_root_pointer() const
DualPagePointer pointers_[kMaxIntermediateMiniSeparators+1]
VolatilePagePointer volatile_pointer_
memory::PagePoolOffset get_offset() const
uint32_t prefix_slice_count_
[IN] size of prefix_slices_.
Arguments for peek_volatile_page_boundaries()
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.
Database engine object that holds all resources and provides APIs.
uint8_t get_btree_level() const __attribute__((always_inline))
used only in masstree.
uint32_t * found_boundary_count_
[OUT] number of found_boundaries_ entries returned
const SlotIndex kBorderPageMaxSlots
Maximum number of slots in one MasstreeBorderPage.
KeySlice * found_boundaries_
[OUT] fence-slices of border pages between from-to
uint8_t get_layer() const __attribute__((always_inline))
Layer-0 stores the first 8 byte slice, Layer-1 next 8 byte...
KeySlice get_high_fence() const __attribute__((always_inline))
Pimpl object of MasstreeStorage.
KeySlice get_low_fence() const __attribute__((always_inline))
bool is_high_fence_supremum() const __attribute__((always_inline))
#define CHECK_ERROR_CODE(x)
This macro calls x and checks its returned error code.
void memory_fence_acquire()
Equivalent to std::atomic_thread_fence(std::memory_order_acquire).
Represents one intermediate page in Masstree Storage.
#define UNLIKELY(x)
Hints that x is highly likely false.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
uint8_t get_numa_node() const
bool within_fences(KeySlice slice) const __attribute__((always_inline))
bool does_point_to_layer(SlotIndex index) const __attribute__((always_inline))
memory::EngineMemory * get_memory_manager() const
See Memory Manager.
ErrorCode
Enum of error codes defined in error_code.xmacro.
uint8_t find_minipage(KeySlice slice) const __attribute__((always_inline))
Navigates a searching key-slice to one of the mini pages in this page.
KeySlice from_
[IN] lists up page boundaries from this slice
uint8_t find_pointer(KeySlice slice) const __attribute__((always_inline))
Navigates a searching key-slice to one of pointers in this mini-page.