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

Represents an open table. More...

#include <Table.h>

Inheritance diagram for Hypertable::Table:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::Table:
Collaboration graph
[legend]

Public Types

enum  {
  OPEN_FLAG_BYPASS_TABLE_CACHE = 0x01, OPEN_FLAG_REFRESH_TABLE_CACHE = 0x02, OPEN_FLAG_NO_AUTO_TABLE_REFRESH = 0x04, SCANNER_FLAG_IGNORE_INDEX = 0x01,
  SCANNER_FLAG_PROFILE = 0x02
}
 
enum  { MUTATOR_FLAG_NO_LOG_SYNC = Lib::RangeServer::Protocol::UPDATE_FLAG_NO_LOG_SYNC, MUTATOR_FLAG_NO_LOG = Lib::RangeServer::Protocol::UPDATE_FLAG_NO_LOG }
 

Public Member Functions

 Table (PropertiesPtr &, RangeLocatorPtr &, ConnectionManagerPtr &, Hyperspace::SessionPtr &, ApplicationQueueInterfacePtr &, NameIdMapperPtr &, const std::string &name, int32_t flags=0, uint32_t default_timeout_ms=0)
 
virtual ~Table ()
 
TableMutatorcreate_mutator (uint32_t timeout_ms=0, uint32_t flags=0, uint32_t flush_interval_ms=0)
 Creates a mutator on this table. More...
 
TableMutatorAsynccreate_mutator_async (ResultCallback *cb, uint32_t timeout_ms=0, uint32_t flags=0)
 Creates an asynchronous mutator on this table. More...
 
TableScannercreate_scanner (const ScanSpec &scan_spec, uint32_t timeout_ms=0, int32_t flags=0)
 Creates a synchronous scanner on this table. More...
 
TableScannerAsynccreate_scanner_async (ResultCallback *cb, const ScanSpec &scan_spec, uint32_t timeout_ms=0, int32_t flags=0)
 Creates an asynchronous scanner on this table. More...
 
void get_identifier (TableIdentifier *table_id_p)
 
const std::string & get_name ()
 
SchemaPtr schema ()
 
void refresh ()
 Refresh schema etc. More...
 
void get (TableIdentifierManaged &table_identifier, SchemaPtr &schema)
 Get a copy of table identifier and schema atomically. More...
 
void refresh (TableIdentifierManaged &table_identifier, SchemaPtr &schema)
 Make a copy of table identifier and schema atomically also. More...
 
bool need_refresh ()
 
void invalidate ()
 
bool auto_refresh ()
 
int32_t get_flags ()
 
bool needs_index_table ()
 returns true if this table requires a index table More...
 
bool needs_qualifier_index_table ()
 returns true if this table requires a qualifier index table More...
 
bool has_index_table ()
 returns true if this table has an index More...
 
bool has_qualifier_index_table ()
 returns true if this table has a qualifier index More...
 
void set_index_table (TablePtr idx)
 sets the index table. More...
 
void set_qualifier_index_table (TablePtr idx)
 sets the qualifier index table More...
 
TablePtr get_index_table ()
 
TablePtr get_qualifier_index_table ()
 
void set_namespace (Namespace *ns)
 
Namespaceget_namespace ()
 
RangeLocatorPtr get_range_locator ()
 
- Public Member Functions inherited from Hypertable::ClientObject
virtual ~ClientObject ()
 Destructor. More...
 

Private Member Functions

void initialize ()
 
void refresh_if_required ()
 

Private Attributes

std::mutex m_mutex
 Mutex for serializing member access. More...
 
PropertiesPtr m_props
 
Commm_comm
 
ConnectionManagerPtr m_conn_manager
 
Hyperspace::SessionPtr m_hyperspace
 
SchemaPtr m_schema
 
RangeLocatorPtr m_range_locator
 
ApplicationQueueInterfacePtr m_app_queue
 
NameIdMapperPtr m_namemap
 
std::string m_name
 
TableIdentifierManaged m_table
 
int32_t m_flags
 
int m_timeout_ms
 
bool m_stale
 
