Range state with memory management. More...
#include <RangeState.h>
Public Member Functions | |
RangeStateManaged () | |
Default constructor. More... | |
RangeStateManaged (const RangeStateManaged &rs) | |
Copy constructor. More... | |
RangeStateManaged (const RangeState &rs) | |
Constructor initialized with RangeState object. More... | |
virtual | ~RangeStateManaged () |
Destructor. More... | |
void | clear () override |
Clears state. More... | |
RangeStateManaged & | operator= (const RangeStateManaged &other) |
Assignment operator. More... | |
RangeStateManaged & | operator= (const RangeState &rs) |
Assignment operator with RangeState object. More... | |
void | set_transfer_log (const std::string &tl) |
Sets transfer log. More... | |
void | clear_transfer_log () |
Clears transfer log. More... | |
void | set_split_point (const std::string &sp) |
Sets split point. More... | |
void | clear_split_point () |
Clears split point. More... | |
void | set_old_boundary_row (const std::string &obr) |
Sets old boundary row. More... | |
void | clear_old_boundary_row () |
Clears old_boundary_row. More... | |
void | set_source (const std::string &src) |
Sets source server name. More... | |
void | clear_source () |
Clears source member. More... | |
Public Member Functions inherited from Hypertable::RangeState | |
RangeState () | |
Default constructor. More... | |
RangeState (CharArena &arena, const RangeState &other) | |
Copy constructor. More... | |
virtual | ~RangeState () |
Destructor. 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 | |
void | decode_internal (uint8_t version, const uint8_t **bufp, size_t *remainp) override |
Reads serialized representation of object from a buffer. More... | |
Private Attributes | |
std::string | m_transfer_log |
Transfer log string container. More... | |
std::string | m_split_point |
Split point string container. More... | |
std::string | m_old_boundary_row |
Old boundary row string container. More... | |
std::string | m_source |
Source server string container. More... | |
Additional Inherited Members | |
Public Types inherited from Hypertable::RangeState | |
enum | StateType { STEADY, SPLIT_LOG_INSTALLED, SPLIT_SHRUNK, RELINQUISH_LOG_INSTALLED, RELINQUISH_COMPACTED, PHANTOM = 0x80 } |
Mixed enumeration for range state values and PHANTOM bit mask. More... | |
Static Public Member Functions inherited from Hypertable::RangeState | |
static std::string | get_text (uint8_t state) |
Returns string representation of range state value. More... | |
Public Attributes inherited from Hypertable::RangeState | |
uint8_t | state |
Range state value (see StateType) More... | |
int64_t | timestamp |
Timestamp More... | |
uint64_t | soft_limit |
Soft split size limit. More... | |
const char * | transfer_log |
Full pathname of transfer log. More... | |
const char * | split_point |
Split point (row key) More... | |
const char * | old_boundary_row |
Original range boundary row. More... | |
const char * | source |
Source server where this range previously lived. More... | |
Protected Member Functions inherited from Hypertable::RangeState | |
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... | |
Range state with memory management.
This class is derived from RangeState and exists to provide memory management for the c-style string members. For each c-style string member of RangeState, this class adds a std::string member to hold the string memory.
Definition at line 166 of file RangeState.h.
|
inline |
Default constructor.
Definition at line 170 of file RangeState.h.
|
inline |
Copy constructor.
rs | Reference to object to copy |
Definition at line 175 of file RangeState.h.
|
inline |
Constructor initialized with RangeState object.
Calls range_state_assignment_operator to initialize state with members of rs
rs | Reference to RangeState object to copy |
Definition at line 184 of file RangeState.h.
|
inlinevirtual |
Destructor.
Definition at line 189 of file RangeState.h.
|
overridevirtual |
Clears state.
This method sets state to RangeState::STEADY and all other members to 0, except timestamp, which it leaves intact
Reimplemented from Hypertable::RangeState.
Definition at line 160 of file RangeState.cc.
|
inline |
Clears old_boundary_row.
Clears m_old_boundary_row and sets old_boundary_row to 0.
Definition at line 305 of file RangeState.h.
|
inline |
Clears source member.
Clears m_source and sets source to 0.
Definition at line 323 of file RangeState.h.
|
inline |
Clears split point.
Clears m_split_point and sets split_point to 0.
Definition at line 287 of file RangeState.h.
|
inline |
Clears transfer log.
Clears m_transfer_log and sets transfer_log to 0.
Definition at line 269 of file RangeState.h.
|
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 |
Reimplemented from Hypertable::RangeState.
Definition at line 165 of file RangeState.cc.
|
inline |
Assignment operator.
Casts other
to RangeState type and calls range_state_assignment_operator
other | Right-hand side of assignment |
Definition at line 198 of file RangeState.h.
|
inline |
Assignment operator with RangeState object.
Copies state from rs
and for each c-style string member of rs
, copies the contents to the corresponding std::string member of this class and then points the base class member to the std::string memory. For example, the transfer_log member is assigned as follows:
if (rs.transfer_log) { m_transfer_log = rs.transfer_log; transfer_log = m_transfer_log.c_str(); } else clear_transfer_log();
rs | Right-hand side of assignment |
Definition at line 220 of file RangeState.h.
|
inline |
Sets old boundary row.
Copies obr
to m_old_boundary_row and sets old_boundary_row pointing to m_old_boundary_row.c_str()
obr | old boundary row |
Definition at line 297 of file RangeState.h.
|
inline |
Sets source server name.
Copies src
to m_source and sets source pointing to m_source.c_str()
src | Source server name |
Definition at line 315 of file RangeState.h.
|
inline |
Sets split point.
Copies tl
to m_split_point and sets split_point pointing to m_split_point.c_str()
sp | split point |
Definition at line 279 of file RangeState.h.
|
inline |
Sets transfer log.
Copies tl
to m_transfer_log and sets transfer_log pointing to m_transfer_log.c_str()
tl | Transfer log |
Definition at line 261 of file RangeState.h.
|
private |
Old boundary row string container.
Definition at line 346 of file RangeState.h.
|
private |
Source server string container.
Definition at line 349 of file RangeState.h.
|
private |
Split point string container.
Definition at line 343 of file RangeState.h.
|
private |
Transfer log string container.
Definition at line 340 of file RangeState.h.