Set of recovered servers. More...
#include <RecoveredServers.h>
Public Member Functions | |
RecoveredServers () | |
Default constructor. More... | |
RecoveredServers (const MetaLog::EntityHeader &header) | |
Constructor with MetaLog header. More... | |
virtual | ~RecoveredServers () |
Destructor. More... | |
void | add (const std::string &location) |
Adds proxy name to recovered servers set. More... | |
bool | contains (const std::string &location) |
Check to see if proxy name is in recovered servers set. More... | |
Public Member Functions inherited from Hypertable::MetaLog::Entity | |
Entity (int32_t type) | |
Constructor from entity type. More... | |
Entity (const EntityHeader &header_) | |
Constructor from entity header. More... | |
virtual | ~Entity () |
Destructor. More... | |
void | lock () |
Locks the entity's mutex. More... | |
void | unlock () |
Unlocks the entity's mutex. More... | |
void | mark_for_removal () |
Marks entity for removal. More... | |
bool | marked_for_removal () |
Checks if entity is marked for removal. More... | |
int64_t | id () const |
Returns the entity ID. More... | |
Public Member Functions inherited from Hypertable::Serializable | |
virtual size_t | encoded_length () const |
Returns serialized object length. More... | |
virtual void | encode (uint8_t **bufp) const |
Writes serialized representation of object to a buffer. More... | |
virtual void | decode (const uint8_t **bufp, size_t *remainp) |
Reads serialized representation of object from a buffer. More... | |
Private Member Functions | |
uint8_t | encoding_version () const override |
Returns encoding version. More... | |
size_t | encoded_length_internal () const override |
Returns internal serialized length. More... | |
void | encode_internal (uint8_t **bufp) const override |
Writes serialized representation of object to a buffer. More... | |
void | decode_internal (uint8_t version, const uint8_t **bufp, size_t *remainp) override |
Reads serialized representation of object from a buffer. More... | |
void | decode (const uint8_t **bufp, size_t *remainp, uint16_t definition_version) override |
MetaLog entity decode method. More... | |
const std::string | name () override |
Returns the name of the entity (RecoveredServers). More... | |
void | display (std::ostream &os) override |
Writes a textual representation of the entity to an output stream. More... | |
Private Attributes | |
std::set< std::string > | m_servers |
Set of proxy names of recovered servers. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Hypertable::MetaLog::Entity | |
void | encode_entry (uint8_t **bufp) |
Encodes entity header plus serialized state. More... | |
Protected Attributes inherited from Hypertable::MetaLog::Entity | |
std::mutex | m_mutex |
Mutex for serializing access to members More... | |
EntityHeader | header |
Entity header More... | |
Set of recovered servers.
This class maintains the set of proxy names of servers that have been recovered. It is used to ensure that a server does not inadvertently get recovered twice.
Definition at line 44 of file RecoveredServers.h.
RecoveredServers::RecoveredServers | ( | ) |
Default constructor.
This constructor constructs an empty object.
Definition at line 38 of file RecoveredServers.cc.
RecoveredServers::RecoveredServers | ( | const MetaLog::EntityHeader & | header | ) |
Constructor with MetaLog header.
This constructor constructs an empty object to be populated by an MML entity.
header | MML entity header |
Definition at line 42 of file RecoveredServers.cc.
|
inlinevirtual |
Destructor.
Definition at line 58 of file RecoveredServers.h.
void RecoveredServers::add | ( | const std::string & | location | ) |
Adds proxy name to recovered servers set.
location | Proxy name of recovered server |
Definition at line 46 of file RecoveredServers.cc.
bool RecoveredServers::contains | ( | const std::string & | location | ) |
Check to see if proxy name is in recovered servers set.
location | Proxy name of server to check |
location
is in the recovered servers set, false otherwise. Definition at line 51 of file RecoveredServers.cc.
|
overrideprivatevirtual |
MetaLog entity decode method.
Reimplemented from Hypertable::MetaLog::Entity.
Definition at line 80 of file RecoveredServers.cc.
|
overrideprivatevirtual |
Reads serialized representation of object from a buffer.
version | Encoding version |
bufp | Address of destination buffer pointer (advanced by call) |
remainp | Address of integer holding amount of serialized object remaining |
Implements Hypertable::Serializable.
Definition at line 73 of file RecoveredServers.cc.
|
overrideprivatevirtual |
Writes a textual representation of the entity to an output stream.
os | Output stream |
Reimplemented from Hypertable::MetaLog::Entity.
Definition at line 89 of file RecoveredServers.cc.
|
overrideprivatevirtual |
Writes serialized representation of object to a buffer.
bufp | Address of destination buffer pointer (advanced by call) |
Implements Hypertable::Serializable.
Definition at line 67 of file RecoveredServers.cc.
|
overrideprivatevirtual |
Returns internal serialized length.
Implements Hypertable::Serializable.
Definition at line 60 of file RecoveredServers.cc.
|
overrideprivatevirtual |
Returns encoding version.
Implements Hypertable::Serializable.
Definition at line 56 of file RecoveredServers.cc.
|
overrideprivatevirtual |
Returns the name of the entity (RecoveredServers).
Implements Hypertable::MetaLog::Entity.
Definition at line 85 of file RecoveredServers.cc.
|
private |
Set of proxy names of recovered servers.
Definition at line 107 of file RecoveredServers.h.