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

Defines the set of valid MetaLog entities for a server. More...

#include <MetaLogDefinition.h>

Inheritance diagram for Hypertable::MetaLog::Definition:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::MetaLog::Definition:
Collaboration graph
[legend]

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

Hypertable::MetaLog::Definition::Definition ( const char *  backup_label)
inline

Constructor.

Parameters
backup_labelBackup label of MetaLog
See also
backup_label()

Definition at line 61 of file MetaLogDefinition.h.

Member Function Documentation

virtual const char* Hypertable::MetaLog::Definition::backup_label ( )
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
Returns
Backup label of MetaLog

Definition at line 93 of file MetaLogDefinition.h.

virtual EntityPtr Hypertable::MetaLog::Definition::create ( const EntityHeader header)
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.

Parameters
headerEntity header
Returns
Pointer to newly constructed entity, or 0 if entity described by header is no longer used

Implemented in Hypertable::MetaLog::DefinitionMaster, and Hypertable::MetaLog::DefinitionRangeServer.

virtual const char* Hypertable::MetaLog::Definition::name ( )
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.

Returns
MetaLog definition name

Implemented in Hypertable::MetaLog::DefinitionMaster, and Hypertable::MetaLog::DefinitionRangeServer.

virtual uint16_t Hypertable::MetaLog::Definition::version ( )
pure virtual

Returns version number of definition.

Returns
Version number of definition

Implemented in Hypertable::MetaLog::DefinitionMaster, and Hypertable::MetaLog::DefinitionRangeServer.

Member Data Documentation

std::string Hypertable::MetaLog::Definition::m_backup_label
private

Backup label of MetaLog.

Definition at line 110 of file MetaLogDefinition.h.


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