libfoedus-core
FOEDUS Core Library
|
Partitioner for a hash storage. More...
Partitioner for a hash storage.
Partitioning for hash is much easier than for B-trees, but somewhat trickier than array. Compared to array, there will not be and should not be any locality in terms of ranges of hash bins. If there are, it means that the hash function is bad!
Definition at line 67 of file hash_partitioner_impl.hpp.
#include <hash_partitioner_impl.hpp>
Public Member Functions | |
HashPartitioner (Partitioner *parent) | |
ErrorStack | design_partition (const Partitioner::DesignPartitionArguments &args) |
void | design_partition_task (uint16_t task) |
bool | is_partitionable () const |
void | partition_batch (const Partitioner::PartitionBatchArguments &args) const |
void | sort_batch (const Partitioner::SortBatchArguments &args) const |
const PartitionId * | get_bucket_owners () const |
Friends | |
std::ostream & | operator<< (std::ostream &o, const HashPartitioner &v) |
|
explicit |
Definition at line 43 of file hash_partitioner_impl.cpp.
References ASSERT_ND, foedus::soc::SharedMutex::is_initialized(), foedus::storage::PartitionerMetadata::locate_data(), foedus::storage::PartitionerMetadata::mutex_, and foedus::storage::PartitionerMetadata::valid_.
ErrorStack foedus::storage::hash::HashPartitioner::design_partition | ( | const Partitioner::DesignPartitionArguments & | args | ) |
Definition at line 68 of file hash_partitioner_impl.cpp.
References foedus::storage::PartitionerMetadata::allocate_data(), ASSERT_ND, design_partition_task(), foedus::storage::hash::design_partition_thread(), foedus::storage::Storage< CONTROL_BLOCK >::exists(), foedus::storage::hash::HashStorage::get_bin_bits(), foedus::storage::hash::HashStorage::get_bin_count(), foedus::storage::hash::HashStorage::get_bin_shifts(), foedus::Attachable< CONTROL_BLOCK >::get_control_block(), foedus::storage::hash::HashStorage::get_levels(), foedus::Engine::get_soc_count(), foedus::soc::SharedMutex::is_initialized(), foedus::storage::hash::kHashIntermediatePageFanout, foedus::storage::hash::kHashMaxBins, foedus::kRetOk, foedus::storage::hash::HashPartitionerData::levels_, foedus::storage::PartitionerMetadata::locate_data(), foedus::storage::PartitionerMetadata::mutex_, foedus::storage::hash::HashPartitionerData::object_size(), foedus::storage::PartitionerMetadata::valid_, and WRAP_ERROR_CODE.
Referenced by foedus::storage::Partitioner::design_partition().
void foedus::storage::hash::HashPartitioner::design_partition_task | ( | uint16_t | task | ) |
Definition at line 128 of file hash_partitioner_impl.cpp.
References ASSERT_ND, foedus::storage::hash::HashPartitionerData::bin_owners_, foedus::Attachable< CONTROL_BLOCK >::get_control_block(), foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::storage::hash::HashIntermediatePage::get_level(), foedus::storage::hash::HashStorage::get_levels(), foedus::Engine::get_memory_manager(), foedus::storage::VolatilePagePointer::get_numa_node(), foedus::storage::hash::HashIntermediatePage::get_pointer(), foedus::storage::VolatilePagePointer::is_null(), foedus::storage::hash::kHashMaxBins, foedus::storage::hash::HashPartitionerData::partitionable_, foedus::memory::GlobalVolatilePageResolver::resolve_offset(), foedus::storage::hash::HashStorageControlBlock::root_page_pointer_, and foedus::storage::DualPagePointer::volatile_pointer_.
Referenced by design_partition(), and foedus::storage::hash::design_partition_thread().
const PartitionId * foedus::storage::hash::HashPartitioner::get_bucket_owners | ( | ) | const |
Definition at line 55 of file hash_partitioner_impl.cpp.
References ASSERT_ND, and foedus::storage::hash::HashPartitionerData::bin_owners_.
bool foedus::storage::hash::HashPartitioner::is_partitionable | ( | ) | const |
Definition at line 59 of file hash_partitioner_impl.cpp.
References ASSERT_ND, and foedus::storage::hash::HashPartitionerData::partitionable_.
Referenced by foedus::storage::Partitioner::is_partitionable(), and partition_batch().
void foedus::storage::hash::HashPartitioner::partition_batch | ( | const Partitioner::PartitionBatchArguments & | args | ) | const |
Definition at line 184 of file hash_partitioner_impl.cpp.
References ASSERT_ND, foedus::storage::hash::HashCommonLogType::assert_type(), foedus::storage::hash::HashPartitionerData::bin_owners_, foedus::storage::hash::HashStorage::get_bin_count(), foedus::storage::hash::HashStorage::get_bin_shifts(), foedus::storage::hash::HashCommonLogType::hash_, foedus::log::BaseLogType::header_, is_partitionable(), foedus::storage::Partitioner::PartitionBatchArguments::log_buffer_, foedus::storage::Partitioner::PartitionBatchArguments::log_positions_, foedus::storage::Partitioner::PartitionBatchArguments::logs_count_, foedus::snapshot::LogBuffer::resolve(), foedus::storage::Partitioner::PartitionBatchArguments::results_, and foedus::log::LogHeader::storage_id_.
Referenced by foedus::storage::Partitioner::partition_batch().
void foedus::storage::hash::HashPartitioner::sort_batch | ( | const Partitioner::SortBatchArguments & | args | ) | const |
Definition at line 329 of file hash_partitioner_impl.cpp.
References ASSERT_ND, foedus::memory::AlignedMemory::assure_capacity(), foedus::storage::hash::HashPartitionerData::bin_shifts_, foedus::storage::hash::compact_logs(), foedus::debugging::StopWatch::elapsed_ms(), foedus::memory::AlignedMemory::get_block(), foedus::storage::Partitioner::SortBatchArguments::logs_count_, foedus::storage::hash::prepare_sort_entries(), foedus::debugging::StopWatch::stop(), foedus::storage::Partitioner::SortBatchArguments::work_memory_, and foedus::storage::Partitioner::SortBatchArguments::written_count_.
Referenced by foedus::storage::Partitioner::sort_batch().
|
friend |
Definition at line 364 of file hash_partitioner_impl.cpp.