libfoedus-core
FOEDUS Core Library
foedus::storage::sequential::SequentialPartitioner Class Referencefinal

Partitioner for an sequential storage. More...

Detailed Description

Partitioner for an sequential storage.

Partitioning/sorting policy for Sequential Storage is super simple; it does nothing. We put all logs in node-x to snapshot of node-x for the best performance. As the only read access pattern is full-scan, we don't care partitioning. We just minimize the communication cost by this policy. No sorting either.

Note
This is a private implementation-details of Sequential Storage, thus file name ends with _impl. Do not include this header from a client program. There is no case client program needs to access this internal class.

Definition at line 50 of file sequential_partitioner_impl.hpp.

#include <sequential_partitioner_impl.hpp>

Public Member Functions

 SequentialPartitioner (Partitioner *parent)
 
ErrorStack design_partition (const Partitioner::DesignPartitionArguments &args)
 
bool is_partitionable () const
 
void partition_batch (const Partitioner::PartitionBatchArguments &args) const
 
void sort_batch (const Partitioner::SortBatchArguments &args) const
 

Friends

std::ostream & operator<< (std::ostream &o, const SequentialPartitioner &v)
 

Constructor & Destructor Documentation

foedus::storage::sequential::SequentialPartitioner::SequentialPartitioner ( Partitioner parent)
explicit

Definition at line 27 of file sequential_partitioner_impl.cpp.

28  : engine_(parent->get_engine()),
29  id_(parent->get_storage_id()),
30  metadata_(PartitionerMetadata::get_metadata(engine_, id_)) {
31 }
static PartitionerMetadata * get_metadata(Engine *engine, StorageId id)
Returns the shared memory for the given storage ID.
Definition: partitioner.cpp:38

Member Function Documentation

ErrorStack foedus::storage::sequential::SequentialPartitioner::design_partition ( const Partitioner::DesignPartitionArguments args)

Definition at line 33 of file sequential_partitioner_impl.cpp.

References foedus::storage::PartitionerMetadata::data_offset_, foedus::storage::PartitionerMetadata::data_size_, foedus::kRetOk, and foedus::storage::PartitionerMetadata::valid_.

Referenced by foedus::storage::Partitioner::design_partition().

34  {
35  // no data required for SequentialPartitioner
36  metadata_->data_offset_ = 0;
37  metadata_->data_size_ = 0;
38  metadata_->valid_ = true;
39  return kRetOk;
40 }
bool valid_
Whether this partitioner information (metadata+data) has been constructed.
uint32_t data_size_
The size of the partitioner data.
uint32_t data_offset_
Relative offset from the beginning of partitioner data block that points to variable-sized partitione...
const ErrorStack kRetOk
Normal return value for no-error case.

Here is the caller graph for this function:

bool foedus::storage::sequential::SequentialPartitioner::is_partitionable ( ) const
inline

Definition at line 55 of file sequential_partitioner_impl.hpp.

Referenced by foedus::storage::Partitioner::is_partitionable().

55 { return true; }

Here is the caller graph for this function:

void foedus::storage::sequential::SequentialPartitioner::partition_batch ( const Partitioner::PartitionBatchArguments args) const

Definition at line 42 of file sequential_partitioner_impl.cpp.

References foedus::storage::Partitioner::PartitionBatchArguments::local_partition_, foedus::storage::Partitioner::PartitionBatchArguments::logs_count_, and foedus::storage::Partitioner::PartitionBatchArguments::results_.

Referenced by foedus::storage::Partitioner::partition_batch().

43  {
44  // all local
45  for (uint32_t i = 0; i < args.logs_count_; ++i) {
46  args.results_[i] = args.local_partition_;
47  }
48 }

Here is the caller graph for this function:

void foedus::storage::sequential::SequentialPartitioner::sort_batch ( const Partitioner::SortBatchArguments args) const

Definition at line 50 of file sequential_partitioner_impl.cpp.

References foedus::storage::Partitioner::SortBatchArguments::log_positions_, foedus::storage::Partitioner::SortBatchArguments::logs_count_, foedus::storage::Partitioner::SortBatchArguments::output_buffer_, and foedus::storage::Partitioner::SortBatchArguments::written_count_.

Referenced by foedus::storage::Partitioner::sort_batch().

50  {
51  // no sorting needed.
52  std::memcpy(
53  args.output_buffer_,
54  args.log_positions_,
55  sizeof(snapshot::BufferPosition) * args.logs_count_);
56  *args.written_count_ = args.logs_count_;
57 }
uint32_t BufferPosition
Represents a position in some buffer.
Definition: snapshot_id.hpp:72

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const SequentialPartitioner v 
)
friend

Definition at line 60 of file sequential_partitioner_impl.cpp.

60  {
61  o << "<SequentialPartitioner>"
62  << "</SequentialPartitioner>";
63  return o;
64 }

The documentation for this class was generated from the following files: