libfoedus-core
FOEDUS Core Library
foedus::storage::PageVersion Struct Referencefinal

Just a synonym of XctId to be used as a page lock mechanism. More...

Detailed Description

Just a synonym of XctId to be used as a page lock mechanism.

Each page has this in the header. Unlike [YANDONG12], this is just an McsWwLock. We maintain key count and permutation differently from [YANDONG12].

"is_deleted" flag is called "is_retired" to clarify what deletion means for a page. Also, epoch/ordinal has not much meaning for page. So, we only increment the ordinal part for each change. Epoch part is unused.

This object is a POD. All methods are inlined except stream.

Definition at line 129 of file page.hpp.

#include <page.hpp>

Collaboration diagram for foedus::storage::PageVersion:

Public Member Functions

 PageVersion () __attribute__((always_inline))
 
void reset () __attribute__((always_inline))
 used only while page initialization More...
 
bool is_locked () const __attribute__((always_inline))
 
bool is_moved () const __attribute__((always_inline))
 
bool is_retired () const __attribute__((always_inline))
 
bool has_next_page () const __attribute__((always_inline))
 
bool operator== (const PageVersion &other) const __attribute__((always_inline))
 
bool operator!= (const PageVersion &other) const __attribute__((always_inline))
 
void set_moved () __attribute__((always_inline))
 
void set_retired () __attribute__((always_inline))
 
void set_has_next_page () __attribute__((always_inline))
 
uint32_t get_version_counter () const __attribute__((always_inline))
 
void increment_version_counter () __attribute__((always_inline))
 

Public Attributes

xct::McsWwLock lock_
 
PageVersionStatus status_
 
uint32_t unused_
 

Friends

std::ostream & operator<< (std::ostream &o, const PageVersion &v)
 

Constructor & Destructor Documentation

foedus::storage::PageVersion::PageVersion ( )
inline

Definition at line 130 of file page.hpp.

130 : lock_(), status_() {}
xct::McsWwLock lock_
Definition: page.hpp:171
PageVersionStatus status_
Definition: page.hpp:172

Member Function Documentation

uint32_t foedus::storage::PageVersion::get_version_counter ( ) const
inline

Definition at line 160 of file page.hpp.

References foedus::storage::PageVersionStatus::get_version_counter(), and status_.

160  {
161  return status_.get_version_counter();
162  }
uint32_t get_version_counter() const __attribute__((always_inline))
Definition: page.hpp:99
PageVersionStatus status_
Definition: page.hpp:172

Here is the call graph for this function:

bool foedus::storage::PageVersion::has_next_page ( ) const
inline

Definition at line 141 of file page.hpp.

References foedus::storage::PageVersionStatus::has_next_page(), and status_.

141 { return status_.has_next_page(); }
PageVersionStatus status_
Definition: page.hpp:172
bool has_next_page() const __attribute__((always_inline))
Definition: page.hpp:73

Here is the call graph for this function:

void foedus::storage::PageVersion::increment_version_counter ( )
inline

Definition at line 164 of file page.hpp.

References ASSERT_ND, foedus::storage::PageVersionStatus::increment_version_counter(), is_locked(), and status_.

164  {
165  ASSERT_ND(is_locked());
167  }
PageVersionStatus status_
Definition: page.hpp:172
#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
bool is_locked() const __attribute__((always_inline))
Definition: page.hpp:138
void increment_version_counter() __attribute__((always_inline))
Definition: page.hpp:103

Here is the call graph for this function:

bool foedus::storage::PageVersion::is_retired ( ) const
inline

Definition at line 140 of file page.hpp.

References foedus::storage::PageVersionStatus::is_retired(), and status_.

Referenced by foedus::storage::masstree::MasstreePage::is_retired(), foedus::thread::ThreadPimpl::is_volatile_page_retired(), foedus::storage::operator<<(), and foedus::storage::hash::HashStoragePimpl::verify_single_thread_intermediate().

