MetaLog entity for range state persisted in RSML. More...
#include <MetaLogEntityRange.h>
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... | |
MetaLog entity for range state persisted in RSML.
Definition at line 44 of file MetaLogEntityRange.h.
MetaLogEntityRange::MetaLogEntityRange | ( | const MetaLog::EntityHeader & | header_ | ) |
Constructor initialized from Metalog entity header.
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.
table | Table identifier |
spec | Range spec |
state | Range state |
needs_compaction | Needs compaction flag |
Definition at line 46 of file MetaLogEntityRange.cc.
|
inlinevirtual |
Destructor.
Definition at line 62 of file MetaLogEntityRange.h.
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.
bits | Bitmask representing bits to clear |
Definition at line 88 of file MetaLogEntityRange.cc.
|
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).
bufp | Address of source buffer pointer (advanced by call) |
remainp | Amount of remaining buffer pointed to by *bufp (decremented by call). |
definition_version | Version of DefinitionMaster |
Reimplemented from Hypertable::MetaLog::Entity.
Definition at line 195 of file MetaLogEntityRange.cc.
|
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().
version | Encoding version |
bufp | Address of destination buffer pointer (advanced by call) |
remainp | Address of integer holding amount of serialized encoding remaining |
Implements Hypertable::Serializable.
Definition at line 231 of file MetaLogEntityRange.cc.
|
private |
Definition at line 240 of file MetaLogEntityRange.cc.
|
overridevirtual |
Writes a human readable representation of the object state to an output stream.
os | Output stream |
Reimplemented from Hypertable::MetaLog::Entity.
Definition at line 207 of file MetaLogEntityRange.cc.
|
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.
bufp | Address of destination buffer pointer (advanced by call) |
Implements Hypertable::Serializable.
Definition at line 223 of file MetaLogEntityRange.cc.
|
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.
Implements Hypertable::Serializable.
Definition at line 218 of file MetaLogEntityRange.cc.
|
overrideprivatevirtual |
Returns encoding version.
Implements Hypertable::Serializable.
Definition at line 214 of file MetaLogEntityRange.cc.
Gets boundary rows (start and end rows)
start | Output parameter to hold start row |
end | Output parameter to hold end row |
Definition at line 154 of file MetaLogEntityRange.cc.
String MetaLogEntityRange::get_end_row | ( | ) |
bool MetaLogEntityRange::get_load_acknowledged | ( | ) |
Gets load acknowledged flag.
Definition at line 180 of file MetaLogEntityRange.cc.
bool MetaLogEntityRange::get_needs_compaction | ( | ) |
Gets 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
Definition at line 160 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::get_range_spec | ( | RangeSpecManaged & | spec | ) |
Gets range specification.
spec | Output 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.
state | Output parameter to hold copy of range state object |
Definition at line 73 of file MetaLogEntityRange.cc.
uint64_t MetaLogEntityRange::get_soft_limit | ( | ) |
String MetaLogEntityRange::get_source | ( | ) |
String MetaLogEntityRange::get_split_row | ( | ) |
String MetaLogEntityRange::get_start_row | ( | ) |
int MetaLogEntityRange::get_state | ( | ) |
const char * MetaLogEntityRange::get_table_id | ( | ) |
Returns table id.
Definition at line 59 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::get_table_identifier | ( | TableIdentifier & | table | ) |
Copies table identifier.
table | Output parameter to hold copy of table identifier |
Definition at line 54 of file MetaLogEntityRange.cc.
String MetaLogEntityRange::get_transfer_log | ( | ) |
|
overridevirtual |
Returns the entity name ("Range")
Implements Hypertable::MetaLog::Entity.
Definition at line 203 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::set_end_row | ( | const String & | row | ) |
void MetaLogEntityRange::set_load_acknowledged | ( | bool | val | ) |
Sets load acknowledged flag.
val | New load acknowledged flag |
Definition at line 185 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::set_needs_compaction | ( | bool | val | ) |
Sets needs compaction flag.
val | New needs compaction flag |
Definition at line 175 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::set_old_boundary_row | ( | const String & | row | ) |
Sets old boundary row.
row | Old boundary row |
Definition at line 165 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::set_soft_limit | ( | uint64_t | soft_limit | ) |
Sets soft limit.
soft_limit | New soft limit |
Definition at line 109 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::set_split_row | ( | const String & | row | ) |
void MetaLogEntityRange::set_start_row | ( | const String & | row | ) |
void MetaLogEntityRange::set_state | ( | uint8_t | state, |
const String & | source | ||
) |
Sets range state.
state | New range state |
source | Proxy 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.
bits | Bitmask representing bits to set |
Definition at line 83 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::set_table_generation | ( | uint32_t | generation | ) |
Sets table generation.
generation | New table generation |
Definition at line 63 of file MetaLogEntityRange.cc.
void MetaLogEntityRange::set_transfer_log | ( | const String & | path | ) |
Sets transfer log.
path | Pathname of new transfer log |
Definition at line 129 of file MetaLogEntityRange.cc.
|
static |
Flag indicating that old entity was encountered.
Definition at line 233 of file MetaLogEntityRange.h.
|
private |
Load acknowledged flag.
Definition at line 261 of file MetaLogEntityRange.h.
|
private |
Needs compaction flag.
Definition at line 258 of file MetaLogEntityRange.h.
|
private |
Range spec
Definition at line 252 of file MetaLogEntityRange.h.
|
private |
Range state
Definition at line 255 of file MetaLogEntityRange.h.
|
private |
Table identifier
Definition at line 249 of file MetaLogEntityRange.h.