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

Detailed Description

Definition at line 59 of file page.hpp.

#include <page.hpp>

Public Types

enum  Constants {
  kRetiredBit = 1 << 31, kMovedBit = 1 << 30, kHasNextPageBit = 1 << 29, kReservedBit2 = 1 << 28,
  kVersionMask = 0x0FFFFFFF
}
 

Public Member Functions

 PageVersionStatus ()
 
void reset () __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 PageVersionStatus &other) const __attribute__((always_inline))
 
bool operator!= (const PageVersionStatus &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

uint32_t status_
 

Friends

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

Member Enumeration Documentation

Enumerator
kRetiredBit 
kMovedBit 
kHasNextPageBit 

so far used only in hash storage, where data page forms a linked list

kReservedBit2 
kVersionMask 

Definition at line 60 of file page.hpp.

60  {
61  kRetiredBit = 1 << 31,
62  kMovedBit = 1 << 30,
64  kHasNextPageBit = 1 << 29,
65  kReservedBit2 = 1 << 28,
66  kVersionMask = 0x0FFFFFFF,
67  };
so far used only in hash storage, where data page forms a linked list
Definition: page.hpp:64

Constructor & Destructor Documentation

foedus::storage::PageVersionStatus::PageVersionStatus ( )
inline

Definition at line 68 of file page.hpp.

68 : status_(0) {}

Member Function Documentation

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

Definition at line 99 of file page.hpp.

References kVersionMask, and status_.

Referenced by foedus::storage::PageVersion::get_version_counter(), increment_version_counter(), and foedus::storage::operator<<().

Here is the caller graph for this function:

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

Definition at line 73 of file page.hpp.

References kHasNextPageBit, and status_.

Referenced by foedus::storage::PageVersion::has_next_page(), foedus::storage::hash::HashStoragePimpl::locate_record(), and set_has_next_page().

73 { return (status_ & kHasNextPageBit) != 0; }
so far used only in hash storage, where data page forms a linked list
Definition: page.hpp:64

Here is the caller graph for this function:

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

Definition at line 103 of file page.hpp.

References ASSERT_ND, get_version_counter(), kVersionMask, and status_.

Referenced by foedus::storage::sequential::SequentialPage::append_record_nosync(), and foedus::storage::PageVersion::increment_version_counter().

103  {
104  // we do this only when we insert a new key or split, so this never overflows.
106  ++status_;
107  }
uint32_t get_version_counter() const __attribute__((always_inline))
Definition: page.hpp:99
#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::PageVersionStatus::is_moved ( ) const
inline
bool foedus::storage::PageVersionStatus::is_retired ( ) const
inline

Definition at line 72 of file page.hpp.

References kRetiredBit, and status_.

Referenced by foedus::storage::PageVersion::is_retired(), foedus::storage::operator<<(), set_has_next_page(), and set_retired().

Here is the caller graph for this function:

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

Definition at line 78 of file page.hpp.

References status_.

78  {
79  return status_ != other.status_;
80  }
bool foedus::storage::PageVersionStatus::operator== ( const PageVersionStatus other) const
inline

Definition at line 75 of file page.hpp.

References status_.

75  {
76  return status_ == other.status_;
77  }
void foedus::storage::PageVersionStatus::reset ( )
inline

Definition at line 69 of file page.hpp.

References status_.

Referenced by foedus::storage::PageVersion::reset().

69 { status_ = 0; }

Here is the caller graph for this function:

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

Definition at line 91 of file page.hpp.

References ASSERT_ND, has_next_page(), is_moved(), is_retired(), kHasNextPageBit, and status_.

Referenced by foedus::storage::PageVersion::set_has_next_page().

91  {
92  ASSERT_ND(!is_moved());
96  }
bool is_moved() const __attribute__((always_inline))
Definition: page.hpp:71
so far used only in hash storage, where data page forms a linked list
Definition: page.hpp:64
bool has_next_page() const __attribute__((always_inline))
Definition: page.hpp:73
bool is_retired() const __attribute__((always_inline))
Definition: page.hpp:72
#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:

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

Definition at line 82 of file page.hpp.

References ASSERT_ND, is_moved(), kMovedBit, and status_.

Referenced by foedus::storage::PageVersion::set_moved().

82  {
83  ASSERT_ND(!is_moved());
84  status_ |= kMovedBit;
85  }
bool is_moved() const __attribute__((always_inline))
Definition: page.hpp:71
#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:

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

Definition at line 86 of file page.hpp.

References ASSERT_ND, is_moved(), is_retired(), kRetiredBit, and status_.

Referenced by foedus::storage::PageVersion::set_retired().

86  {
87  ASSERT_ND(is_moved()); // we always set moved bit first. retire must happen later.
90  }
bool is_moved() const __attribute__((always_inline))
Definition: page.hpp:71
bool is_retired() const __attribute__((always_inline))
Definition: page.hpp:72
#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:

Friends And Related Function Documentation

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

Definition at line 33 of file page.cpp.

33  {
34  o << "<PageVersionStatus><flags>"
35  << (v.is_moved() ? "M" : " ")
36  << (v.is_retired() ? "R" : " ")
37  << "</flags><ver>" << v.get_version_counter() << "</ver>"
38  << "</PageVersionStatus>";
39  return o;
40 }

Member Data Documentation


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