0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Config.cc
Go to the documentation of this file.
1 
22 #include "Common/Compat.h"
23 #include "Common/InetAddr.h"
24 #include "Config.h"
25 
26 namespace Hypertable { namespace Config {
27 
29  cmdline_desc().add_options()
30  ("fs", str(),
31  "FS client endpoint in <host:port> format")
32  ("fs-timeout", i32(),
33  "Timeout in milliseconds for FS client connections")
34  ;
35  alias("fs-timeout", "FsBroker.Timeout");
36  // hidden aliases
37  alias("fs-host", "FsBroker.Host");
38  alias("fs-port", "FsBroker.Port");
39 }
40 
42  // prepare hidden aliases to be synced
43  if (properties->has("fs")) {
44  Endpoint e = InetAddr::parse_endpoint(get_str("fs"));
45  bool defaulted = properties->defaulted("fs");
46  properties->set("fs-host", e.host, defaulted);
47  properties->set("fs-port", e.port, !e.port || defaulted);
48  }
49 }
50 
52  cmdline_desc().add_options()
53  ("port", i16(), "Listening port")
54  ("pidfile", str(), "File to contain the process id")
55  ;
56 }
57 
58 }} // namespace Hypertable::Config
PropertiesPtr properties
This singleton map stores all options.
Definition: Config.cc:47
static Endpoint parse_endpoint(const char *endpoint, int defport=0)
Parse an endpoint string in (host:port) format.
Definition: InetAddr.cc:181
void init_fs_client_options()
Definition: Config.cc:28
void init_fs_client()
Definition: Config.cc:41
Po::typed_value< uint16_t > * i16(uint16_t *v=0)
Definition: Properties.h:174
Po::typed_value< String > * str(String *v=0)
Definition: Properties.h:166
Desc & cmdline_desc(const char *usage)
A macro which definds global functions like get_bool(), get_str(), get_i16() etc. ...
Definition: Config.cc:72
Po::typed_value< int32_t > * i32(int32_t *v=0)
Definition: Properties.h:178
Compatibility Macros for C/C++.
bool defaulted(const String &name)
Check if a configuration value is defaulted.
Definition: Config.h:67
Hypertable definitions
Internet address wrapper classes and utility functions.
void init_fs_broker_options()
Definition: Config.cc:51
void alias(const String &cmdline_opt, const String &file_opt, bool overwrite)
Setup command line option alias for config file option.
Definition: Config.cc:607
High-level entry point to a service; wraps a host:port pair.
Definition: InetAddr.h:44