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

Column family specification. More...

#include <ColumnFamilySpec.h>

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

Public Member Functions

 ColumnFamilySpec ()
 Default constructor. More...
 
 ColumnFamilySpec (const std::string &name)
 Constructor with column family name initializer. More...
 
void set_name (const std::string &name)
 Sets column family name. More...
 
const std::string & get_name () const
 Gets column family name. More...
 
void set_access_group (const std::string &ag)
 Sets access group. More...
 
const std::string & get_access_group () const
 Gets access group name. More...
 
void set_generation (int64_t generation)
 Sets generation. More...
 
int64_t get_generation () const
 Gets generation. More...
 
void set_id (int32_t id)
 Sets column ID. More...
 
int32_t get_id () const
 Gets column ID. More...
 
void set_value_index (bool value)
 Sets value index flag. More...
 
bool get_value_index () const
 Gets value index flag. More...
 
void set_qualifier_index (bool value)
 Sets qualifier index flag. More...
 
bool get_qualifier_index () const
 Gets qualifier index flag. More...
 
void set_deleted (bool value)
 Sets deleted flag. More...
 
bool get_deleted () const
 Gets deleted flag. More...
 
void set_option_max_versions (int32_t max_versions)
 Sets max versions option. More...
 
int32_t get_option_max_versions () const
 Gets max versions option. More...
 
void set_option_ttl (time_t ttl)
 Sets ttl option. More...
 
time_t get_option_ttl () const
 Gets ttl option. More...
 
void set_option_time_order_desc (bool value)
 Sets time order desc option. More...
 
bool get_option_time_order_desc () const
 Gets time order desc option. More...
 
void set_option_counter (bool value)
 Sets counter option. More...
 
bool get_option_counter () const
 Gets the counter option. More...
 
void merge_options (const ColumnFamilyOptions &other)
 Merges options from another ColumnFamilyOptions object. More...
 
const std::string render_xml (const std::string &line_prefix, bool with_ids=false) const
 Renders spec in XML format. More...
 
bool operator== (const ColumnFamilySpec &other) const
 Equality operator. More...
 
void parse_xml (const char *base, int len)
 Parses XML options document. More...
 
const std::string render_hql () const
 Renders spec in HQL format. More...
 
const ColumnFamilyOptionsoptions () const
 Returns reference to options structure. More...
 

Private Attributes

std::string m_name
 Column family name More...
 
std::string m_ag
 Access group name. More...
 
int64_t m_generation {}
 Generation. More...
 
int32_t m_id {}
 ID. More...
 
ColumnFamilyOptions m_options
 Options. More...
 
bool m_value_index {}
 Value index flag. More...
 
bool m_qualifier_index {}
 Qualifier index flag More...
 
bool m_deleted {}
 Deleted flag. More...
 

Detailed Description

Column family specification.

Definition at line 225 of file ColumnFamilySpec.h.

Constructor & Destructor Documentation

Hypertable::ColumnFamilySpec::ColumnFamilySpec ( )
inline

Default constructor.

Definition at line 229 of file ColumnFamilySpec.h.

Hypertable::ColumnFamilySpec::ColumnFamilySpec ( const std::string &  name)
inline

Constructor with column family name initializer.

Initializes m_name with name

Parameters
nameColumn family name

Definition at line 234 of file ColumnFamilySpec.h.

Member Function Documentation

const std::string& Hypertable::ColumnFamilySpec::get_access_group ( ) const
inline

Gets access group name.

Returns
Access group name.

Definition at line 252 of file ColumnFamilySpec.h.

bool Hypertable::ColumnFamilySpec::get_deleted ( ) const
inline

Gets deleted flag.

Returns
Deleted flag.

Definition at line 298 of file ColumnFamilySpec.h.

int64_t Hypertable::ColumnFamilySpec::get_generation ( ) const
inline

Gets generation.

Returns
Generation value

