MetaLog entity to track transfer logs that can be safely removed More...
#include <MetaLogEntityRemoveOkLogs.h>
Public Member Functions | |
MetaLogEntityRemoveOkLogs (const MetaLog::EntityHeader &header_) | |
Constructor initialized from Metalog entity header. More... | |
MetaLogEntityRemoveOkLogs (StringSet &logs) | |
Constructor. More... | |
MetaLogEntityRemoveOkLogs () | |
Constructor. More... | |
virtual | ~MetaLogEntityRemoveOkLogs () |
Destructor. More... | |
void | insert (const String &pathname) |
Inserts a log into the remove ok set. More... | |
void | insert (StringSet &logs) |
Inserts a set of logs into the remove ok set. More... | |
void | remove (StringSet &logs) |
Removes logs from the remove ok set. More... | |
void | get (StringSet &logs) |
Gets logs in the remove ok set. More... | |
uint32_t | decode_version () |
Returns format of decoded entity. 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... | |
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 | |
StringSet | m_log_set |
Set of log pathnames that can be safely removed. More... | |
uint32_t | m_decode_version |
Version of serialized entity decoded. 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 to track transfer logs that can be safely removed
Definition at line 46 of file MetaLogEntityRemoveOkLogs.h.
MetaLogEntityRemoveOkLogs::MetaLogEntityRemoveOkLogs | ( | const MetaLog::EntityHeader & | header_ | ) |
Constructor initialized from Metalog entity header.
header_ | Metalog entity header |
Definition at line 41 of file MetaLogEntityRemoveOkLogs.cc.
MetaLogEntityRemoveOkLogs::MetaLogEntityRemoveOkLogs | ( | StringSet & | logs | ) |
Constructor.
logs | Initial set of log pathnames |
Definition at line 45 of file MetaLogEntityRemoveOkLogs.cc.
MetaLogEntityRemoveOkLogs::MetaLogEntityRemoveOkLogs | ( | ) |
Constructor.
Definition at line 50 of file MetaLogEntityRemoveOkLogs.cc.
|
inlinevirtual |
Destructor.
Definition at line 63 of file MetaLogEntityRemoveOkLogs.h.
|
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
.
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 76 of file MetaLogEntityRemoveOkLogs.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 101 of file MetaLogEntityRemoveOkLogs.cc.
|
private |
Definition at line 109 of file MetaLogEntityRemoveOkLogs.cc.
|
inline |
Returns format of decoded entity.
Definition at line 88 of file MetaLogEntityRemoveOkLogs.h.
|
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 129 of file MetaLogEntityRemoveOkLogs.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 95 of file MetaLogEntityRemoveOkLogs.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 88 of file MetaLogEntityRemoveOkLogs.cc.
|
overrideprivatevirtual |
Returns encoding version.
Implements Hypertable::Serializable.
Definition at line 84 of file MetaLogEntityRemoveOkLogs.cc.
void MetaLogEntityRemoveOkLogs::get | ( | StringSet & | logs | ) |
Gets logs in the remove ok set.
logs | Output parameter filled in with logs |
Definition at line 71 of file MetaLogEntityRemoveOkLogs.cc.
void MetaLogEntityRemoveOkLogs::insert | ( | const String & | pathname | ) |
Inserts a log into the remove ok set.
pathname | Pathname of log to insert |
Definition at line 54 of file MetaLogEntityRemoveOkLogs.cc.
void MetaLogEntityRemoveOkLogs::insert | ( | StringSet & | logs | ) |
Inserts a set of logs into the remove ok set.
logs | Set of logs to insert |
Definition at line 60 of file MetaLogEntityRemoveOkLogs.cc.
|
overridevirtual |
Returns the entity name ("Range")
Implements Hypertable::MetaLog::Entity.
Definition at line 125 of file MetaLogEntityRemoveOkLogs.cc.
void MetaLogEntityRemoveOkLogs::remove | ( | StringSet & | logs | ) |
Removes logs from the remove ok set.
logs | Logs to remove |
Definition at line 65 of file MetaLogEntityRemoveOkLogs.cc.
|
private |
Version of serialized entity decoded.
Definition at line 133 of file MetaLogEntityRemoveOkLogs.h.
|
private |
Set of log pathnames that can be safely removed.
Definition at line 130 of file MetaLogEntityRemoveOkLogs.h.