libfoedus-core
FOEDUS Core Library
|
Represents one page in the current search path from layer0-root. More...
Represents one page in the current search path from layer0-root.
Either it's interior or border, this object stores some kind of a marker to note up to where we read the page so far.
Definition at line 83 of file masstree_cursor.hpp.
#include <masstree_cursor.hpp>
Public Types | |
enum | MovedPageSearchStatus { kNone = 0, kMovedPageSearchedNeither = 1, kMovedPageSearchedOne = 2, kMovedPageSearchedBoth = 3 } |
Public Member Functions | |
SlotIndex | get_cur_original_index () const __attribute__((always_inline)) |
SlotIndex | get_original_index (SlotIndex index) const __attribute__((always_inline)) |
bool | is_valid_record () const __attribute__((always_inline)) |
bool | was_stably_moved () const |
In almost all places of the cursor code, we check is_moved() only on the stable version so that the cursor can consistently decide whether to follow foster-twins or not. More... | |
void | setup_order () |
Public Attributes | |
MasstreePage * | page_ |
PageVersionStatus | stable_ |
version as of calculating order_. More... | |
SlotIndex | index_ |
index in ordered keys. More... | |
SlotIndex | index_mini_ |
only for interior. More... | |
SlotIndex | key_count_ |
same as stable_.get_key_count() More... | |
SlotIndex | key_count_mini_ |
only for interior. More... | |
bool | snapshot_ |
whether page_ is a snapshot page More... | |
Layer | layer_ |
Shorthand for page_->get_layer() More... | |
MovedPageSearchStatus | moved_page_search_status_ |
only when stable_ indicates that this page is a moved page More... | |
KeySlice | latest_separator_ |
Upto which separator we are done. More... | |
SlotIndex | order_ [kBorderPageMaxSlots] |
only for border. More... | |
Enumerator | |
---|---|
kNone |
This means either was_stably_moved() is false or it's intermediate page, in which case we don't neeed to follow foster twins. If it's a border page whose was_stably_moved() returns true, the status might be one of the followings. |
kMovedPageSearchedNeither | |
kMovedPageSearchedOne | |
kMovedPageSearchedBoth |
Definition at line 84 of file masstree_cursor.hpp.
|
inline |
Definition at line 147 of file masstree_cursor.hpp.
References index_.
|
inline |
Definition at line 150 of file masstree_cursor.hpp.
|
inline |
Definition at line 153 of file masstree_cursor.hpp.
References key_count_.
Referenced by foedus::storage::masstree::MasstreeCursor::is_valid_record().
|
inline |
Definition at line 564 of file masstree_cursor.cpp.
References ASSERT_ND, foedus::storage::masstree::MasstreePage::is_border(), key_count_, order_, and page_.
|
inline |
In almost all places of the cursor code, we check is_moved() only on the stable version so that the cursor can consistently decide whether to follow foster-twins or not.
So, we shouldn't have any "is_moved" in the file other than this.
Definition at line 161 of file masstree_cursor.hpp.
References foedus::storage::PageVersionStatus::is_moved().
SlotIndex foedus::storage::masstree::MasstreeCursor::Route::index_ |
index in ordered keys.
in interior, same.
Definition at line 113 of file masstree_cursor.hpp.
Referenced by get_cur_original_index().
SlotIndex foedus::storage::masstree::MasstreeCursor::Route::index_mini_ |
only for interior.
Definition at line 115 of file masstree_cursor.hpp.
SlotIndex foedus::storage::masstree::MasstreeCursor::Route::key_count_ |
same as stable_.get_key_count()
Definition at line 122 of file masstree_cursor.hpp.
Referenced by is_valid_record(), and setup_order().
SlotIndex foedus::storage::masstree::MasstreeCursor::Route::key_count_mini_ |
only for interior.
Definition at line 124 of file masstree_cursor.hpp.
KeySlice foedus::storage::masstree::MasstreeCursor::Route::latest_separator_ |
Upto which separator we are done.
only for interior. If forward search, we followed a pointer before this separator. If backward search, we followed a pointer after this separator. This is updated whenever we follow a pointer from this interior page, and used when we have to re-find the separator. In Master-tree, a separator never disappears from the page, so we can surely find this.
Definition at line 142 of file masstree_cursor.hpp.
Layer foedus::storage::masstree::MasstreeCursor::Route::layer_ |
Shorthand for page_->get_layer()
Definition at line 129 of file masstree_cursor.hpp.
Referenced by foedus::storage::masstree::MasstreeCursor::copy_combined_key(), and foedus::storage::masstree::MasstreeCursor::copy_combined_key_part().
MovedPageSearchStatus foedus::storage::masstree::MasstreeCursor::Route::moved_page_search_status_ |
only when stable_ indicates that this page is a moved page
Definition at line 132 of file masstree_cursor.hpp.
SlotIndex foedus::storage::masstree::MasstreeCursor::Route::order_[kBorderPageMaxSlots] |
only for border.
order_[0] is the index of smallest record, [1] second smallest...
Definition at line 145 of file masstree_cursor.hpp.
Referenced by setup_order().
MasstreePage* foedus::storage::masstree::MasstreeCursor::Route::page_ |
Definition at line 95 of file masstree_cursor.hpp.
Referenced by foedus::storage::masstree::MasstreeCursor::copy_combined_key(), foedus::storage::masstree::MasstreeCursor::copy_combined_key_part(), and setup_order().
bool foedus::storage::masstree::MasstreeCursor::Route::snapshot_ |
whether page_ is a snapshot page
Definition at line 127 of file masstree_cursor.hpp.
PageVersionStatus foedus::storage::masstree::MasstreeCursor::Route::stable_ |
version as of calculating order_.
We also guarantee that we retrieved key_count_ and key_count_mini_ as-of OR after this version.
Q: Why it could be "after"? A: When we find that an intermediate page now has more separators, we need to re-search (rebase) in the page. In that case, the only thing we care is key_count_ and key_count_mini_. Version number of intermediate pages has no effect .. except is_moved(). But, even in that case, intermediate page has an invariant that we can just search in the old page. Thus, in either case, we don't update stable_ but only re-retrieve key_count_ and key_count_mini_.
Definition at line 111 of file masstree_cursor.hpp.