Definition at line 260 of file ColumnFamilySpec.h.

int32_t Hypertable::ColumnFamilySpec::get_id ( ) const
inline

Gets column ID.

Returns
Column ID.

Definition at line 268 of file ColumnFamilySpec.h.

const std::string& Hypertable::ColumnFamilySpec::get_name ( ) const
inline

Gets column family name.

Returns
Column family name.

Definition at line 243 of file ColumnFamilySpec.h.

bool Hypertable::ColumnFamilySpec::get_option_counter ( ) const
inline

Gets the counter option.

Returns
counter option.

Definition at line 349 of file ColumnFamilySpec.h.

int32_t Hypertable::ColumnFamilySpec::get_option_max_versions ( ) const
inline

Gets max versions option.

Returns
max versions option.

Definition at line 310 of file ColumnFamilySpec.h.

bool Hypertable::ColumnFamilySpec::get_option_time_order_desc ( ) const
inline

Gets time order desc option.

Returns
time order desc option.

Definition at line 334 of file ColumnFamilySpec.h.

time_t Hypertable::ColumnFamilySpec::get_option_ttl ( ) const
inline

Gets ttl option.

Returns
ttl option.

Definition at line 322 of file ColumnFamilySpec.h.

bool Hypertable::ColumnFamilySpec::get_qualifier_index ( ) const
inline

Gets qualifier index flag.

Returns
Qualifier index flag.

Definition at line 288 of file ColumnFamilySpec.h.

bool Hypertable::ColumnFamilySpec::get_value_index ( ) const
inline

Gets value index flag.

Returns
Value index flag.

Definition at line 278 of file ColumnFamilySpec.h.

void ColumnFamilySpec::merge_options ( const ColumnFamilyOptions other)

Merges options from another ColumnFamilyOptions object.

Merges options from other int m_options.

Parameters
otherColumnFamilyOptions object with which to merge

Definition at line 276 of file ColumnFamilySpec.cc.

bool ColumnFamilySpec::operator== ( const ColumnFamilySpec other) const

Equality operator.

Parameters
otherOther object to which comparison is to be made
Returns
true if this object is equal to other, false otherwise.

Definition at line 280 of file ColumnFamilySpec.cc.

const ColumnFamilyOptions& Hypertable::ColumnFamilySpec::options ( ) const
inline

Returns reference to options structure.

Returns
Reference to options structure.

Definition at line 412 of file ColumnFamilySpec.h.

void ColumnFamilySpec::parse_xml ( const char *  base,
int  len 
)

Parses XML options document.

This method parses an XML document representing a column family specification, populating the corresponding member variables.

Parameters
basePointer to character buffer holding XML document
lenLength of XML document
See also
render_xml() for an example XML column family spec document

Definition at line 360 of file ColumnFamilySpec.cc.

const std::string ColumnFamilySpec::render_hql ( ) const

Renders spec in HQL format.

Renders the column family specification in a format that can be used as the column specification in an HQL CREATE TABLE command. The following shows an example of the HQL produced by this member function.

  foo MAX_VERSIONS 3 TTL 1398615345 TIME_ORDER desc, QUALIFIER INDEX foo
Returns
std::string representing column specification in HQL format

Definition at line 407 of file ColumnFamilySpec.cc.

const std::string ColumnFamilySpec::render_xml ( const std::string &  line_prefix,
bool  with_ids = false 
) const

Renders spec in XML format.

Renders the spec as an XML document. The line_prefix parameter can be used to get nice indenting if the object is being rendered as part of a larger object and is typically some number of space characters. The with_ids parameter causes the generated XML to include the ID attribute and Generation elements. The following is example output produced by this member function with with_ids set to true.

<ColumnFamily id="42">
  <Generation>123</Generation>
  <Name>foo</Name>
  <AccessGroup>default</AccessGroup>
  <Deleted>false</Deleted>
  <QualifierIndex>true</QualifierIndex>
  <Options>
    <MaxVersions>3</MaxVersions>
    <TTL>1398615345</TTL>
    <TimeOrder>desc</TimeOrder>
  </Options>
