LogDevice API
|
Public Member Functions | |
int | set (const char *name, const char *value) |
int | set (const std::string &name, const std::string &value) |
int | set (const char *name, int64_t value) |
int | set (const std::vector< std::pair< std::string, std::string >> &settings) |
folly::Optional< std::string > | get (const std::string &name) |
bool | isOverridden (const std::string &name) |
std::vector< std::pair< std::string, std::string > > | getAll () |
Static Public Member Functions | |
static ClientSettings * | create () |
Friends | |
class | ClientSettingsImpl |
|
static |
Creates an instance with default settings.
folly::Optional<std::string> facebook::logdevice::ClientSettings::get | ( | const std::string & | name | ) |
name | setting name |
std::vector<std::pair<std::string, std::string> > facebook::logdevice::ClientSettings::getAll | ( | ) |
bool facebook::logdevice::ClientSettings::isOverridden | ( | const std::string & | name | ) |
name | setting name |
int facebook::logdevice::ClientSettings::set | ( | const char * | name, |
const char * | value | ||
) |
Changes a setting.
name | setting name, as would be provided on the server command line (see Settings::addOptions() in logdevice/common/Settings.cpp) |
value | string representation of value, as would be provided on the server command line |
Settings that are commonly used on the client:
connect-timeout Connection timeout
handshake-timeout Timeout for LogDevice protocol handshake sequence
num-workers Number of worker threads on the client
client-read-buffer-size Number of records to buffer while reading
max-payload-size The maximum payload size that could be appended by the client
ssl-boundary Enable SSL in cross-X traffic, where X is the setting. Example: if set to "rack", all cross-rack traffic will be sent over SSL. Can be one of "none", "node", "rack", "row", "cluster", "dc" or "region". If a value other than "none" or "node" is specified, –my-location has to be specified as well.
my-location Specifies the location of the machine running the client. Used for determining whether to use SSL based on –ssl-boundary. Format: "{region}.{dc}.{cluster}.{row}.{rack}"
client-initial-redelivery-delay Initial delay to use when downstream rejects a record or gap
client-max-redelivery-delay Maximum delay to use when downstream rejects a record or gap
on-demand-logs-config Set this to true if you want the client to get log configuration on demand from the server when log configuration is not included in the main config file.
enable-logsconfig-manager Set this to true if you want to use the internal replicated storage for logs configuration, this will ignore loading the logs section from the config file.
UNKNOWN_SETTING name parameter was not recognized INVALID_SETTING_VALUE value was invalid (e.g. not numeric for a numeric setting) INVALID_PARAM any other error
int facebook::logdevice::ClientSettings::set | ( | const std::vector< std::pair< std::string, std::string >> & | settings | ) |
Overload to set any number of settings. If any one encounters an error, no subsequent ones are set. A log message is printed describing the one that failed.