#include <RangeServerConnection.h>
Public Member Functions | |
RangeServerConnection (const String &location, const String &hostname, InetAddr public_addr) | |
RangeServerConnection (const MetaLog::EntityHeader &header_) | |
virtual | ~RangeServerConnection () |
bool | connect (const String &hostname, InetAddr local_addr, InetAddr public_addr) |
bool | disconnect () |
bool | connected () |
void | set_removed () |
bool | get_removed () |
bool | set_balanced () |
bool | get_balanced () |
void | set_disk_fill_percentage (double percentage) |
double | get_disk_fill_percentage () |
void | set_recovering (bool b) |
bool | is_recovering () |
void | set_hyperspace_handle (uint64_t handle, RangeServerHyperspaceCallback *cb) |
bool | get_hyperspace_handle (uint64_t *handle, RangeServerHyperspaceCallback **cb) |
CommAddress | get_comm_address () |
const String & | location () const |
const String & | hostname () const |
InetAddr | local_addr () const |
InetAddr | public_addr () const |
const std::string | to_str () |
const String | name () override |
Returns the name of the entity. More... | |
void | display (std::ostream &os) override |
Prints a textual representation of the entity state to an ostream. More... | |
void | decode (const uint8_t **bufp, size_t *remainp, uint16_t definition_version) override |
Decodes serialized RangeServerConnection object. 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_old (const uint8_t **bufp, size_t *remainp) |
Private Attributes | |
uint64_t | m_handle {} |
RangeServerHyperspaceCallback * | m_hyperspace_callback |
String | m_location |
String | m_hostname |
int32_t | m_state {} |
CommAddress | m_comm_addr |
InetAddr | m_local_addr |
InetAddr | m_public_addr |
double | m_disk_fill_percentage {} |
bool | m_connected {} |
bool | m_recovering {} |
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... | |
Definition at line 43 of file RangeServerConnection.h.
RangeServerConnection::RangeServerConnection | ( | const String & | location, |
const String & | hostname, | ||
InetAddr | public_addr | ||
) |
Definition at line 31 of file RangeServerConnection.cc.
RangeServerConnection::RangeServerConnection | ( | const MetaLog::EntityHeader & | header_ | ) |
Definition at line 42 of file RangeServerConnection.cc.
|
inlinevirtual |
Definition at line 48 of file RangeServerConnection.h.
bool RangeServerConnection::connect | ( | const String & | hostname, |
InetAddr | local_addr, | ||
InetAddr | public_addr | ||
) |
update the mml if the hostname or IP changed if (hostname != m_hostname || public_addr != m_public_addr) { needs_persisting = true; }
Definition at line 49 of file RangeServerConnection.cc.
bool RangeServerConnection::connected | ( | ) |
Definition at line 79 of file RangeServerConnection.cc.
|
overridevirtual |
Decodes serialized RangeServerConnection object.
bufp | Address of source buffer pointer (advanced by call) |
remainp | Amount of remaining buffer pointed to by *bufp (decremented by call). |
definition_version | Version of DefinitionMaster |
Reimplemented from Hypertable::MetaLog::Entity.
Definition at line 193 of file RangeServerConnection.cc.
|
overrideprivatevirtual |
Reads serialized representation of object from a buffer.
This function is to be overridden by derived classes and should decode the object per-se as encoded with encode_internal().
version | Encoding version |
bufp | Address of destination buffer pointer (advanced by call) |
remainp | Address of integer holding amount of serialized encoding remaining |
Implements Hypertable::Serializable.
Definition at line 222 of file RangeServerConnection.cc.
|
private |
Definition at line 231 of file RangeServerConnection.cc.
bool RangeServerConnection::disconnect | ( | ) |
Definition at line 69 of file RangeServerConnection.cc.
|
overridevirtual |
Prints a textual representation of the entity state to an ostream.
os | ostream on which to print entity state |
Reimplemented from Hypertable::MetaLog::Entity.
Definition at line 173 of file RangeServerConnection.cc.
|
overrideprivatevirtual |
Writes serialized representation of object to a buffer.
This function is to be overridden by derived classes and should encode the object per-se.
bufp | Address of destination buffer pointer (advanced by call) |
Implements Hypertable::Serializable.
Definition at line 215 of file RangeServerConnection.cc.
|
overrideprivatevirtual |
Returns internal serialized length.
This function is to be overridden by derived classes and should return the length of the the serialized object per-se.
Implements Hypertable::Serializable.
Definition at line 209 of file RangeServerConnection.cc.
|
overrideprivatevirtual |
Returns encoding version.
Implements Hypertable::Serializable.
Definition at line 205 of file RangeServerConnection.cc.
bool RangeServerConnection::get_balanced | ( | ) |
Definition at line 106 of file RangeServerConnection.cc.
CommAddress RangeServerConnection::get_comm_address | ( | ) |
Definition at line 139 of file RangeServerConnection.cc.
|
inline |
Definition at line 62 of file RangeServerConnection.h.
bool RangeServerConnection::get_hyperspace_handle | ( | uint64_t * | handle, |
RangeServerHyperspaceCallback ** | cb | ||
) |
Definition at line 128 of file RangeServerConnection.cc.
bool RangeServerConnection::get_removed | ( | ) |
Definition at line 93 of file RangeServerConnection.cc.
|
inline |
Definition at line 73 of file RangeServerConnection.h.
bool RangeServerConnection::is_recovering | ( | ) |
Definition at line 111 of file RangeServerConnection.cc.
|
inline |
Definition at line 74 of file RangeServerConnection.h.
|
inline |
Definition at line 72 of file RangeServerConnection.h.
|
inlineoverridevirtual |
Returns the name of the entity.
This method returns the name of the entity which is used by tools that convert a MetaLog into a human readable representation
Implements Hypertable::MetaLog::Entity.
Definition at line 79 of file RangeServerConnection.h.
|
inline |
Definition at line 75 of file RangeServerConnection.h.
bool RangeServerConnection::set_balanced | ( | ) |
Definition at line 98 of file RangeServerConnection.cc.
|
inline |
Definition at line 59 of file RangeServerConnection.h.
void RangeServerConnection::set_hyperspace_handle | ( | uint64_t | handle, |
RangeServerHyperspaceCallback * | cb | ||
) |
Definition at line 121 of file RangeServerConnection.cc.
void RangeServerConnection::set_recovering | ( | bool | b | ) |
Definition at line 116 of file RangeServerConnection.cc.
void RangeServerConnection::set_removed | ( | ) |
Definition at line 85 of file RangeServerConnection.cc.
const string RangeServerConnection::to_str | ( | ) |
Definition at line 144 of file RangeServerConnection.cc.
|
private |
Definition at line 109 of file RangeServerConnection.h.
|
private |
Definition at line 113 of file RangeServerConnection.h.
|
private |
Definition at line 112 of file RangeServerConnection.h.
|
private |
Definition at line 104 of file RangeServerConnection.h.
|
private |
Definition at line 107 of file RangeServerConnection.h.
|
private |
Definition at line 105 of file RangeServerConnection.h.
|
private |
Definition at line 110 of file RangeServerConnection.h.
|
private |
Definition at line 106 of file RangeServerConnection.h.
|
private |
Definition at line 111 of file RangeServerConnection.h.
|
private |
Definition at line 114 of file RangeServerConnection.h.
|
private |
Definition at line 108 of file RangeServerConnection.h.