libfoedus-core
FOEDUS Core Library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
foedus::snapshot::LogGleanerRef Class Reference

A remote view of LogGleaner from all engines. More...

Detailed Description

A remote view of LogGleaner from all engines.

Definition at line 36 of file log_gleaner_ref.hpp.

#include <log_gleaner_ref.hpp>

Inheritance diagram for foedus::snapshot::LogGleanerRef:
Collaboration diagram for foedus::snapshot::LogGleanerRef:

Public Member Functions

 LogGleanerRef ()
 
 LogGleanerRef (Engine *engine)
 
bool is_error () const
 
void wakeup ()
 
const Snapshotget_cur_snapshot () const
 
SnapshotId get_snapshot_id () const
 
Epoch get_base_epoch () const
 
Epoch get_valid_until_epoch () const
 
uint16_t increment_completed_count ()
 
uint16_t increment_completed_mapper_count ()
 
uint16_t increment_error_count ()
 
uint16_t increment_exit_count ()
 
bool is_all_exitted () const
 
bool is_all_completed () const
 
bool is_all_mappers_completed () const
 
uint16_t get_mappers_count () const
 
uint16_t get_reducers_count () const
 
uint16_t get_all_count () const
 
- Public Member Functions inherited from foedus::Attachable< LogGleanerControlBlock >
 Attachable ()
 
 Attachable (Engine *engine)
 
 Attachable (Engine *engine, LogGleanerControlBlock *control_block)
 
 Attachable (LogGleanerControlBlock *control_block)
 
 Attachable (const Attachable &other)
 
virtual ~Attachable ()
 
Attachableoperator= (const Attachable &other)
 
virtual void attach (LogGleanerControlBlock *control_block)
 Attaches to the given shared memory. More...
 
bool is_attached () const
 Returns whether the object has been already attached to some shared memory. More...
 
LogGleanerControlBlock * get_control_block () const
 
Engineget_engine () const
 
void set_engine (Engine *engine)
 

Protected Attributes

storage::PartitionerMetadatapartitioner_metadata_
 
void * partitioner_data_
 
- Protected Attributes inherited from foedus::Attachable< LogGleanerControlBlock >
Engineengine_
 Most attachable object stores an engine pointer (local engine), so we define it here. More...
 
LogGleanerControlBlock * control_block_
 The shared data on shared memory that has been initialized in some SOC or master engine. More...
 

Constructor & Destructor Documentation

foedus::snapshot::LogGleanerRef::LogGleanerRef ( )

Definition at line 26 of file log_gleaner_ref.cpp.

References partitioner_data_, and partitioner_metadata_.

26  : Attachable<LogGleanerControlBlock>() {
27  partitioner_metadata_ = nullptr;
28  partitioner_data_ = nullptr;
29 }
storage::PartitionerMetadata * partitioner_metadata_
foedus::snapshot::LogGleanerRef::LogGleanerRef ( Engine engine)
explicit

Definition at line 30 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_, foedus::Attachable< LogGleanerControlBlock >::engine_, foedus::soc::SharedMemoryRepo::get_global_memory_anchors(), foedus::soc::SocManager::get_shared_memory_repo(), foedus::Engine::get_soc_manager(), foedus::snapshot::SnapshotManagerControlBlock::gleaner_, partitioner_data_, foedus::soc::GlobalMemoryAnchors::partitioner_data_, partitioner_metadata_, foedus::soc::GlobalMemoryAnchors::partitioner_metadata_, and foedus::soc::GlobalMemoryAnchors::snapshot_manager_memory_.

31  : Attachable<LogGleanerControlBlock>() {
32  engine_ = engine;
33  soc::GlobalMemoryAnchors* anchors
35  control_block_ = &anchors->snapshot_manager_memory_->gleaner_;
36  partitioner_metadata_ = anchors->partitioner_metadata_;
37  partitioner_data_ = anchors->partitioner_data_;
38 }
storage::PartitionerMetadata * partitioner_metadata_
GlobalMemoryAnchors * get_global_memory_anchors()
Engine * engine_
Most attachable object stores an engine pointer (local engine), so we define it here.
Definition: attachable.hpp:107
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
soc::SocManager * get_soc_manager() const
See SOC and IPC.
Definition: engine.cpp:59
SharedMemoryRepo * get_shared_memory_repo()
Returns the shared memories maintained across SOCs.
Definition: soc_manager.cpp:38

Here is the call graph for this function:

Member Function Documentation

uint16_t foedus::snapshot::LogGleanerRef::get_all_count ( ) const

Definition at line 69 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_.

69 { return control_block_->all_count_; }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
Epoch foedus::snapshot::LogGleanerRef::get_base_epoch ( ) const

Definition at line 77 of file log_gleaner_ref.cpp.

References foedus::snapshot::Snapshot::base_epoch_, and get_cur_snapshot().

Referenced by foedus::snapshot::LogMapper::handle_process().

77 { return get_cur_snapshot().base_epoch_; }
Epoch base_epoch_
This snapshot was taken on top of previous snapshot that is valid_until this epoch.
Definition: snapshot.hpp:49
const Snapshot & get_cur_snapshot() const

Here is the call graph for this function:

Here is the caller graph for this function:

