LogDevice API
Public Member Functions | Static Public Member Functions | Friends | List of all members
facebook::logdevice::ClientSettings Class Reference

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 ClientSettingscreate ()
 

Friends

class ClientSettingsImpl
 

Member Function Documentation

◆ create()

static ClientSettings* facebook::logdevice::ClientSettings::create ( )
static

Creates an instance with default settings.

◆ get()

folly::Optional<std::string> facebook::logdevice::ClientSettings::get ( const std::string &  name)
Parameters
namesetting name
Returns
If the setting exists, returns the value in a string format, otherwise folly::none

◆ getAll()

std::vector<std::pair<std::string, std::string> > facebook::logdevice::ClientSettings::getAll ( )
Returns
Returns a vector of <setting, value> pairs for all settings

◆ isOverridden()

bool facebook::logdevice::ClientSettings::isOverridden ( const std::string &  name)
Parameters
namesetting name
Returns
If the setting was overridden by calling the set() method on this instance, returns true. False otherwise.

◆ set() [1/2]

int facebook::logdevice::ClientSettings::set ( const char *  name,
const char *  value 
)

Changes a setting.

Parameters
namesetting name, as would be provided on the server command line (see Settings::addOptions() in logdevice/common/Settings.cpp)
valuestring 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.

Returns
On success, returns 0. On failure, returns -1 and sets logdevice::err to:

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

◆ set() [2/2]

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.


The documentation for this class was generated from the following file: