Client interface to Master. More...
#include <Client.h>
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 |
Comm * | m_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 |
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.
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.
Master::Client::Client | ( | ConnectionManagerPtr & | conn_mgr, |
InetAddr & | addr, | ||
uint32_t | timeout_ms | ||
) |
void Master::Client::balance | ( | BalancePlan & | plan, |
Timer * | timer = 0 |
||
) |
|
private |
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 |
||
) |
void Master::Client::recreate_index_tables | ( | const std::string & | name, |
TableParts | parts, | ||
Timer * | timer = 0 |
||
) |
Carries out a recreate index tables Master operation.
name | Name of table for which to recreate index tables |
parts | Specifies which index tables to recreate |
timer | Deadline timer |
Exception | with code set to Error::REQUEST_TIMEOUT if deadline is reached before operation completes. |
void Master::Client::relinquish_acknowledge | ( | const String & | source, |
int64_t | range_id, | ||
TableIdentifier & | table, | ||
RangeSpec & | range, | ||
Timer * | timer = 0 |
||
) |
void Master::Client::replay_status | ( | int64_t | op_id, |
const String & | location, | ||
int32_t | plan_generation | ||
) |
|
private |
|
private |
void Master::Client::set_state | ( | const std::vector< SystemVariable::Spec > & | specs, |
Timer * | timer = 0 |
||
) |
|
inline |
bool Master::Client::wait_for_connection | ( | uint32_t | max_wait_ms | ) |
bool Master::Client::wait_for_connection | ( | Timer & | timer | ) |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |