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

Client interface to Master. More...

#include <Client.h>

Collaboration diagram for Hypertable::Lib::Master::Client:
Collaboration graph
[legend]

Public Member Functions

 Client (ConnectionManagerPtr &conn_mgr, Hyperspace::SessionPtr &hyperspace, const String &toplevel_dir, uint32_t timeout_ms, ApplicationQueueInterfacePtr &app_queue, DispatchHandlerPtr dhp, ConnectionInitializerPtr init)
 
 Client (ConnectionManagerPtr &conn_mgr, InetAddr &addr, uint32_t timeout_ms)
 
 Client (Comm *comm, InetAddr &addr, uint32_t timeout_ms)
 
 ~Client ()
 
bool wait_for_connection (uint32_t max_wait_ms)
 
bool wait_for_connection (Timer &timer)
 
void create_namespace (const String &name, int32_t flags, Timer *timer=0)
 
void drop_namespace (const String &name, int32_t flags, Timer *timer=0)
 
void compact (const String &tablename, const String &row, int32_t range_types, Timer *timer=0)
 
void create_table (const String &name, const String &schema, Timer *timer=0)
 
void alter_table (const String &tablename, const String &schema, bool force, Timer *timer=0)
 
void rename_table (const String &from, const String &to, Timer *timer=0)
 
void status (Status &status, Timer *timer=0)
 
void move_range (const String &source, int64_t range_id, TableIdentifier &table, RangeSpec &range, const String &transfer_log, uint64_t soft_limit, bool split, Timer *timer=0)
 
void relinquish_acknowledge (const String &source, int64_t range_id, TableIdentifier &table, RangeSpec &range, Timer *timer=0)
 
void drop_table (const String &name, bool if_exists, Timer *timer=0)
 
void recreate_index_tables (const std::string &name, TableParts parts, Timer *timer=0)
 Carries out a recreate index tables Master operation. More...
 
void shutdown (Timer *timer=0)
 
void balance (BalancePlan &plan, Timer *timer=0)
 
void set_state (const std::vector< SystemVariable::Spec > &specs, Timer *timer=0)
 Set system state variables synchronously. More...
 
void stop (const String &rsname, Timer *timer=0)
 
void reload_master ()
 
void set_verbose_flag (bool verbose)
 
void replay_status (int64_t op_id, const String &location, int32_t plan_generation)
 
void replay_complete (int64_t op_id, const String &location, int32_t plan_generation, int32_t error, const String message)
 
void phantom_prepare_complete (int64_t op_id, const String &location, int plan_generation, int32_t error, const String message)
 
void phantom_commit_complete (int64_t op_id, const String &location, int plan_generation, int32_t error, const String message)
 
void system_status (Status &status, Timer *timer=0)
 

Private Member Functions

void hyperspace_disconnected ()
 
void hyperspace_reconnected ()
 
void send_message_async (CommBufPtr &cbp, DispatchHandler *handler, Timer *timer, const String &label)
 
bool send_message (CommBufPtr &cbp, Timer *timer, EventPtr &event, const String &label)
 
void fetch_result (int64_t id, Timer *timer, EventPtr &event, const String &label)
 
void initialize_hyperspace ()
 Assumes access is serialized via m_hyperspace_mutex. More...
 
void initialize (Timer *&timer, Timer &tmp_timer)
 

Private Attributes

std::mutex m_mutex
 
std::condition_variable m_cond
 
bool m_verbose
 
Commm_comm {}
 
ConnectionManagerPtr m_conn_manager
 
Hyperspace::SessionPtr m_hyperspace
 
ApplicationQueueInterfacePtr m_app_queue
 
uint64_t m_master_file_handle {}
 
Hyperspace::HandleCallbackPtr m_master_file_callback
 
InetAddr m_master_addr
 
String m_master_addr_string
 
DispatchHandlerPtr m_dispatcher_handler
 
ConnectionInitializerPtr m_connection_initializer
 
bool m_hyperspace_init {}
 
bool m_hyperspace_connected {}
 
std::mutex m_hyperspace_mutex
 
uint32_t m_timeout_ms {}
 
ClientHyperspaceSessionCallback m_hyperspace_session_callback
 
String m_toplevel_dir
 
uint32_t m_retry_interval {}
 

Friends

class ClientHyperspaceSessionCallback
 

Detailed Description

