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::RangeStateManaged Class Reference

Range state with memory management. More...

#include <RangeState.h>

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

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...
 
RangeStateManagedoperator= (const RangeStateManaged &other)
 Assignment operator. More...
 
RangeStateManagedoperator= (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

Hypertable::RangeStateManaged::RangeStateManaged ( )
inline

Default constructor.

Definition at line 170 of file RangeState.h.

Hypertable::RangeStateManaged::RangeStateManaged ( const RangeStateManaged rs)
inline

Copy constructor.

Parameters
rsReference to object to copy

Definition at line 175 of file RangeState.h.

Hypertable::RangeStateManaged::RangeStateManaged ( const RangeState rs)
inline

Constructor initialized with RangeState object.

Calls range_state_assignment_operator to initialize state with members of rs

Parameters
rsReference to RangeState object to copy

Definition at line 184 of file RangeState.h.

virtual Hypertable::RangeStateManaged::~RangeStateManaged ( )
inlinevirtual

Destructor.

Definition at line 189 of file RangeState.h.

Member Function Documentation

void RangeStateManaged::clear ( )
overridevirtual

Clears state.

This method sets state to RangeState::STEADY and all other members to 0, except timestamp, which it leaves intact

Note
This method does not clear the timestamp member

Reimplemented from Hypertable::RangeState.

Definition at line 160 of file RangeState.cc.

void Hypertable::RangeStateManaged::clear_old_boundary_row ( )
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.

void Hypertable::RangeStateManaged::clear_source ( )
inline

Clears source member.

Clears m_source and sets source to 0.

Definition at line 323 of file RangeState.h.

void Hypertable::RangeStateManaged::clear_split_point ( )
inline

Clears split point.

Clears m_split_point and sets split_point to 0.

Definition at line 287 of file RangeState.h.

void Hypertable::RangeStateManaged::clear_transfer_log ( )
inline

Clears transfer log.

Clears m_transfer_log and sets transfer_log to 0.

Definition at line 269 of file RangeState.h.

void RangeStateManaged::decode_internal ( uint8_t  version,
const uint8_t **  bufp,
size_t *  remainp 
)
overrideprivatevirtual

Reads serialized representation of object from a buffer.

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

Reimplemented from Hypertable::RangeState.

Definition at line 165 of file RangeState.cc.

RangeStateManaged& Hypertable::RangeStateManaged::operator= ( const RangeStateManaged other)
inline

Assignment operator.

Casts other to RangeState type and calls range_state_assignment_operator

Parameters
otherRight-hand side of assignment

Definition at line 198 of file RangeState.h.

RangeStateManaged& Hypertable::RangeStateManaged::operator= ( const RangeState rs)
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();
Parameters
rsRight-hand side of assignment

Definition at line 220 of file RangeState.h.

void Hypertable::RangeStateManaged::set_old_boundary_row ( const std::string &  obr)
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()

Parameters
obrold boundary row

Definition at line 297 of file RangeState.h.

void Hypertable::RangeStateManaged::set_source ( const std::string &  src)
inline

Sets source server name.

Copies src to m_source and sets source pointing to m_source.c_str()

Parameters
srcSource server name

Definition at line 315 of file RangeState.h.

void Hypertable::RangeStateManaged::set_split_point ( const std::string &  sp)
inline

Sets split point.

Copies tl to m_split_point and sets split_point pointing to m_split_point.c_str()

Parameters
spsplit point

Definition at line 279 of file RangeState.h.

void Hypertable::RangeStateManaged::set_transfer_log ( const std::string &  tl)
inline

Sets transfer log.

Copies tl to m_transfer_log and sets transfer_log pointing to m_transfer_log.c_str()

Parameters
tlTransfer log

Definition at line 261 of file RangeState.h.

Member Data Documentation

std::string Hypertable::RangeStateManaged::m_old_boundary_row
private

Old boundary row string container.

Definition at line 346 of file RangeState.h.

std::string Hypertable::RangeStateManaged::m_source
private

Source server string container.

Definition at line 349 of file RangeState.h.

std::string Hypertable::RangeStateManaged::m_split_point
private

Split point string container.

Definition at line 343 of file RangeState.h.

std::string Hypertable::RangeStateManaged::m_transfer_log
private

Transfer log string container.

Definition at line 340 of file RangeState.h.


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