libfoedus-core
FOEDUS Core Library
foedus::storage::masstree::MasstreeIntermediatePointerIterator Struct Referencefinal

Handy iterator for MasstreeIntermediate. More...

Detailed Description

Handy iterator for MasstreeIntermediate.

Note that this object is not thread safe. Use it only where it's safe (eg snapshot page).

Definition at line 1047 of file masstree_page_impl.hpp.

#include <masstree_page_impl.hpp>

Collaboration diagram for foedus::storage::masstree::MasstreeIntermediatePointerIterator:

Public Member Functions

 MasstreeIntermediatePointerIterator (const MasstreeIntermediatePage *page)
 
void next ()
 
bool is_valid () const
 
KeySlice get_low_key () const
 
KeySlice get_high_key () const
 
const DualPagePointerget_pointer () const
 

Public Attributes

const MasstreeIntermediatePage *const page_
 
uint16_t index_
 
uint16_t index_mini_
 

Constructor & Destructor Documentation

foedus::storage::masstree::MasstreeIntermediatePointerIterator::MasstreeIntermediatePointerIterator ( const MasstreeIntermediatePage page)
inlineexplicit

Definition at line 1048 of file masstree_page_impl.hpp.

References ASSERT_ND, foedus::storage::masstree::MasstreePage::header(), index_, foedus::storage::masstree::MasstreePage::is_empty_range(), and foedus::storage::PageHeader::snapshot_.

1049  : page_(page), index_(0), index_mini_(0) {
1050  if (page->is_empty_range()) {
1051  // Empty-range page has zero pointers, which is special.
1052  ASSERT_ND(!page->header().snapshot_);
1053  index_ = 1; // so that initial is_valid returns false.
1054  }
1055  }
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Here is the call graph for this function:

Member Function Documentation

KeySlice foedus::storage::masstree::MasstreeIntermediatePointerIterator::get_high_key ( ) const
inline

Definition at line 1082 of file masstree_page_impl.hpp.

References ASSERT_ND, foedus::storage::masstree::MasstreePage::get_high_fence(), foedus::storage::masstree::MasstreeIntermediatePage::get_minipage(), foedus::storage::masstree::MasstreeIntermediatePage::get_separator(), index_, index_mini_, is_valid(), foedus::storage::masstree::MasstreeIntermediatePage::MiniPage::key_count_, page_, and foedus::storage::masstree::MasstreeIntermediatePage::MiniPage::separators_.

1082  {
1083  ASSERT_ND(is_valid());
1084  const MasstreeIntermediatePage::MiniPage& minipage = page_->get_minipage(index_);
1085  if (index_mini_ < minipage.key_count_) {
1086  return minipage.separators_[index_mini_];
1087  } else if (index_ < page_->get_key_count()) {
1088  return page_->get_separator(index_ );
1089  } else {
1090  return page_->get_high_fence();
1091  }
1092  }
MiniPage & get_minipage(uint8_t index) __attribute__((always_inline))
KeySlice get_separator(uint8_t index) const __attribute__((always_inline))
KeySlice get_high_fence() const __attribute__((always_inline))
KeySlice separators_[kMaxIntermediateMiniSeparators]
Same semantics as separators_ in enclosing class.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Here is the call graph for this function:

KeySlice foedus::storage::masstree::MasstreeIntermediatePointerIterator::get_low_key ( ) const
inline

Definition at line 1071 of file masstree_page_impl.hpp.

References ASSERT_ND, foedus::storage::masstree::MasstreePage::get_low_fence(), foedus::storage::masstree::MasstreeIntermediatePage::get_minipage(), foedus::storage::masstree::MasstreeIntermediatePage::get_separator(), index_, index_mini_, is_valid(), page_, and foedus::storage::masstree::MasstreeIntermediatePage::MiniPage::separators_.

Referenced by foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_this_layer_recurse().

1071  {
1072  ASSERT_ND(is_valid());
1073  const MasstreeIntermediatePage::MiniPage& minipage = page_->get_minipage(index_);
1074  if (index_mini_ > 0) {
1075  return minipage.separators_[index_mini_ - 1];
1076  } else if (index_ > 0) {
1077  return page_->get_separator(index_ - 1);
1078  } else {
1079  return page_->get_low_fence();
1080  }
1081  }
MiniPage & get_minipage(uint8_t index) __attribute__((always_inline))
KeySlice get_separator(uint8_t index) const __attribute__((always_inline))
KeySlice separators_[kMaxIntermediateMiniSeparators]
Same semantics as separators_ in enclosing class.
KeySlice get_low_fence() const __attribute__((always_inline))
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Here is the call graph for this function:

Here is the caller graph for this function:

const DualPagePointer& foedus::storage::masstree::MasstreeIntermediatePointerIterator::get_pointer ( ) const
inline

Definition at line 1093 of file masstree_page_impl.hpp.

References ASSERT_ND, foedus::storage::masstree::MasstreeIntermediatePage::get_minipage(), index_, index_mini_, is_valid(), page_, and foedus::storage::masstree::MasstreeIntermediatePage::MiniPage::pointers_.

Referenced by foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_this_layer_recurse().

1093  {
1094  ASSERT_ND(is_valid());
1095  const MasstreeIntermediatePage::MiniPage& minipage = page_->get_minipage(index_);
1096  return minipage.pointers_[index_mini_];
1097  }
MiniPage & get_minipage(uint8_t index) __attribute__((always_inline))
DualPagePointer pointers_[kMaxIntermediateMiniSeparators+1]
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Here is the call graph for this function:

Here is the caller graph for this function:

bool foedus::storage::masstree::MasstreeIntermediatePointerIterator::is_valid ( ) const
inline

Definition at line 1067 of file masstree_page_impl.hpp.

References foedus::storage::masstree::MasstreePage::get_key_count(), foedus::storage::masstree::MasstreeIntermediatePage::get_minipage(), index_, index_mini_, foedus::storage::masstree::MasstreeIntermediatePage::MiniPage::key_count_, and page_.

Referenced by foedus::storage::masstree::MasstreeComposer::construct_root(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_recurse(), foedus::storage::masstree::SplitIntermediate::decide_strategy(), foedus::storage::masstree::MasstreePartitioner::design_partition(), foedus::storage::masstree::MasstreeComposer::drop_volatiles(), get_high_key(), get_low_key(), get_pointer(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat_recurse(), next(), and foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_this_layer_recurse().

1067  {
1068  return index_ <= page_->get_key_count()
1070  }
SlotIndex get_key_count() const __attribute__((always_inline))
physical key count (those keys might be deleted) in this page.
MiniPage & get_minipage(uint8_t index) __attribute__((always_inline))

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::storage::masstree::MasstreeIntermediatePointerIterator::next ( )
inline

Definition at line 1057 of file masstree_page_impl.hpp.

References foedus::storage::masstree::MasstreeIntermediatePage::get_minipage(), index_, index_mini_, is_valid(), foedus::storage::masstree::MasstreeIntermediatePage::MiniPage::key_count_, and page_.

Referenced by foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_this_layer_recurse().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

uint16_t foedus::storage::masstree::MasstreeIntermediatePointerIterator::index_mini_
const MasstreeIntermediatePage* const foedus::storage::masstree::MasstreeIntermediatePointerIterator::page_

Definition at line 1099 of file masstree_page_impl.hpp.

Referenced by get_high_key(), get_low_key(), get_pointer(), is_valid(), and next().


The documentation for this struct was generated from the following file: