44 #include <sys/types.h>
58 struct AppPolicy :
Policy {
59 static void init_options() {
60 alias(
"port",
"Qfs.MetaServer.Port");
61 alias(
"host",
"Qfs.MetaServer.Name");
62 alias(
"workers",
"Qfs.Broker.Workers");
63 alias(
"reactors",
"Qfs.Broker.Reactors");
67 typedef Meta::list<AppPolicy, FsBrokerPolicy, DefaultCommPolicy>
Policies;
70 int main(
int argc,
char **argv) {
72 init_with_policies<Policies>(argc, argv);
74 int worker_count = get_i32(
"workers");
76 if (
has(
"DfsBroker.Port"))
77 port = get_i16(
"DfsBroker.Port");
79 port = get_i16(
"FsBroker.Port");
87 make_shared<FsBroker::Lib::ConnectionHandlerFactory>(comm, app_queue, broker);
88 InetAddr listen_addr(INADDR_ANY, port);
90 comm->listen(listen_addr, handler_factory);
static Comm * instance()
Creates/returns singleton instance of the Comm class.
Retrieves system information (hardware, installation directory, etc)
Interface and base of config policy.
Meta::list< AppPolicy, FsBrokerPolicy, DefaultCommPolicy > Policies
std::string KFS_BUILD_VERSION_STRING
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)
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.
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.