const Snapshot & foedus::snapshot::LogGleanerRef::get_cur_snapshot ( ) const

Definition at line 75 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_.

Referenced by get_base_epoch(), get_snapshot_id(), and get_valid_until_epoch().

75 { return control_block_->cur_snapshot_; }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111

Here is the caller graph for this function:

uint16_t foedus::snapshot::LogGleanerRef::get_mappers_count ( ) const

Definition at line 67 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_.

67 { return control_block_->mappers_count_; }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
uint16_t foedus::snapshot::LogGleanerRef::get_reducers_count ( ) const

Definition at line 68 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_.

68 { return control_block_->reducers_count_; }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
SnapshotId foedus::snapshot::LogGleanerRef::get_snapshot_id ( ) const

Definition at line 76 of file log_gleaner_ref.cpp.

References get_cur_snapshot(), and foedus::snapshot::Snapshot::id_.

Referenced by foedus::snapshot::LogGleaner::execute().

76 { return get_cur_snapshot().id_; }
SnapshotId id_
Unique ID of this snapshot.
Definition: snapshot.hpp:43
const Snapshot & get_cur_snapshot() const

Here is the call graph for this function:

Here is the caller graph for this function:

Epoch foedus::snapshot::LogGleanerRef::get_valid_until_epoch ( ) const

Definition at line 78 of file log_gleaner_ref.cpp.

References get_cur_snapshot(), and foedus::snapshot::Snapshot::valid_until_epoch_.

Referenced by foedus::snapshot::LogMapper::handle_process().

Epoch valid_until_epoch_
This snapshot contains all the logs until this epoch.
Definition: snapshot.hpp:55
const Snapshot & get_cur_snapshot() const

Here is the call graph for this function:

Here is the caller graph for this function:

uint16_t foedus::snapshot::LogGleanerRef::increment_completed_count ( )

Definition at line 40 of file log_gleaner_ref.cpp.

References ASSERT_ND, and foedus::Attachable< LogGleanerControlBlock >::control_block_.

40  {
41  ASSERT_ND(control_block_->completed_count_ < control_block_->all_count_);
42  return ++control_block_->completed_count_;
43 }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
#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
uint16_t foedus::snapshot::LogGleanerRef::increment_completed_mapper_count ( )

Definition at line 44 of file log_gleaner_ref.cpp.

References ASSERT_ND, and foedus::Attachable< LogGleanerControlBlock >::control_block_.

44  {
45  ASSERT_ND(control_block_->completed_mapper_count_ < control_block_->mappers_count_);
46  return ++control_block_->completed_mapper_count_;
47 }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
#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
uint16_t foedus::snapshot::LogGleanerRef::increment_error_count ( )

Definition at line 48 of file log_gleaner_ref.cpp.

References ASSERT_ND, and foedus::Attachable< LogGleanerControlBlock >::control_block_.

48  {
49  ASSERT_ND(control_block_->error_count_ < control_block_->all_count_);
50  return ++control_block_->error_count_;
51 }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
#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
uint16_t foedus::snapshot::LogGleanerRef::increment_exit_count ( )

Definition at line 52 of file log_gleaner_ref.cpp.

References ASSERT_ND, and foedus::Attachable< LogGleanerControlBlock >::control_block_.

52  {
53  ASSERT_ND(control_block_->exit_count_ < control_block_->all_count_);
54  return ++control_block_->exit_count_;
55 }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
#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
bool foedus::snapshot::LogGleanerRef::is_all_completed ( ) const

Definition at line 61 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_.

Referenced by foedus::snapshot::LogGleaner::execute().

61  {
62  return control_block_->completed_count_ >= control_block_->all_count_;
63 }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111

Here is the caller graph for this function:

bool foedus::snapshot::LogGleanerRef::is_all_exitted ( ) const

Definition at line 57 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_.

Referenced by foedus::snapshot::LogGleaner::execute().

57  {
58  return control_block_->exit_count_ >= control_block_->all_count_;
59 }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111

Here is the caller graph for this function:

bool foedus::snapshot::LogGleanerRef::is_all_mappers_completed ( ) const

Definition at line 64 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_.

Referenced by foedus::snapshot::LogReducer::handle_process().

64  {
65  return control_block_->completed_mapper_count_ >= control_block_->mappers_count_;
66 }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111

Here is the caller graph for this function:

bool foedus::snapshot::LogGleanerRef::is_error ( ) const

Definition at line 71 of file log_gleaner_ref.cpp.

References foedus::Attachable< LogGleanerControlBlock >::control_block_.

Referenced by foedus::snapshot::MapReduceBase::check_cancelled(), and foedus::snapshot::LogGleaner::execute().

71 { return control_block_->is_error(); }
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111

Here is the caller graph for this function:

void foedus::snapshot::LogGleanerRef::wakeup ( )

Definition at line 72 of file log_gleaner_ref.cpp.

72  {
73 }

Member Data Documentation

void* foedus::snapshot::LogGleanerRef::partitioner_data_
protected

Definition at line 63 of file log_gleaner_ref.hpp.

Referenced by LogGleanerRef().

storage::PartitionerMetadata* foedus::snapshot::LogGleanerRef::partitioner_metadata_
protected

Definition at line 62 of file log_gleaner_ref.hpp.

Referenced by LogGleanerRef().


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