libfoedus-core
FOEDUS Core Library
foedus::storage::VolatilePagePointer Struct Reference

Represents a pointer to a volatile page with modification count for preventing ABA. More...

Detailed Description

Represents a pointer to a volatile page with modification count for preventing ABA.

The high 32 bit is for now sparsely used while the low 32 bit is the offset. The high 32 bit so far uses only the first 8 bits:

  • 8-bit NUMA node ID (foedus::thread::ThreadGroupId)
  • Unused 8-bit field
  • Unused 16-bit field We initially had some flags and mofidication count within a pointer, but not used so far. We might later use it.

The offset has to be at least 32 bit (4kb * 2^32=16TB per NUMA node).

Note
Initially this was a union, but became just a uint64_t. union data type is a bit unfriendly to some standard classes.

Definition at line 194 of file storage_id.hpp.

#include <storage_id.hpp>

Public Member Functions

 VolatilePagePointer ()
 
 VolatilePagePointer (uint64_t the_word)
 
 VolatilePagePointer (const VolatilePagePointer &other)
 
uint8_t get_numa_node () const
 
memory::PagePoolOffset get_offset () const
 
void set_offset_unsafe (memory::PagePoolOffset offset)
 This is used only in special places (snapshot composer). More...
 
bool is_null () const
 
void clear ()
 
void set (uint8_t numa_node, memory::PagePoolOffset offset)
 
bool is_equivalent (const VolatilePagePointer &other) const
 
bool operator== (const VolatilePagePointer &other) const
 
bool operator!= (const VolatilePagePointer &other) const
 

Public Attributes

uint64_t word
 

Friends

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

Constructor & Destructor Documentation

foedus::storage::VolatilePagePointer::VolatilePagePointer ( )
inline

Definition at line 197 of file storage_id.hpp.

foedus::storage::VolatilePagePointer::VolatilePagePointer ( uint64_t  the_word)
inlineexplicit

Definition at line 198 of file storage_id.hpp.

198 : word(the_word) {}
foedus::storage::VolatilePagePointer::VolatilePagePointer ( const VolatilePagePointer other)
inline

Definition at line 199 of file storage_id.hpp.

199 : word(other.word) {}

Member Function Documentation

bool foedus::storage::VolatilePagePointer::is_equivalent ( const VolatilePagePointer other) const
inline

Definition at line 215 of file storage_id.hpp.

References word.

Referenced by foedus::storage::masstree::SplitIntermediate::decide_strategy(), foedus::storage::hash::resolve_data_impl(), and foedus::storage::hash::resolve_intermediate_impl().

215  {
216  // Now that we got rid of unused flags/mod_count, this is simply a word comparison.
217  return word == other.word;
218  }

Here is the caller graph for this function:

bool foedus::storage::VolatilePagePointer::is_null ( ) const
inline

Definition at line 210 of file storage_id.hpp.

References get_offset().

