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

Function snapshot

tools/braft_cli.cpp:140–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140int snapshot() {
141 CHECK_FLAG(peer);
142 CHECK_FLAG(group);
143 PeerId target_peer;
144 if (target_peer.parse(FLAGS_peer) != 0) {
145 LOG(ERROR) << "Fail to parse --peer=`" << FLAGS_peer<< '\'';
146 return -1;
147 }
148 CliOptions opt;
149 opt.timeout_ms = FLAGS_timeout_ms;
150 opt.max_retry = FLAGS_max_retry;
151 butil::Status st = snapshot(FLAGS_group, target_peer, opt);
152 if (!st.ok()) {
153 LOG(ERROR) << "Fail to make snapshot : " << st;
154 return -1;
155 }
156 return 0;
157}
158
159int transfer_leader() {
160 CHECK_FLAG(conf);

Callers 1

run_commandFunction · 0.70

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected