libfoedus-core
FOEDUS Core Library
foedus::storage::Composer::DropResult Struct Reference

Retrun value of drop_volatiles() More...

Detailed Description

Retrun value of drop_volatiles()

Definition at line 171 of file composer.hpp.

#include <composer.hpp>

Collaboration diagram for foedus::storage::Composer::DropResult:

Public Member Functions

 DropResult (const DropVolatilesArguments &args)
 
void combine (const DropResult &other)
 
void on_rec_observed (Epoch epoch)
 

Public Attributes

Epoch max_observed_
 the largest Epoch it observed recursively. More...
 
bool dropped_all_
 Whether all volatile pages under the page was dropped. More...
 
bool padding_ [3]
 

Friends

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

Constructor & Destructor Documentation

foedus::storage::Composer::DropResult::DropResult ( const DropVolatilesArguments args)
inlineexplicit

Definition at line 172 of file composer.hpp.

References dropped_all_, max_observed_, foedus::storage::Composer::DropVolatilesArguments::snapshot_, and foedus::snapshot::Snapshot::valid_until_epoch_.

172  {
173  max_observed_ = args.snapshot_.valid_until_epoch_; // min value to make store_max easier.
174  dropped_all_ = true; // "so far". zero-inspected, thus zero-failure.
175  }
Epoch max_observed_
the largest Epoch it observed recursively.
Definition: composer.hpp:200
bool dropped_all_
Whether all volatile pages under the page was dropped.
Definition: composer.hpp:202

Member Function Documentation

void foedus::storage::Composer::DropResult::combine ( const DropResult other)
inline

Definition at line 176 of file composer.hpp.

References dropped_all_, max_observed_, and foedus::Epoch::store_max().

Referenced by foedus::storage::array::ArrayComposer::drop_volatiles(), and foedus::storage::masstree::MasstreeComposer::drop_volatiles().

176  {
177  max_observed_.store_max(other.max_observed_);
178  dropped_all_ &= other.dropped_all_;
179  }
Epoch max_observed_
the largest Epoch it observed recursively.
Definition: composer.hpp:200
bool dropped_all_
Whether all volatile pages under the page was dropped.
Definition: composer.hpp:202
void store_max(const Epoch &other)
Kind of std::max(this, other).
Definition: epoch.hpp:165

Here is the call graph for this function:

Here is the caller graph for this function:

void foedus::storage::Composer::DropResult::on_rec_observed ( Epoch  epoch)
inline

Definition at line 181 of file composer.hpp.

References dropped_all_, and max_observed_.

181  {
182  if (epoch > max_observed_) {
183  max_observed_ = epoch;
184  dropped_all_ = false;
185  }
186  }
Epoch max_observed_
the largest Epoch it observed recursively.
Definition: composer.hpp:200
bool dropped_all_
Whether all volatile pages under the page was dropped.
Definition: composer.hpp:202

Friends And Related Function Documentation

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

Definition at line 46 of file composer.cpp.

46  {
47  o << "<DropResult>"
48  << "<max_observed_>" << v.max_observed_ << "</max_observed_>"
49  << "<dropped_all_>" << v.dropped_all_ << "</dropped_all_>"
50  << "</DropResult>";
51  return o;
52 }

Member Data Documentation

Epoch foedus::storage::Composer::DropResult::max_observed_

the largest Epoch it observed recursively.

The page is dropped only if the return value is ==args.snapshot_.valid_until_epoch_. If some record under this contains larger (newer) epoch, it returns that epoch. For ease of store_max, the returned epoch is adjusted to args.snapshot_.valid_until_epoch_ if it's smaller than that. Note that not all volatile pages might be dropped even if this is equal to snapshot_.valid_until_epoch_ (eg no new modifications, but keep-volatile policy told us to keep the volatile page). Use dropped_all_ for that purpose.

Definition at line 200 of file composer.hpp.

Referenced by combine(), foedus::snapshot::SnapshotManagerPimpl::drop_volatile_pages(), foedus::snapshot::SnapshotManagerPimpl::drop_volatile_pages_parallel(), DropResult(), on_rec_observed(), and foedus::storage::operator<<().

bool foedus::storage::Composer::DropResult::padding_[3]

Definition at line 203 of file composer.hpp.


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