140 { return status_.is_retired(); }
PageVersionStatus status_
Definition: page.hpp:172
bool is_retired() const __attribute__((always_inline))
Definition: page.hpp:72

Here is the call graph for this function:

Here is the caller graph for this function:

bool foedus::storage::PageVersion::operator!= ( const PageVersion other) const
inline

Definition at line 144 of file page.hpp.

References foedus::storage::PageVersionStatus::status_, and status_.

144 { return status_ != other.status_; }
PageVersionStatus status_
Definition: page.hpp:172
bool foedus::storage::PageVersion::operator== ( const PageVersion other) const
inline

Definition at line 143 of file page.hpp.

References foedus::storage::PageVersionStatus::status_, and status_.

143 { return status_ == other.status_; }
PageVersionStatus status_
Definition: page.hpp:172
void foedus::storage::PageVersion::reset ( )
inline

used only while page initialization

Definition at line 133 of file page.hpp.

References lock_, foedus::storage::PageVersionStatus::reset(), foedus::xct::McsWwLock::reset(), and status_.

Referenced by foedus::storage::PageHeader::init_snapshot(), and foedus::storage::PageHeader::init_volatile().

133  {
134  lock_.reset();
135  status_.reset();
136  }
void reset() __attribute__((always_inline))
used only while page initialization
Definition: xct_id.hpp:355
xct::McsWwLock lock_
Definition: page.hpp:171
void reset() __attribute__((always_inline))
Definition: page.hpp:69
PageVersionStatus status_
Definition: page.hpp:172

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::storage::PageVersion::set_has_next_page ( )
inline

Definition at line 154 of file page.hpp.

References ASSERT_ND, is_locked(), foedus::storage::PageVersionStatus::set_has_next_page(), and status_.

Referenced by foedus::storage::hash::ReserveRecords::create_new_record_in_tail_page(), and foedus::storage::hash::ReserveRecords::find_and_lock_spacious_tail().

154  {
155  ASSERT_ND(is_locked());
157  }
PageVersionStatus status_
Definition: page.hpp:172
#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
bool is_locked() const __attribute__((always_inline))
Definition: page.hpp:138
void set_has_next_page() __attribute__((always_inline))
Definition: page.hpp:91

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::storage::PageVersion::set_moved ( )
inline

Definition at line 146 of file page.hpp.

References ASSERT_ND, is_locked(), foedus::storage::PageVersionStatus::set_moved(), and status_.

Referenced by foedus::storage::masstree::SplitBorder::run(), and foedus::storage::masstree::MasstreePage::set_moved().

146  {
147  ASSERT_ND(is_locked());
148  status_.set_moved();
149  }
void set_moved() __attribute__((always_inline))
Definition: page.hpp:82
PageVersionStatus status_
Definition: page.hpp:172
#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
bool is_locked() const __attribute__((always_inline))
Definition: page.hpp:138

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::storage::PageVersion::set_retired ( )
inline

Definition at line 150 of file page.hpp.

References ASSERT_ND, is_locked(), foedus::storage::PageVersionStatus::set_retired(), and status_.

Referenced by foedus::storage::masstree::MasstreePage::set_retired().

150  {
151  ASSERT_ND(is_locked());
153  }
PageVersionStatus status_
Definition: page.hpp:172
void set_retired() __attribute__((always_inline))
Definition: page.hpp:86
#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
bool is_locked() const __attribute__((always_inline))
Definition: page.hpp:138

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const PageVersion v 
)
friend

Definition at line 42 of file page.cpp.

42  {
43  o << "<PageVersion><locked>"
44  << (v.is_locked() ? "L" : " ")
45  << (v.is_moved() ? "M" : " ")
46  << (v.is_retired() ? "R" : " ")
47  << "</locked>" << v.status_
48  << "</PageVersion>";
49  return o;
50 }

Member Data Documentation

uint32_t foedus::storage::PageVersion::unused_

Definition at line 173 of file page.hpp.


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