Range state. More...
#include <RangeState.h>
Public Types | |
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... | |
Public Member Functions | |
RangeState () | |
Default constructor. More... | |
RangeState (CharArena &arena, const RangeState &other) | |
Copy constructor. More... | |
virtual | ~RangeState () |
Destructor. More... | |
virtual void | clear () |
Clears state. 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... | |
Static Public Member Functions | |
static std::string | get_text (uint8_t state) |
Returns string representation of range state value. More... | |
Public Attributes | |
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 | |
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... | |
Range state.
An object of this class is created for each range in a range server and holds state that can change during the lifetime of the range. This class is essentially just a structure with some helper methods. There are several members that are c-style string pointers. The memory that these c-style strings point to must be managed outside of this class and must be valid for the lifetime of the object.
Definition at line 48 of file RangeState.h.
|
inline |
Default constructor.
Initializies all members to 0 and state to RangeState::STEADY
Definition at line 64 of file RangeState.h.
|
inline |
Copy constructor.
arena | Memory arena for allocating copied strings |
other | Other object to copy |
Definition at line 71 of file RangeState.h.
|
inlinevirtual |
Destructor.
Definition at line 82 of file RangeState.h.
|
virtual |
Clears state.
This method sets state to RangeState::STEADY and all other members to 0, except timestamp, which it leaves intact
Reimplemented in Hypertable::RangeStateManaged.
Definition at line 41 of file RangeState.cc.
|
overrideprotectedvirtual |
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.
Reimplemented in Hypertable::RangeStateManaged.
Definition at line 133 of file RangeState.cc.
|
overrideprotectedvirtual |
Writes serialized representation of object to a buffer.
bufp | Address of destination buffer pointer (advanced by call) |
Encoding is as follows:
Encoding | Description |
---|---|
i8 | State code |
i64 | Timestamp |
i64 | Soft limit |
vstr | Transfer log |
vstr | Split point |
vstr | Old boundary row |
vstr | Source server location |
Implements Hypertable::Serializable.
Definition at line 123 of file RangeState.cc.
|
overrideprotectedvirtual |
Returns internal serialized length.
Implements Hypertable::Serializable.
Definition at line 80 of file RangeState.cc.
|
overrideprotectedvirtual |
Returns encoding version.
Implements Hypertable::Serializable.
Definition at line 76 of file RangeState.cc.
|
static |
Returns string representation of range state value.
This method returns a string representation of state
. If the RangeState::PHANTOM bit is set, then the string representation will include |PHANTOM
as a suffix (e.g. SPLIT_SHRUNK|PHANTOM
).
state | &Range state value |
Definition at line 48 of file RangeState.cc.
const char* Hypertable::RangeState::old_boundary_row |
Original range boundary row.
Definition at line 117 of file RangeState.h.
uint64_t Hypertable::RangeState::soft_limit |
Soft split size limit.
Definition at line 108 of file RangeState.h.
const char* Hypertable::RangeState::source |
Source server where this range previously lived.
Definition at line 120 of file RangeState.h.
const char* Hypertable::RangeState::split_point |
Split point (row key)
Definition at line 114 of file RangeState.h.
uint8_t Hypertable::RangeState::state |
Range state value (see StateType)
Definition at line 102 of file RangeState.h.
int64_t Hypertable::RangeState::timestamp |
Timestamp
Definition at line 105 of file RangeState.h.
const char* Hypertable::RangeState::transfer_log |
Full pathname of transfer log.
Definition at line 111 of file RangeState.h.