Referenced by foedus::storage::hash::ReserveRecords::create_new_record_in_tail_page(), foedus::storage::hash::ReserveRecords::create_new_tail_page(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_data(), foedus::storage::masstree::MasstreeStoragePimpl::debugout_single_thread_follow(), foedus::storage::hash::HashStoragePimpl::debugout_single_thread_intermediate(), foedus::storage::describe_volatile_pointer(), foedus::storage::array::ArrayPartitioner::design_partition(), foedus::storage::masstree::design_partition_first_parallel_recurse(), foedus::storage::hash::HashPartitioner::design_partition_task(), foedus::storage::Composer::DropVolatilesArguments::drop(), foedus::storage::array::ArrayComposer::drop_volatiles(), foedus::storage::hash::HashComposer::drop_volatiles(), foedus::storage::hash::ReserveRecords::find_and_lock_spacious_tail(), foedus::storage::hash::HashStoragePimpl::follow_page_bin_head(), foedus::thread::ThreadPimpl::follow_page_pointer(), foedus::thread::ThreadPimpl::follow_page_pointers_for_read_batch(), foedus::thread::ThreadPimpl::follow_page_pointers_for_write_batch(), foedus::storage::masstree::grow_case_b_common(), foedus::storage::array::ArrayStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat_data(), foedus::storage::masstree::MasstreeStoragePimpl::hcc_reset_all_temperature_stat_follow(), foedus::storage::array::ArrayStoragePimpl::hcc_reset_all_temperature_stat_intermediate(), foedus::storage::hash::HashStoragePimpl::hcc_reset_all_temperature_stat_intermediate(), foedus::thread::ThreadPimpl::install_a_volatile_page(), foedus::storage::DualPagePointer::is_both_null(), foedus::storage::masstree::MasstreePage::is_foster_major_null(), foedus::storage::masstree::MasstreePage::is_foster_minor_null(), foedus::storage::hash::HashStoragePimpl::locate_record(), foedus::storage::hash::HashStoragePimpl::locate_record_in_snapshot(), foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries(), foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_next_layer(), foedus::storage::masstree::MasstreeStoragePimpl::peek_volatile_page_boundaries_this_layer_recurse(), foedus::thread::ThreadPimpl::place_a_new_volatile_page(), foedus::storage::masstree::MasstreeStoragePimpl::prefetch_pages_follow(), foedus::storage::array::ArrayStoragePimpl::prefetch_pages_recurse(), foedus::storage::hash::ComposedBinsMergedStream::process_a_bin(), foedus::storage::StorageManagerPimpl::reinitialize_for_recovered_snapshot(), foedus::storage::hash::HashIntermediatePage::release_pages_recursive(), foedus::storage::hash::HashDataPage::release_pages_recursive(), foedus::storage::array::ArrayStoragePimpl::release_pages_recursive(), foedus::storage::masstree::MasstreeIntermediatePage::release_pages_recursive(), foedus::storage::masstree::MasstreeBorderPage::release_pages_recursive(), foedus::storage::hash::HashIntermediatePage::release_pages_recursive_parallel(), foedus::storage::masstree::MasstreeIntermediatePage::release_pages_recursive_parallel(), foedus::storage::hash::resolve_data_impl(), foedus::storage::hash::resolve_intermediate_impl(), foedus::storage::masstree::GrowFirstLayerRoot::run(), foedus::storage::masstree::GrowNonFirstLayerRoot::run(), foedus::storage::hash::ReserveRecords::search_within_page(), foedus::storage::masstree::MasstreeBorderPage::track_moved_record_next_layer(), foedus::storage::hash::HashStoragePimpl::track_moved_record_search(), foedus::storage::array::ArrayStoragePimpl::verify_single_thread(), foedus::storage::hash::HashStoragePimpl::verify_single_thread(), foedus::storage::hash::HashStoragePimpl::verify_single_thread_data(), and foedus::storage::hash::HashStoragePimpl::verify_single_thread_intermediate().

210 { return get_offset() == 0; }
memory::PagePoolOffset get_offset() const
Definition: storage_id.hpp:202

Here is the call graph for this function:

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

Definition at line 222 of file storage_id.hpp.

References word.

222  {
223  return word != other.word;
224  }
bool foedus::storage::VolatilePagePointer::operator== ( const VolatilePagePointer other) const
inline

Definition at line 219 of file storage_id.hpp.

References word.

219  {
220  return word == other.word;
221  }
void foedus::storage::VolatilePagePointer::set_offset_unsafe ( memory::PagePoolOffset  offset)
inline

This is used only in special places (snapshot composer).

You should almost always use set(), thus named unsafe.

Definition at line 207 of file storage_id.hpp.

References get_numa_node(), and set().

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

207  {
208  set(get_numa_node(), offset);
209  }
void set(uint8_t numa_node, memory::PagePoolOffset offset)
Definition: storage_id.hpp:212

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 VolatilePagePointer v 
)
friend

Definition at line 40 of file storage_id.cpp.

40  {
42  return o;
43 }
void describe_volatile_pointer(std::ostream *o, VolatilePagePointer pointer)
Definition: storage_id.cpp:44

Member Data Documentation

uint64_t foedus::storage::VolatilePagePointer::word

Definition at line 195 of file storage_id.hpp.

Referenced by foedus::storage::masstree::allocate_new_border_page(), foedus::storage::assert_valid_volatile_page(), foedus::storage::construct_volatile_page_pointer(), foedus::storage::sequential::SequentialStoragePimpl::drop(), foedus::storage::DualPagePointer::DualPagePointer(), foedus::storage::hash::HashStoragePimpl::follow_page_bin_head(), foedus::storage::hash::ComposedBinsMergedStream::init(), foedus::storage::StorageControlBlock::initialize(), foedus::storage::masstree::MasstreePage::initialize_snapshot_common(), foedus::storage::sequential::SequentialPage::initialize_snapshot_page(), foedus::storage::masstree::MasstreePage::initialize_volatile_common(), foedus::storage::sequential::SequentialPage::initialize_volatile_page(), foedus::thread::ThreadPimpl::install_a_volatile_page(), is_equivalent(), foedus::storage::array::ArrayStoragePimpl::load(), foedus::storage::array::ArrayStoragePimpl::load_empty(), foedus::memory::EngineMemory::load_one_volatile_page(), operator!=(), foedus::xct::operator<<(), foedus::storage::operator<<(), operator==(), foedus::storage::DualPagePointer::operator==(), foedus::thread::ThreadPimpl::place_a_new_volatile_page(), foedus::xct::XctManagerPimpl::precommit_xct_verify_pointer_set(), foedus::storage::StorageManagerPimpl::reinitialize_for_recovered_snapshot(), foedus::storage::hash::HashIntermediatePage::release_pages_recursive(), foedus::storage::hash::HashDataPage::release_pages_recursive(), foedus::storage::array::ArrayStoragePimpl::release_pages_recursive(), foedus::storage::masstree::MasstreeIntermediatePage::release_pages_recursive(), foedus::storage::masstree::MasstreeBorderPage::release_pages_recursive(), foedus::storage::hash::HashIntermediatePage::release_pages_recursive_parallel(), and foedus::storage::masstree::MasstreeIntermediatePage::release_pages_recursive_parallel().


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