41 #include <sys/types.h>
53 (
"ceph-version",
"Show Ceph version and exit")
58 alias(
"workers",
"CephBroker.Workers");
59 alias(
"ceph_mon",
"CephBroker.MonAddr");
60 alias(
"port",
"CephBroker.Port");
62 if (
has(
"ceph-version")) {
63 cout <<
" Ceph: "<< ceph_version(NULL, NULL, NULL) << endl;
64 quick_exit(EXIT_SUCCESS);
69 typedef Meta::list<AppPolicy, FsBrokerPolicy, DefaultCommPolicy>
Policies;
71 int main (
int argc,
char **argv) {
74 init_with_policies<Policies>(argc, argv);
76 int worker_count = get_i32(
"CephBroker.Workers");
78 if (
has(
"CephBroker.Port"))
79 port = get_i16(
"CephBroker.Port");
80 else if (
has(
"DfsBroker.Port"))
81 port = get_i16(
"DfsBroker.Port");
83 port = get_i16(
"FsBroker.Port");
87 HT_INFOF(
"attemping to create new CephBroker with address %s",
properties->get_str(
"CephBroker.MonAddr").c_str());
91 make_shared<FsBroker::Lib::ConnectionHandlerFactory>(comm, app_queue, broker);
92 InetAddr listen_addr(INADDR_ANY, port);
94 comm->listen(listen_addr, chfp);
static Comm * instance()
Creates/returns singleton instance of the Comm class.
Interface and base of config policy.
Meta::list< AppPolicy, FsBrokerPolicy, DefaultCommPolicy > Policies
PropertiesPtr properties
This singleton map stores all options.
static bool unlink(const String &fname)
Unlinks (deletes) a file or directory.
Helper class for printing usage banners on the command line.
File system broker definitions.
int main(int argc, char **argv)
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.
File system utility functions.
std::shared_ptr< ConnectionHandlerFactory > ConnectionHandlerFactoryPtr
Smart pointer to ConnectionHandlerFactory.
static void init_options()
Encapsulate an internet address.
Compatibility Macros for C/C++.
Initialization helper for applications.
std::shared_ptr< Broker > BrokerPtr
Smart pointer to Broker.
Entry point to AsyncComm service.
#define HT_INFOF(msg,...)
This is a generic exception class for Hypertable.
Declarations for ApplicationQueue.
void alias(const String &cmdline_opt, const String &file_opt, bool overwrite)
Setup command line option alias for config file option.
std::shared_ptr< ApplicationQueue > ApplicationQueuePtr
Shared smart pointer to ApplicationQueue object.