Client interface to Master.

This class provides a client interface to the Master. It has methods, both synchronous and asynchronous, that carry out Master operations.

Definition at line 80 of file Client.h.

Constructor & Destructor Documentation

Master::Client::Client ( ConnectionManagerPtr conn_mgr,
Hyperspace::SessionPtr hyperspace,
const String toplevel_dir,
uint32_t  timeout_ms,
ApplicationQueueInterfacePtr app_queue,
DispatchHandlerPtr  dhp,
ConnectionInitializerPtr  init 
)

Open toplevel_dir + /master Hyperspace file to discover the master.

Definition at line 78 of file Client.cc.

Master::Client::Client ( ConnectionManagerPtr conn_mgr,
InetAddr addr,
uint32_t  timeout_ms 
)

Definition at line 107 of file Client.cc.

Master::Client::Client ( Comm comm,
InetAddr addr,
uint32_t  timeout_ms 
)

Definition at line 119 of file Client.cc.

Master::Client::~Client ( )

Definition at line 126 of file Client.cc.

Member Function Documentation

void Master::Client::alter_table ( const String tablename,
const String schema,
bool  force,
Timer timer = 0 
)

Definition at line 343 of file Client.cc.

void Master::Client::balance ( BalancePlan plan,
Timer timer = 0 
)

Definition at line 617 of file Client.cc.

void Master::Client::compact ( const String tablename,
const String row,
int32_t  range_types,
Timer timer = 0 
)

Definition at line 270 of file Client.cc.

void Master::Client::create_namespace ( const String name,
int32_t  flags,
Timer timer = 0 
)

Definition at line 193 of file Client.cc.

void Master::Client::create_table ( const String name,
const String schema,
Timer timer = 0 
)

Definition at line 306 of file Client.cc.

void Master::Client::drop_namespace ( const String name,
int32_t  flags,
Timer timer = 0 
)

Definition at line 233 of file Client.cc.

void Master::Client::drop_table ( const String name,
bool  if_exists,
Timer timer = 0 
)

Definition at line 526 of file Client.cc.

void Master::Client::fetch_result ( int64_t  id,
Timer timer,
EventPtr event,
const String label 
)
private

Definition at line 815 of file Client.cc.

void Master::Client::hyperspace_disconnected ( )
private

Definition at line 135 of file Client.cc.

void Master::Client::hyperspace_reconnected ( )
private

Definition at line 143 of file Client.cc.

void Master::Client::initialize ( Timer *&  timer,
Timer tmp_timer 
)
private

Definition at line 185 of file Client.cc.

void Master::Client::initialize_hyperspace ( )
private

Assumes access is serialized via m_hyperspace_mutex.

Definition at line 159 of file Client.cc.

void Master::Client::move_range ( const String source,
int64_t  range_id,
TableIdentifier table,
RangeSpec range,
const String transfer_log,
uint64_t  soft_limit,
bool  split,
Timer timer = 0 
)

Definition at line 406 of file Client.cc.

void Master::Client::phantom_commit_complete ( int64_t  op_id,
const String location,
int  plan_generation,
int32_t  error,
const String  message 
)

Definition at line 939 of file Client.cc.

void Master::Client::phantom_prepare_complete ( int64_t  op_id,
const String location,
int  plan_generation,
int32_t  error,
const String  message 
)

Definition at line 906 of file Client.cc.

void Master::Client::recreate_index_tables ( const std::string &  name,
TableParts  parts,
Timer timer = 0 
)

Carries out a recreate index tables Master operation.

Parameters
nameName of table for which to recreate index tables
partsSpecifies which index tables to recreate
timerDeadline timer
Exceptions
Exceptionwith code set to Error::REQUEST_TIMEOUT if deadline is reached before operation completes.

Definition at line 560 of file Client.cc.

void Master::Client::relinquish_acknowledge ( const String source,
int64_t  range_id,
TableIdentifier table,
RangeSpec range,
Timer timer = 0 
)

Definition at line 449 of file Client.cc.

void Master::Client::reload_master ( )

Definition at line 969 of file Client.cc.

void Master::Client::rename_table ( const String from,
const String to,
Timer timer = 0 
)

Definition at line 490 of file Client.cc.

void Master::Client::replay_complete ( int64_t  op_id,
const String location,
int32_t  plan_generation,
int32_t  error,
const String  message 
)

