| 138 | } |
| 139 | |
| 140 | int 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 | |
| 159 | int transfer_leader() { |
| 160 | CHECK_FLAG(conf); |