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

MetaLog entity for range state persisted in RSML. More...

#include <MetaLogEntityRange.h>

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

Public Member Functions

 MetaLogEntityRange (const MetaLog::EntityHeader &header_)
 Constructor initialized from Metalog entity header. More...
 
 MetaLogEntityRange (const TableIdentifier &table, const RangeSpec &spec, const RangeState &state, bool needs_compaction)
 Constructor. More...
 
virtual ~MetaLogEntityRange ()
 Destructor. More...
 
void get_table_identifier (TableIdentifier &table)
 Copies table identifier. More...
 
const char * get_table_id ()
 Returns table id. More...
 
void set_table_generation (uint32_t generation)
 Sets table generation. More...
 
void get_range_spec (RangeSpecManaged &spec)
 Gets range specification. More...
 
void get_range_state (RangeStateManaged &state)
 Gets range state object. More...
 
int get_state ()
 Gets range. More...
 
void set_state (uint8_t state, const String &source)
 Sets range state. More...
 
void set_state_bits (uint8_t bits)
 Sets bits of range state. More...
 
void clear_state_bits (uint8_t bits)
 Clears bits of range state. More...
 
void clear_state ()
 Clears range state object. More...
 
uint64_t get_soft_limit ()
 Gets soft limit. More...
 
void set_soft_limit (uint64_t soft_limit)
 Sets soft limit. More...
 
String get_split_row ()
 Gets split row. More...
 
void set_split_row (const String &row)
 Sets split row. More...
 
String get_transfer_log ()
 Gets transfer log. More...
 
void set_transfer_log (const String &path)
 Sets transfer log. More...
 
String get_start_row ()
 Gets Start row. More...
 
void set_start_row (const String &row)
 Sets start row. More...
 
String get_end_row ()
 Gets end row. More...
 
void set_end_row (const String &row)
 Sets end row. More...
 
void get_boundary_rows (String &start, String &end)
 Gets boundary rows (start and end rows) More...
 
String get_old_boundary_row ()
 Gets old boundary row. More...
 
void set_old_boundary_row (const String &row)
 Sets old boundary row. More...
 
bool get_needs_compaction ()
 Gets needs compaction flag. More...
 
void set_needs_compaction (bool val)
 Sets needs compaction flag. More...
 
bool get_load_acknowledged ()
 Gets load acknowledged flag. More...
 
void set_load_acknowledged (bool val)
 Sets load acknowledged flag. More...
 
String get_source ()
 Gets source server. More...
 
void decode (const uint8_t **bufp, size_t *remainp, uint16_t definition_version) override
 Reads serialized encoding of the entity. More...
 
const String name () override
 Returns the entity name ("Range") More...
 
void display (std::ostream &os) override
 Writes a human readable representation of the object state to an output stream. 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...
 

Static Public Attributes

static bool encountered_upgrade = false
 Flag indicating that old entity was encountered. 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

TableIdentifierManaged m_table
 Table identifier More...
 
RangeSpecManaged m_spec
 Range spec More...
 
RangeStateManaged m_state
 Range state More...
 
bool m_needs_compaction
 Needs compaction flag. More...
 
bool m_load_acknowledged
 Load acknowledged flag. More...
 

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

MetaLog entity for range state persisted in RSML.

Definition at line 44 of file MetaLogEntityRange.h.

Constructor & Destructor Documentation

MetaLogEntityRange::MetaLogEntityRange ( const MetaLog::EntityHeader header_)

Constructor initialized from Metalog entity header.

Parameters
header_Metalog entity header

Definition at line 42 of file MetaLogEntityRange.cc.

MetaLogEntityRange::MetaLogEntityRange ( const TableIdentifier table,
const RangeSpec spec,
const RangeState state,
bool  needs_compaction 
)

Constructor.

Parameters
tableTable identifier
specRange spec
stateRange state
needs_compactionNeeds compaction flag

Definition at line 46 of file MetaLogEntityRange.cc.

virtual Hypertable::MetaLogEntityRange::~MetaLogEntityRange ( )
inlinevirtual

Destructor.

Definition at line 62 of file MetaLogEntityRange.h.

Member Function Documentation

void MetaLogEntityRange::clear_state ( )

Clears range state object.

Definition at line 99 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::clear_state_bits ( uint8_t  bits)

Clears bits of range state.

Parameters
bitsBitmask representing bits to clear

Definition at line 88 of file MetaLogEntityRange.cc.

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

Reads serialized encoding of the entity.

This method restores the state of the object by decoding a serialized representation of the state from the memory location pointed to by *bufp (decremented by call).

Parameters
bufpAddress of source buffer pointer (advanced by call)
remainpAmount of remaining buffer pointed to by *bufp (decremented by call).
definition_versionVersion of DefinitionMaster
See also
encode() for serialization format

Reimplemented from Hypertable::MetaLog::Entity.

Definition at line 195 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::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 231 of file MetaLogEntityRange.cc.

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

Definition at line 240 of file MetaLogEntityRange.cc.

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

Writes a human readable representation of the object state to an output stream.

Parameters
osOutput stream

Reimplemented from Hypertable::MetaLog::Entity.

Definition at line 207 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::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 223 of file MetaLogEntityRange.cc.

size_t MetaLogEntityRange::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 218 of file MetaLogEntityRange.cc.

uint8_t MetaLogEntityRange::encoding_version ( ) const
overrideprivatevirtual

Returns encoding version.

