libfoedus-core
FOEDUS Core Library
snapshot.hpp
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  */
18 #ifndef FOEDUS_SNAPSHOT_SNAPSHOT_HPP_
19 #define FOEDUS_SNAPSHOT_SNAPSHOT_HPP_
20 
21 #include <iosfwd>
22 
23 #include "foedus/epoch.hpp"
26 
27 namespace foedus {
28 namespace snapshot {
29 
37 struct Snapshot {
44 
50 
56 
59 
60  friend std::ostream& operator<<(std::ostream& o, const Snapshot& v);
61  void clear() {
62  id_ = 0;
63  base_epoch_ = INVALID_EPOCH;
64  valid_until_epoch_ = INVALID_EPOCH;
65  max_storage_id_ = 0;
66  }
67 };
68 } // namespace snapshot
69 } // namespace foedus
70 #endif // FOEDUS_SNAPSHOT_SNAPSHOT_HPP_
Definitions of IDs in this package and a few related constant values.
Typedefs of ID types used in snapshot package.
uint32_t StorageId
Unique ID for storage.
Definition: storage_id.hpp:55
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
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
friend std::ostream & operator<<(std::ostream &o, const Snapshot &v)
Definition: snapshot.cpp:24
storage::StorageId max_storage_id_
Largest storage ID as of starting to take the snapshot.
Definition: snapshot.hpp:58
SnapshotId id_
Unique ID of this snapshot.
Definition: snapshot.hpp:43
Represents one snapshot that converts all logs from base epoch to valid_until epoch into snapshot fil...
Definition: snapshot.hpp:37
uint16_t SnapshotId
Unique ID of Snapshot.
Definition: snapshot_id.hpp:43
Epoch base_epoch_
This snapshot was taken on top of previous snapshot that is valid_until this epoch.
Definition: snapshot.hpp:49
const Epoch INVALID_EPOCH
A constant epoch object that represents an invalid epoch.
Definition: epoch.hpp:204