std::string m_toplevel_dir
 
size_t m_scanner_queue_size
 
TablePtr m_index_table
 
TablePtr m_qualifier_index_table
 
Namespacem_namespace
 

Detailed Description

Represents an open table.

Definition at line 58 of file Table.h.

Member Enumeration Documentation

anonymous enum
Enumerator
OPEN_FLAG_BYPASS_TABLE_CACHE 
OPEN_FLAG_REFRESH_TABLE_CACHE 
OPEN_FLAG_NO_AUTO_TABLE_REFRESH 
SCANNER_FLAG_IGNORE_INDEX 
SCANNER_FLAG_PROFILE 

Definition at line 62 of file Table.h.

anonymous enum
Enumerator
MUTATOR_FLAG_NO_LOG_SYNC 
MUTATOR_FLAG_NO_LOG 

Definition at line 70 of file Table.h.

Constructor & Destructor Documentation

Table::Table ( PropertiesPtr props,
RangeLocatorPtr range_locator,
ConnectionManagerPtr conn_manager,
Hyperspace::SessionPtr hyperspace,
ApplicationQueueInterfacePtr app_queue,
NameIdMapperPtr namemap,
const std::string &  name,
int32_t  flags = 0,
uint32_t  default_timeout_ms = 0 
)

Definition at line 48 of file Table.cc.

Table::~Table ( )
virtual

Definition at line 159 of file Table.cc.

Member Function Documentation

bool Hypertable::Table::auto_refresh ( )
inline

Definition at line 178 of file Table.h.

TableMutator * Table::create_mutator ( uint32_t  timeout_ms = 0,
uint32_t  flags = 0,
uint32_t  flush_interval_ms = 0 
)

Creates a mutator on this table.

Parameters
timeout_msmaximum time in milliseconds to allow mutator methods to execute before throwing an exception
flagsmutator flags
flush_interval_mstime interval in milliseconds to flush data. 0 disables it.
Returns
newly constructed mutator object

Definition at line 164 of file Table.cc.

TableMutatorAsync * Table::create_mutator_async ( ResultCallback cb,
uint32_t  timeout_ms = 0,
uint32_t  flags = 0 
)

Creates an asynchronous mutator on this table.

Parameters
cbPointer to result callback
timeout_msmaximum time in milliseconds to allow mutator methods to execute before throwing an exception
flagsmutator flags
Returns
newly constructed mutator object

Definition at line 184 of file Table.cc.

TableScanner * Table::create_scanner ( const ScanSpec scan_spec,
uint32_t  timeout_ms = 0,
int32_t  flags = 0 
)

Creates a synchronous scanner on this table.

Parameters
scan_specscan specification
timeout_msmaximum time in milliseconds to allow scanner methods to execute before throwing an exception
flagsscanner flags
Returns
pointer to scanner object

Definition at line 200 of file Table.cc.

TableScannerAsync * Table::create_scanner_async ( ResultCallback cb,
const ScanSpec scan_spec,
uint32_t  timeout_ms = 0,
int32_t  flags = 0 
)

Creates an asynchronous scanner on this table.

Parameters
cbCallback to be notified when scan results arrive
scan_specscan specification
timeout_msmaximum time in milliseconds to allow scanner methods to execute before throwing an exception
flagsScanner flags
Returns
pointer to scanner object

Definition at line 213 of file Table.cc.

void Table::get ( TableIdentifierManaged table_identifier,
SchemaPtr schema 
)

Get a copy of table identifier and schema atomically.

Parameters
table_identifierreference of the table identifier copy
schemareference of the schema copy

Definition at line 140 of file Table.cc.

int32_t Hypertable::Table::get_flags ( )
inline

Definition at line 182 of file Table.h.

void Hypertable::Table::get_identifier ( TableIdentifier table_id_p)
inline

Definition at line 133 of file Table.h.

TablePtr Hypertable::Table::get_index_table ( )
inline

Definition at line 235 of file Table.h.

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

Definition at line 139 of file Table.h.

Namespace* Hypertable::Table::get_namespace ( )
inline