</ColumnFamily>
Parameters
line_prefixstd::string to prepend to each line of output
with_idsInclude ID and Generation in output
Returns
std::string representing spec in XML format

Definition at line 365 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_access_group ( const std::string &  ag)

Sets access group.

Sets m_ag to ag

Parameters
agAccess group name to which this column belons

Definition at line 207 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_deleted ( bool  value)

Sets deleted flag.

Sets m_deleted flag to value indicating whether or not the column family is deleted.

Parameters
valueDeleted flag.

Definition at line 219 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_generation ( int64_t  generation)

Sets generation.

Parameters
generationGeneration value

Definition at line 211 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_id ( int32_t  id)

Sets column ID.

Parameters
idColumn ID

Definition at line 215 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_name ( const std::string &  name)

Sets column family name.

Sets m_name to name

Parameters
nameColumn family name

Definition at line 203 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_option_counter ( bool  value)

Sets counter option.

Sets the counter option of the m_options member to value.

Parameters
valueNew value for counter option.
Exceptions
Exceptionif supplied value is true and either the max versions or time order desc options are set, which are incompatible with the counter option.

Definition at line 241 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_option_max_versions ( int32_t  max_versions)

Sets max versions option.

Sets the max versions option of the m_options member to max_versions

Parameters
max_versionsNew value for max versions option
Exceptions
Exceptionif max_versions is negative or if the counter option is set, which is incompatible.

Definition at line 226 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_option_time_order_desc ( bool  value)

Sets time order desc option.

Sets the time order desc option of the m_options member to value.

Parameters
valueNew value for time order desc option
Exceptions
Exceptionif supplied value is true and the counter option is set, which is incompatible with the time order desc option.

Definition at line 236 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_option_ttl ( time_t  ttl)

Sets ttl option.

Sets the ttl option of the m_options member to ttl.

Parameters
ttlNew value for ttl option
Exceptions
Exceptionif supplied ttl value is negative.

Definition at line 231 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_qualifier_index ( bool  value)

Sets qualifier index flag.

Sets m_qualifier_index flag to value indicating whether or not a qualifier index is specified for this column family.

Parameters
valueQualifier index flag.

Definition at line 266 of file ColumnFamilySpec.cc.

void ColumnFamilySpec::set_value_index ( bool  value)

Sets value index flag.

Sets m_value_index flag to value indicating whether or not a value index is specified for this column family.

Parameters
valueValue index flag.

Definition at line 256 of file ColumnFamilySpec.cc.

Member Data Documentation

std::string Hypertable::ColumnFamilySpec::m_ag
private

Access group name.

Definition at line 420 of file ColumnFamilySpec.h.

bool Hypertable::ColumnFamilySpec::m_deleted {}
private

Deleted flag.

Definition at line 438 of file ColumnFamilySpec.h.

int64_t Hypertable::ColumnFamilySpec::m_generation {}
private

Generation.

Definition at line 423 of file ColumnFamilySpec.h.

int32_t Hypertable::ColumnFamilySpec::m_id {}
private

ID.

Definition at line 426 of file ColumnFamilySpec.h.

std::string Hypertable::ColumnFamilySpec::m_name
private

Column family name

Definition at line 417 of file ColumnFamilySpec.h.

ColumnFamilyOptions Hypertable::ColumnFamilySpec::m_options
private

Options.

Definition at line 429 of file ColumnFamilySpec.h.

bool Hypertable::ColumnFamilySpec::m_qualifier_index {}
private

Qualifier index flag

Definition at line 435 of file ColumnFamilySpec.h.

bool Hypertable::ColumnFamilySpec::m_value_index {}
private

Value index flag.

Definition at line 432 of file ColumnFamilySpec.h.


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