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

Transaction ID, a 128-bit data to manage record versions and provide locking mechanism. More...

Detailed Description

Transaction ID, a 128-bit data to manage record versions and provide locking mechanism.

This object contains a quite more information compared to SILO [TU13]'s TID. We spend more bits on ordinals and epochs for larger environments, and also employ MCS-locking to be more scalable. Thus, now it's 128-bits. It's not a negligible size, but still compact. Also, 16-bytes sometimes reduce false cacheline sharing (well, then you might ask making it 64 bytes... but that's too much).

McsWwLock and XctId
McsWwLock provides the locking mechanism, namely MCS locking. XctId provides the record version information protected by the lock.
POD
This is a POD struct. Default destructor/copy-constructor/assignment operator work fine.

Definition at line 1107 of file xct_id.hpp.

#include <xct_id.hpp>

Collaboration diagram for foedus::xct::LockableXctId:

Public Member Functions

McsWwLockget_key_lock () __attribute__((always_inline))
 
bool is_keylocked () const __attribute__((always_inline))
 
bool is_deleted () const __attribute__((always_inline))
 
bool is_moved () const __attribute__((always_inline))
 
bool is_next_layer () const __attribute__((always_inline))
 
bool needs_track_moved () const __attribute__((always_inline))
 
bool is_being_written () const __attribute__((always_inline))
 
void reset () __attribute__((always_inline))
 used only while page initialization More...
 

Public Attributes

McsWwLock lock_
 the first 64bit: Locking part of TID More...
 
XctId xct_id_
 the second 64bit: Persistent status part of TID. More...
 

Friends

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

Member Function Documentation

McsWwLock* foedus::xct::LockableXctId::get_key_lock ( )
inline

Definition at line 1113 of file xct_id.hpp.

References lock_.

1113 { return &lock_; }
McsWwLock lock_
the first 64bit: Locking part of TID
Definition: xct_id.hpp:1109
bool foedus::xct::LockableXctId::is_being_written ( ) const
inline

Definition at line 1119 of file xct_id.hpp.

References foedus::xct::XctId::is_being_written().

1119 { return xct_id_.is_being_written(); }
XctId xct_id_
the second 64bit: Persistent status part of TID.
Definition: xct_id.hpp:1111
bool is_being_written() const __attribute__((always_inline))
Definition: xct_id.hpp:1038

Here is the call graph for this function:

bool foedus::xct::LockableXctId::is_deleted ( ) const
inline

Definition at line 1115 of file xct_id.hpp.

References foedus::xct::XctId::is_deleted().

1115 { return xct_id_.is_deleted(); }
XctId xct_id_
the second 64bit: Persistent status part of TID.
Definition: xct_id.hpp:1111
bool is_deleted() const __attribute__((always_inline))
Definition: xct_id.hpp:1040

Here is the call graph for this function:

bool foedus::xct::LockableXctId::is_keylocked ( ) const
inline

Definition at line 1114 of file xct_id.hpp.

References foedus::xct::McsWwLock::is_locked().

1114 { return lock_.is_locked(); }
bool is_locked() const
This is a "relaxed" check.
Definition: xct_id.hpp:334
McsWwLock lock_
the first 64bit: Locking part of TID
Definition: xct_id.hpp:1109

Here is the call graph for this function:

bool foedus::xct::LockableXctId::is_moved ( ) const
inline

Definition at line 1116 of file xct_id.hpp.

References foedus::xct::XctId::is_moved().

1116 { return xct_id_.is_moved(); }
XctId xct_id_
the second 64bit: Persistent status part of TID.
Definition: xct_id.hpp:1111
bool is_moved() const __attribute__((always_inline))
Definition: xct_id.hpp:1041

Here is the call graph for this function:

bool foedus::xct::LockableXctId::is_next_layer ( ) const
inline

Definition at line 1117 of file xct_id.hpp.

References foedus::xct::XctId::is_next_layer().

1117 { return xct_id_.is_next_layer(); }
XctId xct_id_
the second 64bit: Persistent status part of TID.
Definition: xct_id.hpp:1111
bool is_next_layer() const __attribute__((always_inline))
Definition: xct_id.hpp:1042

Here is the call graph for this function:

bool foedus::xct::LockableXctId::needs_track_moved ( ) const
inline

Definition at line 1118 of file xct_id.hpp.

References foedus::xct::XctId::needs_track_moved().

1118 { return xct_id_.needs_track_moved(); }
XctId xct_id_
the second 64bit: Persistent status part of TID.
Definition: xct_id.hpp:1111
bool needs_track_moved() const __attribute__((always_inline))
is_moved() || is_next_layer()
Definition: xct_id.hpp:1044

Here is the call graph for this function:

void foedus::xct::LockableXctId::reset ( )
inline

used only while page initialization

Definition at line 1122 of file xct_id.hpp.

References foedus::xct::XctId::data_, and foedus::xct::McsWwLock::reset().

1122  {
1123  lock_.reset();
1124  xct_id_.data_ = 0;
1125  }
void reset() __attribute__((always_inline))
used only while page initialization
Definition: xct_id.hpp:355
XctId xct_id_
the second 64bit: Persistent status part of TID.
Definition: xct_id.hpp:1111
McsWwLock lock_
the first 64bit: Locking part of TID
Definition: xct_id.hpp:1109

Here is the call graph for this function:

Friends And Related Function Documentation

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

Definition at line 190 of file xct_id.cpp.

190  {
191  o << "<LockableXctId>" << v.xct_id_ << v.lock_ << "</LockableXctId>";
192  return o;
193 }

Member Data Documentation

McsWwLock foedus::xct::LockableXctId::lock_

the first 64bit: Locking part of TID

Definition at line 1109 of file xct_id.hpp.

Referenced by get_key_lock(), and foedus::xct::operator<<().

XctId foedus::xct::LockableXctId::xct_id_

the second 64bit: Persistent status part of TID.

Definition at line 1111 of file xct_id.hpp.

Referenced by foedus::xct::operator<<().


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