46 #include <sys/types.h>
57 struct AppPolicy :
Policy {
58 static void init_options() {
60 (
"root",
str()->default_value(
"fs/local"),
"root directory for local "
61 "broker (if relative, it's relative to the installation directory")
63 alias(
"port",
"FsBroker.Local.Port");
64 alias(
"root",
"FsBroker.Local.Root");
65 alias(
"workers",
"FsBroker.Local.Workers");
66 alias(
"reactors",
"FsBroker.Local.Reactors");
70 typedef Meta::list<AppPolicy, FsBrokerPolicy, DefaultCommPolicy>
Policies;
75 int main(
int argc,
char **argv) {
77 init_with_policies<Policies>(argc, argv);
79 int worker_count = get_i32(
"workers");
82 port = get_i16(
"port");
83 else if (
has(
"DfsBroker.Port"))
84 port = get_i16(
"DfsBroker.Port");
86 port = get_i16(
"FsBroker.Port");
92 make_shared<FsBroker::Lib::ConnectionHandlerFactory>(comm, app_queue, broker);
93 InetAddr listen_addr(INADDR_ANY, port);
95 comm->listen(listen_addr, handler_factory);
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.
Po::typed_value< String > * str(String *v=0)
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.
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.
Internet address wrapper classes and utility functions.
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.
Error codes, Exception handling, error logging.