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::HostSpecification Class Reference

Converts host specification pattern to list of host names. More...

#include <HostSpecification.h>

Collaboration diagram for Hypertable::HostSpecification:
Collaboration graph
[legend]

Public Member Functions

 HostSpecification (const std::string &spec)
 Constructor. More...
 
 operator std::vector< std::string > ()
 Expands host specification pattern to list of hostnames. More...
 

Private Attributes

const std::string m_spec
 Host specification pattern. More...
 

Detailed Description

Converts host specification pattern to list of host names.

Hostnames in a cluster are typically named using a common prefix followed by a number. To facilitate the specification of a large number of hosts, this class introduces a concise host pattern syntax and provides a function to convert a pattern into a list of hostnames. The host pattern syntax can include numeric ranges such as host[00-15] and supports set union '+' and set difference '-' operators (left associative). Host sets can also be grouped using parenthesis. The ',' character is equivalent to the '+' character, so a comma-separated list of host names is a valid host specification pattern as well. The following examples illustrate the host specification pattern syntax:

Pattern Expansion
host[09-10].hypertable.com host09.hypertable.com
host10.hypertable.com
host[9-10].hypertable.com host9.hypertable.com
host10.hypertable.com
host[01-02] host03 host01
host02
host03
(host[01-03] - host02) + host[04-05] host01
host03
host04
host05
host01, host02, host03 host01
host02
host03

Definition at line 85 of file HostSpecification.h.

Constructor & Destructor Documentation

Hypertable::HostSpecification::HostSpecification ( const std::string &  spec)
inline

Constructor.

Parameters
specHost specification pattern

Definition at line 91 of file HostSpecification.h.

Member Function Documentation

Hypertable::HostSpecification::operator std::vector< std::string > ( )

Expands host specification pattern to list of hostnames.

The list returned by this function is sorted by hostname. Hostnames that match a specific pattern are sorted numerically by their numeric component.

Returns
List of hostnames represented by m_spec.
Exceptions
Exceptionwith code set to Error::BAD_FORMAT on bad input

Member Data Documentation

const std::string Hypertable::HostSpecification::m_spec
private

Host specification pattern.

Definition at line 103 of file HostSpecification.h.


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