Add a parameter to pass the initial config to client
This commit is contained in:
+4
-2
@@ -1,6 +1,6 @@
|
||||
#include "cluster_client.h"
|
||||
|
||||
cluster_client_t::cluster_client_t(ring_loop_t *ringloop, timerfd_manager_t *tfd)
|
||||
cluster_client_t::cluster_client_t(ring_loop_t *ringloop, timerfd_manager_t *tfd, json11::Json & config)
|
||||
{
|
||||
this->ringloop = ringloop;
|
||||
this->tfd = tfd;
|
||||
@@ -18,11 +18,13 @@ cluster_client_t::cluster_client_t(ring_loop_t *ringloop, timerfd_manager_t *tfd
|
||||
};
|
||||
|
||||
st_cli.tfd = tfd;
|
||||
st_cli.log_level = log_level;
|
||||
st_cli.on_load_config_hook = [this](json11::Json::object & cfg) { on_load_config_hook(cfg); };
|
||||
st_cli.on_change_osd_state_hook = [this](uint64_t peer_osd) { on_change_osd_state_hook(peer_osd); };
|
||||
st_cli.on_change_hook = [this](json11::Json::object & changes) { on_change_hook(changes); };
|
||||
st_cli.on_load_pgs_hook = [this](bool success) { on_load_pgs_hook(success); };
|
||||
|
||||
log_level = config["log_level"].int64_value();
|
||||
st_cli.parse_config(config);
|
||||
st_cli.load_global_config();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user