libfoedus-core
FOEDUS Core Library
foedus::xct::ReadXctAccess Struct Reference

Represents a record of read-access during a transaction. More...

Detailed Description

Represents a record of read-access during a transaction.

POD
This is a POD struct. Default destructor/copy-constructor/assignment operator work fine.

Definition at line 139 of file xct_access.hpp.

#include <xct_access.hpp>

Inheritance diagram for foedus::xct::ReadXctAccess:
Collaboration diagram for foedus::xct::ReadXctAccess:

Static Public Member Functions

static bool compare (const ReadXctAccess &left, const ReadXctAccess &right) __attribute__((always_inline))
 
- Static Public Member Functions inherited from foedus::xct::RecordXctAccess
static bool compare (const RecordXctAccess &left, const RecordXctAccess &right) __attribute__((always_inline))
 sort the write set in a unique order. More...
 

Public Attributes

XctId observed_owner_id_
 Transaction ID of the record observed as of the access. More...
 
WriteXctAccessrelated_write_
 An optional member that points to a write access related to this read. More...
 
- Public Attributes inherited from foedus::xct::RecordXctAccess
storage::StorageId storage_id_
 The storage we accessed. More...
 
uint32_t ordinal_
 Indicates the ordinal among ReadXctAccess/WriteXctAccess of this transaction. More...
 
RwLockableXctIdowner_id_address_
 Pointer to the accessed record. More...
 
UniversalLockId owner_lock_id_
 Universal Lock ID of the lock in the record. More...
 

Friends

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

Additional Inherited Members

- Public Member Functions inherited from foedus::xct::RecordXctAccess
void set_owner_id_and_lock_id (RwLockableXctId *owner_id_address, UniversalLockId owner_lock_id)
 Setter for owner_id_address_/owner_lock_id_. More...
 
void set_owner_id_resolve_lock_id (const memory::GlobalVolatilePageResolver &resolver, RwLockableXctId *owner_id_address)
 Calculate owner_lock_id using the resolver. More...
 

Member Function Documentation

static bool foedus::xct::ReadXctAccess::compare ( const ReadXctAccess left,
const ReadXctAccess right 
)
inlinestatic

Definition at line 156 of file xct_access.hpp.

References foedus::xct::RecordXctAccess::compare().

156  {
157  return RecordXctAccess::compare(left, right);
158  }
static bool compare(const RecordXctAccess &left, const RecordXctAccess &right) __attribute__((always_inline))
sort the write set in a unique order.
Definition: xct_access.hpp:240

Here is the call graph for this function:

Friends And Related Function Documentation

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

Definition at line 44 of file xct_access.cpp.

44  {
45  o << "<ReadXctAccess><storage>" << v.storage_id_ << "</storage>"
46 // << "<current_lock_position_>" << v.current_lock_position_ << "</current_lock_position_>"
47  << "<ordinal_>" << v.ordinal_ << "</ordinal_>"
48  << "<observed_owner_id>" << v.observed_owner_id_ << "</observed_owner_id>"
49  << "<record_address>" << v.owner_id_address_ << "</record_address>"
50  << "<current_owner_id>" << *v.owner_id_address_ << "</current_owner_id>"
51  << "<owner_lock_id>" << v.owner_lock_id_ << "</owner_lock_id><log>";
52  if (v.related_write_) {
53  o << "<HasRelatedWrite />"; // does not output its content to avoid circle
54  }
55  o << "</ReadXctAccess>";
56  return o;
57 }

Member Data Documentation

WriteXctAccess* foedus::xct::ReadXctAccess::related_write_

An optional member that points to a write access related to this read.

For example, an insert in masstree consists of a read-access that verifies the physical record and a write-access to actually install the record logically. If some other thread logically installs the record between the read and write, the xct must abort. This member connects such "related" read-write pairs so that our commit protocol can utilize.

Definition at line 153 of file xct_access.hpp.

Referenced by foedus::xct::Xct::add_related_write_set(), foedus::xct::Xct::assert_related_read_write(), foedus::xct::operator<<(), foedus::xct::XctManagerPimpl::precommit_xct_lock_track_write(), foedus::xct::XctManagerPimpl::precommit_xct_sort_access(), foedus::xct::XctManagerPimpl::precommit_xct_verify_readwrite(), and foedus::xct::XctManagerPimpl::precommit_xct_verify_track_read().


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