libfoedus-core
FOEDUS Core Library
snapshot_metadata.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_METADATA_HPP_
19 #define FOEDUS_SNAPSHOT_SNAPSHOT_METADATA_HPP_
20 #include <vector>
21 
22 #include "foedus/cxx11.hpp"
23 #include "foedus/epoch.hpp"
27 #include "foedus/storage/fwd.hpp"
30 
31 namespace foedus {
32 namespace snapshot {
33 
45  void clear();
47  return &storage_control_blocks_[id].meta_;
48  }
49 
50  ErrorStack load(tinyxml2::XMLElement* element) CXX11_OVERRIDE;
51  ErrorStack save(tinyxml2::XMLElement* element) const CXX11_OVERRIDE;
52  const char* get_tag_name() const CXX11_OVERRIDE { return "SnapshotMetadata"; }
54 
57 
60 
63 
66 
73 
76 };
77 } // namespace snapshot
78 } // namespace foedus
79 #endif // FOEDUS_SNAPSHOT_SNAPSHOT_METADATA_HPP_
const char * get_tag_name() const override
Returns an XML tag name for this object as a root element.
Represents the data in one snapshot metadata file.
storage::StorageControlBlock * storage_control_blocks_
control block of all storages.
ErrorStack save(tinyxml2::XMLElement *element) const override
Writes the content of this object to the given XML element.
Metadata meta_
common part of the metadata.
Definition: storage.hpp:84
Definitions of IDs in this package and a few related constant values.
Represents an object that can be written to and read from files/bytes in XML format.
Typedefs of ID types used in snapshot package.
Epoch::EpochInteger valid_until_epoch_
Equivalent to Snapshot::valid_until_epoch_.
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
uint32_t EpochInteger
Unsigned integer representation of epoch.
Definition: epoch.hpp:64
Brings error stacktrace information as return value of functions.
Definition: error_stack.hpp:81
ErrorStack load(tinyxml2::XMLElement *element) override
Reads the content of this object from the given XML element.
Metadata of one storage.
Definition: metadata.hpp:58
Forward declarations of classes in storage package.
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
Definition: cxx11.hpp:131
memory::AlignedMemory storage_control_blocks_memory_
Memory backing storage_control_blocks_.
SnapshotId id_
Equivalent to Snapshot::id_.
uint16_t SnapshotId
Unique ID of Snapshot.
Definition: snapshot_id.hpp:43
#define CXX11_OVERRIDE
Used in public headers in place of "override" of C++11.
Definition: cxx11.hpp:134
Represents one memory block aligned to actual OS/hardware pages.
storage::Metadata * get_metadata(storage::StorageId id)
Epoch::EpochInteger base_epoch_
Equivalent to Snapshot::base_epoch_.
void assign(const foedus::externalize::Externalizable *other) override
Polymorphic assign operator.
A base layout of shared data for all storage types.
Definition: storage.hpp:53
storage::StorageId largest_storage_id_
The largest StorageId we so far observed.