libfoedus-core
FOEDUS Core Library
log_gleaner_ref.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015, Hewlett-Packard Development Company, LP.
3  * This program is free software; you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by the Free
5  * Software Foundation; either version 2 of the License, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details. You should have received a copy of the GNU General Public
12  * License along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  *
15  * HP designates this particular file as subject to the "Classpath" exception
16  * as provided by HP in the LICENSE.txt file that accompanied this code.
17  */
19 
22 
23 namespace foedus {
24 namespace snapshot {
25 
27  partitioner_metadata_ = nullptr;
28  partitioner_data_ = nullptr;
29 }
32  engine_ = engine;
38 }
39 
41  ASSERT_ND(control_block_->completed_count_ < control_block_->all_count_);
42  return ++control_block_->completed_count_;
43 }
45  ASSERT_ND(control_block_->completed_mapper_count_ < control_block_->mappers_count_);
46  return ++control_block_->completed_mapper_count_;
47 }
49  ASSERT_ND(control_block_->error_count_ < control_block_->all_count_);
50  return ++control_block_->error_count_;
51 }
53  ASSERT_ND(control_block_->exit_count_ < control_block_->all_count_);
54  return ++control_block_->exit_count_;
55 }
56 
58  return control_block_->exit_count_ >= control_block_->all_count_;
59 }
60 
62  return control_block_->completed_count_ >= control_block_->all_count_;
63 }
65  return control_block_->completed_mapper_count_ >= control_block_->mappers_count_;
66 }
67 uint16_t LogGleanerRef::get_mappers_count() const { return control_block_->mappers_count_; }
68 uint16_t LogGleanerRef::get_reducers_count() const { return control_block_->reducers_count_; }
69 uint16_t LogGleanerRef::get_all_count() const { return control_block_->all_count_; }
70 
71 bool LogGleanerRef::is_error() const { return control_block_->is_error(); }
73 }
74 
75 const Snapshot& LogGleanerRef::get_cur_snapshot() const { return control_block_->cur_snapshot_; }
79 
80 
81 } // namespace snapshot
82 } // namespace foedus
storage::PartitionerMetadata * partitioner_metadata_
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
void * partitioner_data_
Data block to place detailed information of partitioners.
GlobalMemoryAnchors * get_global_memory_anchors()
Epoch valid_until_epoch_
This snapshot contains all the logs until this epoch.
Definition: snapshot.hpp:55
Represents a time epoch.
Definition: epoch.hpp:61
Engine * engine_
Most attachable object stores an engine pointer (local engine), so we define it here.
Definition: attachable.hpp:107
LogGleanerControlBlock gleaner_
Gleaner-related variables.
storage::PartitionerMetadata * partitioner_metadata_
Tiny metadata memory for partitioners.
LogGleanerControlBlock * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
Definition: attachable.hpp:111
SnapshotId id_
Unique ID of this snapshot.
Definition: snapshot.hpp:43
SnapshotId get_snapshot_id() const
Database engine object that holds all resources and provides APIs.
Definition: engine.hpp:109
Represents one snapshot that converts all logs from base epoch to valid_until epoch into snapshot fil...
Definition: snapshot.hpp:37
Attachable Resources on Shared Memory.
Definition: attachable.hpp:58
uint16_t SnapshotId
Unique ID of Snapshot.
Definition: snapshot_id.hpp:43
Just a set of pointers within global_memory_ for ease of use.
snapshot::SnapshotManagerControlBlock * snapshot_manager_memory_
Tiny memory for snapshot manager.
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
soc::SocManager * get_soc_manager() const
See SOC and IPC.
Definition: engine.cpp:59
#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
SharedMemoryRepo * get_shared_memory_repo()
Returns the shared memories maintained across SOCs.
Definition: soc_manager.cpp:38