51 "Usage: ht_master [options] <host>[:<port>]\n\nOptions"
54 struct AppPolicy :
Policy {
55 static void init_options() {
74 MasterDispatchHandler(
bool silent) : m_silent(silent) { }
75 virtual void handle(
EventPtr &event_ptr) {
79 cout <<
"Master CRITICAL - connect error" << endl;
94 int main(
int argc,
char **argv) {
99 init_with_policies<Policies>(argc, argv);
101 int timeout = get_i32(
"timeout");
102 InetAddr addr(get_str(
"master-host"), get_i16(
"master-port"));
103 silent =
has(
"silent") && get_bool(
"silent");
112 if ((error = comm->connect(addr, dispatch_handler_ptr)) !=
Error::OK) {
114 cout <<
"Master CRITICAL - connect error" << endl;
118 this_thread::sleep_for(chrono::milliseconds(100));
124 error = shell->run();
129 const char *msg = e.what();
131 cout <<
" - " << msg;
static Comm * instance()
Creates/returns singleton instance of the Comm class.
Interface and base of config policy.
Cons< DefaultPolicy, CommPolicy > DefaultCommPolicy
Default comm layer config policy.
int main(int argc, char **argv)
PropertiesPtr properties
This singleton map stores all options.
static Endpoint parse_endpoint(const char *endpoint, int defport=0)
Parse an endpoint string in (host:port) format.
Abstract base class for application dispatch handlers registered with AsyncComm.
void init(int argc, char *argv[], const Desc *desc=NULL)
Initialize with default policy.
Po::typed_value< String > * str(String *v=0)
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Connection established event.
Desc & cmdline_desc(const char *usage)
A macro which definds global functions like get_bool(), get_str(), get_i16() etc. ...
bool has(const String &name)
Check existence of a configuration value.
Declarations for DispatchHandler.
const char * get_text(int error)
Returns a descriptive error message.
Encapsulate an internet address.
Compatibility Macros for C/C++.
Initialization helper for applications.
Connection disconnected event.
std::shared_ptr< CommandInterpreter > CommandInterpreterPtr
std::shared_ptr< CommandShell > CommandShellPtr
Declarations for HqlCommandInterpreter.
Entry point to AsyncComm service.
std::shared_ptr< Client > ClientPtr
Smart pointer to Client.
Internet address wrapper classes and utility functions.
Meta::list< MyPolicy, DefaultPolicy > Policies
This is a generic exception class for Hypertable.
std::shared_ptr< DispatchHandler > DispatchHandlerPtr
Smart pointer to DispatchHandler.
Declarations for MasterClient This file contains declarations for MasterClient, a client interface cl...
Desc & cmdline_hidden_desc()
Get the command line hidden options description (for positional options)
PositionalDesc & cmdline_positional_desc()
Get the command line positional options description.
int code() const
Returns the error code.
High-level entry point to a service; wraps a host:port pair.