Defines the set of valid MetaLog entities for a server. More...
#include <MetaLogDefinition.h>
Public Member Functions | |
Definition (const char *backup_label) | |
Constructor. More... | |
virtual uint16_t | version ()=0 |
Returns version number of definition. More... | |
virtual const char * | name ()=0 |
Returns MetaLog definition name. More... | |
virtual const char * | backup_label () |
Returns backup label of MetaLog. More... | |
virtual EntityPtr | create (const EntityHeader &header)=0 |
Constructs a MetaLog entity from an entity header. More... | |
Private Attributes | |
std::string | m_backup_label |
Backup label of MetaLog. More... | |
Defines the set of valid MetaLog entities for a server.
The MetaLog framework can be used to persist the state transitions for servers in Hypertable. From this abstract base class are derived concrete classes that define the set of valid MetaLog entities for a particular server. It consists of a name (e.g. "mml" or "rsml") and a create() method that is used by the MetaLog framework for constructing entities from serialized records in a MetaLog file.
Definition at line 54 of file MetaLogDefinition.h.
|
inline |
Constructor.
backup_label | Backup label of MetaLog |
Definition at line 61 of file MetaLogDefinition.h.
|
inlinevirtual |
Returns backup label of MetaLog.
The MetaLog framework stores a backup copy of the MetaLog files in the local filesystem for the purposes of disaster recovery. To allow tests to run multiple instances of a server on the same machine without their local backups clobbering one another, the definition is given a backup label which is used to construct the pathname of the backup directory within the local filesystem. For example, the RangeServer uses the proxy name of the server as the backup label, so the local backup directories for servers "rs1" and "rs2" are formulated as:
/opt/hypertable/current/run/log_backup/rsml/rs1 /opt/hypertable/current/run/log_backup/rsml/rs2
Definition at line 93 of file MetaLogDefinition.h.
|
pure virtual |
Constructs a MetaLog entity from an entity header.
When the MetaLog framework reads serialized entities from a MetaLog file, it first reads the entity header and passes that header into this method which will construct an empty entity. It then reconstructs the entity state by passing a pointer to the serialized entity to the Entity::decode() method.
header | Entity header |
Implemented in Hypertable::MetaLog::DefinitionMaster, and Hypertable::MetaLog::DefinitionRangeServer.
|
pure virtual |
Returns MetaLog definition name.
This method returns the name of the MetaLog definition (e.g. "mml" or "rsml"). This name is used as the last path component of the directory name of the MetaLog. For example, the RSML for server "rs1" is stored in a directory path that looks something like /hypertable/servers/rs1/log/rsml
.
Implemented in Hypertable::MetaLog::DefinitionMaster, and Hypertable::MetaLog::DefinitionRangeServer.
|
pure virtual |
Returns version number of definition.
Implemented in Hypertable::MetaLog::DefinitionMaster, and Hypertable::MetaLog::DefinitionRangeServer.
|
private |
Backup label of MetaLog.
Definition at line 110 of file MetaLogDefinition.h.