Inheritance diagram for lsn_t:
A log sequence number points to a record in the log. It consists of two parts:
All state is stored in a single 64-bit value. This reading or setting is atomic on 64-bit platforms (though updates still need protection).
48-bit offsets are larger, but (slightly) more expensive and likely to wrap sooner. 32-bit offsets are still pretty big, and the chance of wrapping is *much* smaller (though a production system could theoretically hit the limit, since the count persists as long as the database exists. For now we go with the 32-32 split.
lsn_t no longer cares whether the disk can handle the full range it supports. If you support 48-bit partition sizes and the disk can only handle 32-bit offsets, the largest file will just happen to be smaller than lsn_t technically supports.
lsn_t does not cater to unaligned accesses. Log writes, in particular, are expected to be 8-byte aligned. The extra wasted bytes just aren't worth the performance hit of allowing misalignment.
Definition at line 236 of file lsn.h.
Public Types | |
enum | |
enum | |
Public Member Functions | |
lsn_t () | |
lsn_t (w_base_t::uint4_t f, sm_diskaddr_t r) | |
lsn_t (const lsn_t &other) | |
bool | valid () const |
w_base_t::uint4_t | hi () const |
w_base_t::uint4_t | file () const |
sm_diskaddr_t | lo () const |
sm_diskaddr_t | rba () const |
void | copy_rba (const lsn_t &other) |
void | set_rba (sm_diskaddr_t &other) |
lsn_t & | advance (int amt) |
lsn_t & | operator+= (long delta) |
lsn_t | operator+ (long delta) const |
bool | operator> (const lsn_t &l) const |
bool | operator< (const lsn_t &l) const |
bool | operator>= (const lsn_t &l) const |
bool | operator<= (const lsn_t &l) const |
bool | operator== (const lsn_t &l) const |
bool | operator!= (const lsn_t &l) const |
Static Public Member Functions | |
static w_base_t::uint8_t | mask () |
Static Public Attributes | |
static const int | sm_diskaddr_max |
static const lsn_t | null |
static const lsn_t | max |