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

Used in sort_batch(). More...

Detailed Description

Used in sort_batch().

  • 0-5 bytes: HashBin, 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 212 of file hash_partitioner_impl.cpp.

Public Member Functions

void set (HashBin bin, uint16_t compressed_epoch, uint32_t in_epoch_ordinal, snapshot::BufferPosition position) __attribute__((always_inline))
 
HashBin get_bin () const __attribute__((always_inline))
 
snapshot::BufferPosition get_position () const __attribute__((always_inline))
 

Public Attributes

__uint128_t data_
 

Member Function Documentation

HashBin foedus::storage::hash::SortEntry::get_bin ( ) const
inline

Definition at line 225 of file hash_partitioner_impl.cpp.

References data_.

225  {
226  return static_cast<HashBin>(data_ >> 80);
227  }
uint64_t HashBin
Represents a bin of a hash value.
Definition: hash_id.hpp:142
snapshot::BufferPosition foedus::storage::hash::SortEntry::get_position ( ) const
inline

Definition at line 228 of file hash_partitioner_impl.cpp.

References data_.

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

228  {
229  return static_cast<snapshot::BufferPosition>(data_);
230  }
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::hash::SortEntry::set ( HashBin  bin,
uint16_t  compressed_epoch,
uint32_t  in_epoch_ordinal,
snapshot::BufferPosition  position 
)
inline

Definition at line 213 of file hash_partitioner_impl.cpp.

References ASSERT_ND, data_, and foedus::storage::hash::kHashMaxBinBits.

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

217  {
218  ASSERT_ND(bin < (1ULL << kHashMaxBinBits));
219  data_
220  = static_cast<__uint128_t>(bin) << 80
221  | static_cast<__uint128_t>(compressed_epoch) << 64
222  | static_cast<__uint128_t>(in_epoch_ordinal) << 32
223  | static_cast<__uint128_t>(position);
224  }
const uint8_t kHashMaxBinBits
Maximum number allowed for bin-bits.
Definition: hash_id.hpp:159
#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::hash::SortEntry::data_

Definition at line 231 of file hash_partitioner_impl.cpp.

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


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