libfoedus-core
FOEDUS Core Library
foedus::storage::masstree::SortEntry Struct Reference

Unlike array's sort entry, we don't always use this because keys are arbitrary lengthes. More...

Detailed Description

Unlike array's sort entry, we don't always use this because keys are arbitrary lengthes.

We use this when all keys are up to 8 bytes. To speed up other cases, we might want to use this for more than 8 bytes, later, later..

We couldn't fit this within 16 bytes. We tried to do it by substituting log position with 3 byte "index" of input logs, but then the final output has to be retrieved with lots of L1 cache misses, making it slower. After all, this is 10%-20% slower than an incorrect code that assumes in-epoch-orginal is within 2-bytes and everything fits 16 bytes, using uint128_t. ah, sweet, but no.

Definition at line 402 of file masstree_partitioner_impl.cpp.

Public Member Functions

void set (KeySlice first_slice, uint16_t compressed_epoch, uint32_t in_epoch_ordinal, snapshot::BufferPosition position) __attribute__((always_inline))
 
bool operator< (const SortEntry &rhs) const __attribute__((always_inline))
 

Public Attributes

KeySlice first_slice_
 
uint64_t combined_epoch_
 
snapshot::BufferPosition position_
 
uint32_t dummy2_
 

Member Function Documentation

bool foedus::storage::masstree::SortEntry::operator< ( const SortEntry rhs) const
inline

Definition at line 412 of file masstree_partitioner_impl.cpp.

References combined_epoch_, first_slice_, and position_.

412  {
413  if (first_slice_ != rhs.first_slice_) {
414  return first_slice_ < rhs.first_slice_;
415  }
416  if (combined_epoch_ != rhs.combined_epoch_) {
417  return combined_epoch_ < rhs.combined_epoch_;
418  }
419  return position_ < rhs.position_;
420  }
void foedus::storage::masstree::SortEntry::set ( KeySlice  first_slice,
uint16_t  compressed_epoch,
uint32_t  in_epoch_ordinal,
snapshot::BufferPosition  position 
)
inline

Definition at line 403 of file masstree_partitioner_impl.cpp.

References combined_epoch_, first_slice_, and position_.

Referenced by foedus::storage::masstree::prepare_sort_entries().

407  {
408  first_slice_ = first_slice;
409  combined_epoch_ = (static_cast<uint64_t>(compressed_epoch) << 32) | in_epoch_ordinal;
410  position_ = position;
411  }

Here is the caller graph for this function:

Member Data Documentation

uint64_t foedus::storage::masstree::SortEntry::combined_epoch_

Definition at line 423 of file masstree_partitioner_impl.cpp.

Referenced by operator<(), and set().

uint32_t foedus::storage::masstree::SortEntry::dummy2_

Definition at line 425 of file masstree_partitioner_impl.cpp.

KeySlice foedus::storage::masstree::SortEntry::first_slice_

Definition at line 422 of file masstree_partitioner_impl.cpp.

Referenced by operator<(), and set().

snapshot::BufferPosition foedus::storage::masstree::SortEntry::position_

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