0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Hypertable::RangeServerConnection Class Reference

#include <RangeServerConnection.h>

Inheritance diagram for Hypertable::RangeServerConnection:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::RangeServerConnection:
Collaboration graph
[legend]

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 Stringlocation () const
 
const Stringhostname () 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 {}
 
RangeServerHyperspaceCallbackm_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...
 

Detailed Description

Definition at line 43 of file RangeServerConnection.h.

Constructor & Destructor Documentation

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.

virtual Hypertable::RangeServerConnection::~RangeServerConnection ( )
inlinevirtual

Definition at line 48 of file RangeServerConnection.h.

Member Function Documentation

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.

void RangeServerConnection::decode ( const uint8_t **  bufp,
size_t *  remainp,
uint16_t  definition_version 
)
overridevirtual

Decodes serialized RangeServerConnection object.

Parameters
bufpAddress of source buffer pointer (advanced by call)
remainpAmount of remaining buffer pointed to by *bufp (decremented by call).
definition_versionVersion of DefinitionMaster

Reimplemented from Hypertable::MetaLog::Entity.

Definition at line 193 of file RangeServerConnection.cc.

void RangeServerConnection::decode_internal ( uint8_t  version,
const uint8_t **  bufp,
size_t *  remainp 
)
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().

Parameters
versionEncoding version
bufpAddress of destination buffer pointer (advanced by call)
remainpAddress of integer holding amount of serialized encoding remaining
See also
encode_internal() for encoding format

Implements Hypertable::Serializable.

Definition at line 222 of file RangeServerConnection.cc.

void RangeServerConnection::decode_old ( const uint8_t **  bufp,
size_t *  remainp 
)
private

Definition at line 231 of file RangeServerConnection.cc.

bool RangeServerConnection::disconnect ( )

Definition at line 69 of file RangeServerConnection.cc.

void RangeServerConnection::display ( std::ostream &  os)
overridevirtual

Prints a textual representation of the entity state to an ostream.

Parameters
osostream on which to print entity state

Reimplemented from Hypertable::MetaLog::Entity.

Definition at line 173 of file RangeServerConnection.cc.

void RangeServerConnection::encode_internal ( uint8_t **  bufp) const
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.

Parameters
bufpAddress of destination buffer pointer (advanced by call)

Implements Hypertable::Serializable.

Definition at line 215 of file RangeServerConnection.cc.

size_t RangeServerConnection::encoded_length_internal ( ) const
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.

Returns
Internal serialized length
See also
encode_internal() for encoding format

Implements Hypertable::Serializable.

Definition at line 209 of file RangeServerConnection.cc.

uint8_t RangeServerConnection::encoding_version ( ) const
overrideprivatevirtual

Returns encoding version.

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.

double Hypertable::RangeServerConnection::get_disk_fill_percentage ( )
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.

const String& Hypertable::RangeServerConnection::hostname ( ) const
inline

Definition at line 73 of file RangeServerConnection.h.

bool RangeServerConnection::is_recovering ( )

Definition at line 111 of file RangeServerConnection.cc.

InetAddr Hypertable::RangeServerConnection::local_addr ( ) const
inline

Definition at line 74 of file RangeServerConnection.h.

const String& Hypertable::RangeServerConnection::location ( ) const
inline

Definition at line 72 of file RangeServerConnection.h.

const String Hypertable::RangeServerConnection::name ( )
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

Returns
Name of the entity

Implements Hypertable::MetaLog::Entity.

Definition at line 79 of file RangeServerConnection.h.

InetAddr Hypertable::RangeServerConnection::public_addr ( ) const
inline

Definition at line 75 of file RangeServerConnection.h.

bool RangeServerConnection::set_balanced ( )

Definition at line 98 of file RangeServerConnection.cc.

void Hypertable::RangeServerConnection::set_disk_fill_percentage ( double  percentage)
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.

Member Data Documentation

CommAddress Hypertable::RangeServerConnection::m_comm_addr
private

Definition at line 109 of file RangeServerConnection.h.

bool Hypertable::RangeServerConnection::m_connected {}
private

Definition at line 113 of file RangeServerConnection.h.

double Hypertable::RangeServerConnection::m_disk_fill_percentage {}
private

Definition at line 112 of file RangeServerConnection.h.

uint64_t Hypertable::RangeServerConnection::m_handle {}
private

Definition at line 104 of file RangeServerConnection.h.

String Hypertable::RangeServerConnection::m_hostname
private

Definition at line 107 of file RangeServerConnection.h.

RangeServerHyperspaceCallback* Hypertable::RangeServerConnection::m_hyperspace_callback
private

Definition at line 105 of file RangeServerConnection.h.

InetAddr Hypertable::RangeServerConnection::m_local_addr
private

Definition at line 110 of file RangeServerConnection.h.

String Hypertable::RangeServerConnection::m_location
private

Definition at line 106 of file RangeServerConnection.h.

InetAddr Hypertable::RangeServerConnection::m_public_addr
private

Definition at line 111 of file RangeServerConnection.h.

bool Hypertable::RangeServerConnection::m_recovering {}
private

Definition at line 114 of file RangeServerConnection.h.

int32_t Hypertable::RangeServerConnection::m_state {}
private

Definition at line 108 of file RangeServerConnection.h.


The documentation for this class was generated from the following files: