ClusterMetadataDynamicState represents a dynamic state that the metadata cache module wants to persist in the file.
More...
#include <cluster_metadata_dynamic_state.h>
ClusterMetadataDynamicState represents a dynamic state that the metadata cache module wants to persist in the file.
◆ ClusterMetadataDynamicState()
Creates and initializes a metadata cache dynamic state object.
- Parameters
-
base_config | pointer to the global dynamic state base object that should be used to read and write metadata cache section. |
cluster_type | type of the cluster (GR or ReplicaSet) |
◆ ~ClusterMetadataDynamicState()
ClusterMetadataDynamicState::~ClusterMetadataDynamicState |
( |
| ) |
|
|
virtualdefault |
◆ get_cluster_type_specific_id()
std::string ClusterMetadataDynamicState::get_cluster_type_specific_id |
( |
| ) |
const |
Reads the current cluster type specific id from the state object.
- Returns
- current cluster type specific id
◆ get_clusterset_id()
std::string ClusterMetadataDynamicState::get_clusterset_id |
( |
| ) |
const |
Reads the current ClusterSet id from the state object.
- Returns
- current cluster type specific id
◆ get_metadata_servers()
std::vector< std::string > ClusterMetadataDynamicState::get_metadata_servers |
( |
| ) |
const |
Reads the current cluster metadata server list from the state object.
- Returns
- vector containing current cluster metadata server list
◆ get_view_id()
unsigned ClusterMetadataDynamicState::get_view_id |
( |
| ) |
const |
Reads the current value of the last known metadata view_id of the ReplicaSet cluster or ClusterSet from the state object.
- Returns
- last known metadata view_id of the ReplicaSet cluster
◆ is_clusterset()
bool ClusterMetadataDynamicState::is_clusterset |
( |
| ) |
const |
Returns true if the metadata is configured to work with a ClusterSet, false if a single Cluster.
◆ load()
void ClusterMetadataDynamicState::load |
( |
| ) |
|
Loads the dynamic state from the associated global base object, overwrites the current state with the loaded data.
◆ save() [1/2]
bool ClusterMetadataDynamicState::save |
( |
| ) |
|
Saves the current state in the associated global base object, overwrites the current state in the global.
- Returns
- success of operation
- Return values
-
true | operation succeeded |
false | operation failed |
◆ save() [2/2]
bool ClusterMetadataDynamicState::save |
( |
std::ostream & |
state_stream | ) |
|
Saves the state to the output stream given as a parameter, overwrites the stream content.
- Parameters
-
state_stream | stream where json content should be written to |
- Returns
- success of operation
- Return values
-
true | operation succeeded |
false | operation failed |
◆ save_section()
void ClusterMetadataDynamicState::save_section |
( |
| ) |
|
|
private |
◆ set_cluster_type_specific_id()
void ClusterMetadataDynamicState::set_cluster_type_specific_id |
( |
const std::string & |
cluster_type_specific_id | ) |
|
Sets the new value for the cluster type specific id in the state object.
- Parameters
-
cluster_type_specific_id | new value of the cluster type specific id to set |
◆ set_clusterset_id()
void ClusterMetadataDynamicState::set_clusterset_id |
( |
const std::string & |
clusterset_id | ) |
|
Sets the new value for the ClusterSet id in the state object.
- Parameters
-
clusterset_id | new value of the ClusterSet id to set |
◆ set_metadata_servers()
void ClusterMetadataDynamicState::set_metadata_servers |
( |
const std::vector< std::string > & |
metadata_servers | ) |
|
Sets the new value for the cluster metadata server list in the state object.
- Parameters
-
metadata_servers | vector of the new metadata servers to set |
◆ set_view_id()
void ClusterMetadataDynamicState::set_view_id |
( |
const uint64_t |
view_id | ) |
|
Sets the new value for the last known metadata view_id of the ReplicaSet cluster or ClusterSet.
- Parameters
-
view_id | last known metadata view_id of the ReplicaSet cluster |
◆ changed_
bool ClusterMetadataDynamicState::changed_ {false} |
|
private |
◆ cluster_type_
◆ cluster_type_specific_id_
std::string ClusterMetadataDynamicState::cluster_type_specific_id_ |
|
private |
◆ clusterset_id_
std::string ClusterMetadataDynamicState::clusterset_id_ |
|
private |
◆ metadata_servers_
std::vector<std::string> ClusterMetadataDynamicState::metadata_servers_ |
|
private |
◆ pimpl_
std::unique_ptr<Pimpl> ClusterMetadataDynamicState::pimpl_ |
|
private |
◆ view_id_
uint64_t ClusterMetadataDynamicState::view_id_ {0} |
|
private |
The documentation for this class was generated from the following files: