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

Function run_command

tools/braft_cli.cpp:184–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184int run_command(const std::string& cmd) {
185 if (cmd == "add_peer") {
186 return add_peer();
187 }
188 if (cmd == "remove_peer") {
189 return remove_peer();
190 }
191 if (cmd == "change_peers") {
192 return change_peers();
193 }
194 if (cmd == "reset_peer") {
195 return reset_peer();
196 }
197 if (cmd == "snapshot") {
198 return snapshot();
199 }
200 if (cmd == "transfer_leader") {
201 return transfer_leader();
202 }
203 LOG(ERROR) << "Unknown command `" << cmd << '\'';
204 return -1;
205}
206
207} // namespace cli
208} // namespace raft

Callers 1

mainFunction · 0.85

Calls 6

add_peerFunction · 0.70
remove_peerFunction · 0.70
change_peersFunction · 0.70
reset_peerFunction · 0.70
snapshotFunction · 0.70
transfer_leaderFunction · 0.70

Tested by

no test coverage detected