MCPcopy Create free account
hub / github.com/baidu/braft / remove_peer

Function remove_peer

tools/braft_cli.cpp:65–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65int remove_peer() {
66 CHECK_FLAG(conf);
67 CHECK_FLAG(peer);
68 CHECK_FLAG(group);
69 Configuration conf;
70 if (conf.parse_from(FLAGS_conf) != 0) {
71 LOG(ERROR) << "Fail to parse --conf=`" << FLAGS_conf << '\'';
72 return -1;
73 }
74 PeerId removing_peer;
75 if (removing_peer.parse(FLAGS_peer) != 0) {
76 LOG(ERROR) << "Fail to parse --peer=`" << FLAGS_peer<< '\'';
77 return -1;
78 }
79 CliOptions opt;
80 opt.timeout_ms = FLAGS_timeout_ms;
81 opt.max_retry = FLAGS_max_retry;
82 butil::Status st = remove_peer(FLAGS_group, conf, removing_peer, opt);
83 if (!st.ok()) {
84 LOG(ERROR) << "Fail to remove_peer : " << st;
85 return -1;
86 }
87 return 0;
88}
89
90int change_peers() {
91 CHECK_FLAG(new_peers);

Callers 2

run_commandFunction · 0.70
TEST_FFunction · 0.50

Calls 2

parse_fromMethod · 0.80
parseMethod · 0.80

Tested by 1

TEST_FFunction · 0.40