35 m_handle(0), m_hyperspace_callback(0), m_location(location),
36 m_hostname(hostname), m_state(RangeServerConnectionFlags::
INIT),
37 m_public_addr(public_addr), m_disk_fill_percentage(0.0),
38 m_connected(false), m_recovering(false) {
43 : MetaLog::Entity(header_), m_handle(0), m_hyperspace_callback(0),
44 m_disk_fill_percentage(0.0), m_connected(false), m_recovering(false) {
145 string str(
"{RangeServerConnection ");
156 bool continuation =
false;
158 str.append(
"REMOVED");
164 str.append(
"BALANCED");
176 bool continuation =
false;
194 uint16_t definition_version) {
195 if (definition_version <= 3) {
196 if (definition_version >= 2)
201 Entity::decode(bufp, remainp);
char * decode_vstr(const uint8_t **bufp, size_t *remainp)
Decode a vstr (vint64, data, null).
InetAddr public_addr() const
void decode(const uint8_t **bufp, size_t *remainp, uint16_t definition_version) override
Decodes serialized RangeServerConnection object.
std::string String
A String is simply a typedef to std::string.
CommAddress get_comm_address()
size_t encoded_length_internal() const override
Returns internal serialized length.
InetAddr local_addr() const
void decode(const uint8_t **bufp, size_t *remainp)
Reads serialized representation of object from a buffer.
Po::typed_value< String > * str(String *v=0)
void decode_old(const uint8_t **bufp, size_t *remainp)
size_t encoded_length_vstr(size_t len)
Computes the encoded length of vstr (vint64, data, null)
uint32_t decode_i32(const uint8_t **bufp, size_t *remainp)
Decode a 32-bit integer in little-endian order.
Callback class for range server lock files.
RangeServerHyperspaceCallback * m_hyperspace_callback
Encapsulate an internet address.
uint16_t decode_i16(const uint8_t **bufp, size_t *remainp)
Decode a 16-bit integer in little-endian order.
void set_proxy(const String &str)
Sets address type to CommAddress::PROXY and proxy name to p.
void set_hyperspace_handle(uint64_t handle, RangeServerHyperspaceCallback *cb)
void encode_i32(uint8_t **bufp, uint32_t val)
Encode a 32-bit integer in little-endian order.
Compatibility Macros for C/C++.
Functions to serialize/deserialize primitives to/from a memory buffer.
void encode(uint8_t **bufp) const
Writes serialized representation of object to a buffer.
void display(std::ostream &os) override
Prints a textual representation of the entity state to an ostream.
String format(int sep= ':') const
Returns a string with a dotted notation ("127.0.0.1:8080") including the port.
const String & hostname() const
void decode_internal(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized representation of object from a buffer.
void encode_internal(uint8_t **bufp) const override
Writes serialized representation of object to a buffer.
void encode_vstr(uint8_t **bufp, const void *buf, size_t len)
Encode a buffer as variable length string (vint64, data, null)
uint8_t encoding_version() const override
Returns encoding version.
size_t encoded_length() const
Returns serialized object length.
void legacy_decode(const uint8_t **bufp, size_t *remainp)
Deserializes object from legacy serialization format.
bool connect(const String &hostname, InetAddr local_addr, InetAddr public_addr)
const std::string to_str()
bool get_hyperspace_handle(uint64_t *handle, RangeServerHyperspaceCallback **cb)
RangeServerConnection(const String &location, const String &hostname, InetAddr public_addr)
Address abstraction to hold either proxy name or IPv4:port address.
void set_recovering(bool b)