Definition at line 247 of file Table.h.

TablePtr Hypertable::Table::get_qualifier_index_table ( )
inline

Definition at line 239 of file Table.h.

RangeLocatorPtr Hypertable::Table::get_range_locator ( )
inline

Definition at line 251 of file Table.h.

bool Hypertable::Table::has_index_table ( )
inline

returns true if this table has an index

Definition at line 209 of file Table.h.

bool Hypertable::Table::has_qualifier_index_table ( )
inline

returns true if this table has a qualifier index

Definition at line 215 of file Table.h.

void Table::initialize ( )
private

Get schema attribute

Definition at line 66 of file Table.cc.

void Hypertable::Table::invalidate ( )
inline

Definition at line 173 of file Table.h.

bool Hypertable::Table::need_refresh ( )
inline

Definition at line 168 of file Table.h.

bool Hypertable::Table::needs_index_table ( )
inline

returns true if this table requires a index table

Definition at line 185 of file Table.h.

bool Hypertable::Table::needs_qualifier_index_table ( )
inline

returns true if this table requires a qualifier index table

Definition at line 197 of file Table.h.

void Table::refresh ( )

Refresh schema etc.

Definition at line 132 of file Table.cc.

void Table::refresh ( TableIdentifierManaged table_identifier,
SchemaPtr schema 
)

Make a copy of table identifier and schema atomically also.

Definition at line 149 of file Table.cc.

void Table::refresh_if_required ( )
private

Definition at line 126 of file Table.cc.

SchemaPtr Hypertable::Table::schema ( )
inline

Definition at line 144 of file Table.h.

void Hypertable::Table::set_index_table ( TablePtr  idx)
inline

sets the index table.

The index table is created by the Namespace, because it's the only object with access to the TableCache

Definition at line 222 of file Table.h.

void Hypertable::Table::set_namespace ( Namespace ns)
inline

Definition at line 243 of file Table.h.

void Hypertable::Table::set_qualifier_index_table ( TablePtr  idx)
inline

sets the qualifier index table

Definition at line 229 of file Table.h.

Member Data Documentation

ApplicationQueueInterfacePtr Hypertable::Table::m_app_queue
private

Definition at line 265 of file Table.h.

Comm* Hypertable::Table::m_comm
private

Definition at line 260 of file Table.h.

ConnectionManagerPtr Hypertable::Table::m_conn_manager
private

Definition at line 261 of file Table.h.

int32_t Hypertable::Table::m_flags
private

Definition at line 269 of file Table.h.

Hyperspace::SessionPtr Hypertable::Table::m_hyperspace
private

Definition at line 262 of file Table.h.

TablePtr Hypertable::Table::m_index_table
private

Definition at line 274 of file Table.h.

std::mutex Hypertable::Table::m_mutex
private

Mutex for serializing member access.

Definition at line 258 of file Table.h.

std::string Hypertable::Table::m_name
private

Definition at line 267 of file Table.h.

NameIdMapperPtr Hypertable::Table::m_namemap
private

Definition at line 266 of file Table.h.

Namespace* Hypertable::Table::m_namespace
private

Definition at line 276 of file Table.h.

PropertiesPtr Hypertable::Table::m_props
private

Definition at line 259 of file Table.h.

TablePtr Hypertable::Table::m_qualifier_index_table
private

Definition at line 275 of file Table.h.

RangeLocatorPtr Hypertable::Table::m_range_locator
private

Definition at line 264 of file Table.h.

size_t Hypertable::Table::m_scanner_queue_size
private

Definition at line 273 of file Table.h.

SchemaPtr Hypertable::Table::m_schema
private

Definition at line 263 of file Table.h.

bool Hypertable::Table::m_stale
private

Definition at line 271 of file Table.h.

TableIdentifierManaged Hypertable::Table::m_table
private

Definition at line 268 of file Table.h.

int Hypertable::Table::m_timeout_ms
private

Definition at line 270 of file Table.h.

std::string Hypertable::Table::m_toplevel_dir
private

Definition at line 272 of file Table.h.


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