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

Used in sort_batch(). More...

Detailed Description

Used in sort_batch().

  • 0-5 bytes: ArrayOffset, the most significant.
  • 6-7 bytes: compressed epoch (difference from base_epoch)
  • 8-11 bytes: in-epoch-ordinal
  • 12-15 bytes: BufferPosition (doesn't have to be sorted together, but for simplicity) Be careful on endian! We use uint128_t to make it easier and faster.

Definition at line 204 of file array_partitioner_impl.cpp.

Public Member Functions

void set (ArrayOffset offset, uint16_t compressed_epoch, uint32_t in_epoch_ordinal, snapshot::BufferPosition position) __attribute__((always_inline))
 
ArrayOffset get_offset () const __attribute__((always_inline))
 
snapshot::BufferPosition get_position () const __attribute__((always_inline))
 

Public Attributes

__uint128_t data_
 

Member Function Documentation

ArrayOffset foedus::storage::array::SortEntry::get_offset ( ) const
inline

Definition at line 217 of file array_partitioner_impl.cpp.

References data_.

Referenced by foedus::storage::array::compact_logs().

217  {
218  return static_cast<ArrayOffset>(data_ >> 80);
219  }
uint64_t ArrayOffset
The only key type in array storage.
Definition: array_id.hpp:48

Here is the caller graph for this function:

snapshot::BufferPosition foedus::storage::array::SortEntry::get_position ( ) const
inline

Definition at line 220 of file array_partitioner_impl.cpp.

References data_.

Referenced by foedus::storage::array::compact_logs().

220  {
221  return static_cast<snapshot::BufferPosition>(data_);
222  }
uint32_t BufferPosition
Represents a position in some buffer.
Definition: snapshot_id.hpp:72

Here is the caller graph for this function:

void foedus::storage::array::SortEntry::set ( ArrayOffset  offset,
uint16_t  compressed_epoch,
uint32_t  in_epoch_ordinal,
snapshot::BufferPosition  position 
)
inline

Definition at line 205 of file array_partitioner_impl.cpp.

References ASSERT_ND, data_, and foedus::storage::array::kMaxArrayOffset.

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

209  {
210  ASSERT_ND(offset < kMaxArrayOffset);
211  data_
212  = static_cast<__uint128_t>(offset) << 80
213  | static_cast<__uint128_t>(compressed_epoch) << 64
214  | static_cast<__uint128_t>(in_epoch_ordinal) << 32
215  | static_cast<__uint128_t>(position);
216  }
const ArrayOffset kMaxArrayOffset
The maximum value allowed for ArrayOffset.
Definition: array_id.hpp:54
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Here is the caller graph for this function:

Member Data Documentation

__uint128_t foedus::storage::array::SortEntry::data_

Definition at line 223 of file array_partitioner_impl.cpp.

Referenced by get_offset(), get_position(), and set().


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