Returns
Encoding version

Implements Hypertable::Serializable.

Definition at line 214 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::get_boundary_rows ( String start,
String end 
)

Gets boundary rows (start and end rows)

Parameters
startOutput parameter to hold start row
endOutput parameter to hold end row

Definition at line 154 of file MetaLogEntityRange.cc.

String MetaLogEntityRange::get_end_row ( )

Gets end row.

Returns
End row

Definition at line 144 of file MetaLogEntityRange.cc.

bool MetaLogEntityRange::get_load_acknowledged ( )

Gets load acknowledged flag.

Returns
Load acknowledged flag

Definition at line 180 of file MetaLogEntityRange.cc.

bool MetaLogEntityRange::get_needs_compaction ( )

Gets needs compaction flag.

Returns
Needs compaction flag

Definition at line 170 of file MetaLogEntityRange.cc.

String MetaLogEntityRange::get_old_boundary_row ( )

Gets old boundary row.

When a range is split, it can either split off "high" or "low". If a range is split off "high" then the old boundary row is the end row of the original range, if it is split off "low" then the old boundary row is the start row of the original range

Returns
Old boundary row

Definition at line 160 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::get_range_spec ( RangeSpecManaged spec)

Gets range specification.

Parameters
specOutput parameter to hold copy of range specification

Definition at line 68 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::get_range_state ( RangeStateManaged state)

Gets range state object.

Parameters
stateOutput parameter to hold copy of range state object

Definition at line 73 of file MetaLogEntityRange.cc.

uint64_t MetaLogEntityRange::get_soft_limit ( )

Gets soft limit.

Returns
Soft limit

Definition at line 104 of file MetaLogEntityRange.cc.

String MetaLogEntityRange::get_source ( )

Gets source server.

Returns
Source server

Definition at line 190 of file MetaLogEntityRange.cc.

String MetaLogEntityRange::get_split_row ( )

Gets split row.

Returns
Split row

Definition at line 114 of file MetaLogEntityRange.cc.

String MetaLogEntityRange::get_start_row ( )

Gets Start row.

Returns
Start row

Definition at line 134 of file MetaLogEntityRange.cc.

int MetaLogEntityRange::get_state ( )

Gets range.

Returns
Range state

Definition at line 78 of file MetaLogEntityRange.cc.

const char * MetaLogEntityRange::get_table_id ( )

Returns table id.

Returns
Table identifier string

Definition at line 59 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::get_table_identifier ( TableIdentifier table)

Copies table identifier.

Parameters
tableOutput parameter to hold copy of table identifier

Definition at line 54 of file MetaLogEntityRange.cc.

String MetaLogEntityRange::get_transfer_log ( )

Gets transfer log.

Returns
Transfer log

Definition at line 124 of file MetaLogEntityRange.cc.

const String MetaLogEntityRange::name ( )
overridevirtual

Returns the entity name ("Range")

Returns
Entity name

Implements Hypertable::MetaLog::Entity.

Definition at line 203 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_end_row ( const String row)

Sets end row.

Parameters
rowNew end row

Definition at line 149 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_load_acknowledged ( bool  val)

Sets load acknowledged flag.

Parameters
valNew load acknowledged flag

Definition at line 185 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_needs_compaction ( bool  val)

Sets needs compaction flag.

Parameters
valNew needs compaction flag

Definition at line 175 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_old_boundary_row ( const String row)

Sets old boundary row.

Parameters
rowOld boundary row

Definition at line 165 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_soft_limit ( uint64_t  soft_limit)

Sets soft limit.

Parameters
soft_limitNew soft limit

Definition at line 109 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_split_row ( const String row)

Sets split row.

Parameters
rowNew split row

Definition at line 119 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_start_row ( const String row)

Sets start row.

Parameters
rowNew start row

Definition at line 139 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_state ( uint8_t  state,
const String source 
)

Sets range state.

Parameters
stateNew range state
sourceProxy name of server making state change

Definition at line 93 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_state_bits ( uint8_t  bits)

Sets bits of range state.

Parameters
bitsBitmask representing bits to set

Definition at line 83 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_table_generation ( uint32_t  generation)

Sets table generation.

Parameters
generationNew table generation

Definition at line 63 of file MetaLogEntityRange.cc.

void MetaLogEntityRange::set_transfer_log ( const String path)

Sets transfer log.

Parameters
pathPathname of new transfer log

Definition at line 129 of file MetaLogEntityRange.cc.

Member Data Documentation

bool MetaLogEntityRange::encountered_upgrade = false
static

Flag indicating that old entity was encountered.

Definition at line 233 of file MetaLogEntityRange.h.

bool Hypertable::MetaLogEntityRange::m_load_acknowledged
private

Load acknowledged flag.

Definition at line 261 of file MetaLogEntityRange.h.

bool Hypertable::MetaLogEntityRange::m_needs_compaction
private

Needs compaction flag.

Definition at line 258 of file MetaLogEntityRange.h.

RangeSpecManaged Hypertable::MetaLogEntityRange::m_spec
private

Range spec

Definition at line 252 of file MetaLogEntityRange.h.

RangeStateManaged Hypertable::MetaLogEntityRange::m_state
private

Range state

Definition at line 255 of file MetaLogEntityRange.h.

TableIdentifierManaged Hypertable::MetaLogEntityRange::m_table
private

Table identifier

Definition at line 249 of file MetaLogEntityRange.h.


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