Definition at line 870 of file Client.cc.

void Master::Client::replay_status ( int64_t  op_id,
const String location,
int32_t  plan_generation 
)

Definition at line 837 of file Client.cc.

bool Master::Client::send_message ( CommBufPtr cbp,
Timer timer,
EventPtr event,
const String label 
)
private

Definition at line 796 of file Client.cc.

void Master::Client::send_message_async ( CommBufPtr cbp,
DispatchHandler handler,
Timer timer,
const String label 
)
private

Definition at line 762 of file Client.cc.

void Master::Client::set_state ( const std::vector< SystemVariable::Spec > &  specs,
Timer timer = 0 
)

Set system state variables synchronously.

Parameters
specsVector of system variable specs
timerDeadline timer

Definition at line 661 of file Client.cc.

void Hypertable::Lib::Master::Client::set_verbose_flag ( bool  verbose)
inline

Definition at line 149 of file Client.h.

void Master::Client::shutdown ( Timer timer = 0)

Definition at line 598 of file Client.cc.

void Master::Client::status ( Status status,
Timer timer = 0 
)

Definition at line 377 of file Client.cc.

void Master::Client::stop ( const String rsname,
Timer timer = 0 
)

Definition at line 695 of file Client.cc.

void Master::Client::system_status ( Status status,
Timer timer = 0 
)

Definition at line 733 of file Client.cc.

bool Master::Client::wait_for_connection ( uint32_t  max_wait_ms)

Definition at line 1041 of file Client.cc.

bool Master::Client::wait_for_connection ( Timer timer)

Definition at line 1047 of file Client.cc.

Friends And Related Function Documentation

friend class ClientHyperspaceSessionCallback
friend

Definition at line 167 of file Client.h.

Member Data Documentation

ApplicationQueueInterfacePtr Hypertable::Lib::Master::Client::m_app_queue
private

Definition at line 184 of file Client.h.

Comm* Hypertable::Lib::Master::Client::m_comm {}
private

Definition at line 181 of file Client.h.

std::condition_variable Hypertable::Lib::Master::Client::m_cond
private

Definition at line 179 of file Client.h.

ConnectionManagerPtr Hypertable::Lib::Master::Client::m_conn_manager
private

Definition at line 182 of file Client.h.

ConnectionInitializerPtr Hypertable::Lib::Master::Client::m_connection_initializer
private

Definition at line 190 of file Client.h.

DispatchHandlerPtr Hypertable::Lib::Master::Client::m_dispatcher_handler
private

Definition at line 189 of file Client.h.

Hyperspace::SessionPtr Hypertable::Lib::Master::Client::m_hyperspace
private

Definition at line 183 of file Client.h.

bool Hypertable::Lib::Master::Client::m_hyperspace_connected {}
private

Definition at line 192 of file Client.h.

bool Hypertable::Lib::Master::Client::m_hyperspace_init {}
private

Definition at line 191 of file Client.h.

std::mutex Hypertable::Lib::Master::Client::m_hyperspace_mutex
private

Definition at line 193 of file Client.h.

ClientHyperspaceSessionCallback Hypertable::Lib::Master::Client::m_hyperspace_session_callback
private

Definition at line 195 of file Client.h.

InetAddr Hypertable::Lib::Master::Client::m_master_addr
private

Definition at line 187 of file Client.h.

String Hypertable::Lib::Master::Client::m_master_addr_string
private

Definition at line 188 of file Client.h.

Hyperspace::HandleCallbackPtr Hypertable::Lib::Master::Client::m_master_file_callback
private

Definition at line 186 of file Client.h.

uint64_t Hypertable::Lib::Master::Client::m_master_file_handle {}
private

Definition at line 185 of file Client.h.

std::mutex Hypertable::Lib::Master::Client::m_mutex
private

Definition at line 178 of file Client.h.

uint32_t Hypertable::Lib::Master::Client::m_retry_interval {}
private

Definition at line 197 of file Client.h.

uint32_t Hypertable::Lib::Master::Client::m_timeout_ms {}
private

Definition at line 194 of file Client.h.

String Hypertable::Lib::Master::Client::m_toplevel_dir
private

Definition at line 196 of file Client.h.

bool Hypertable::Lib::Master::Client::m_verbose
private

Definition at line 180 of file Client.h.


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