Skip to content

Commit 6d6662d

Browse files
committed
update comment
1 parent 727d213 commit 6d6662d

File tree

7 files changed

+1
-22
lines changed

7 files changed

+1
-22
lines changed

src/braft/fsm_caller.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,6 @@ void FSMCaller::do_stop_following(const LeaderChangeContext& stop_following_cont
496496
_fsm->on_stop_following(stop_following_context);
497497
}
498498

499-
void FSMCaller::on_pre_send_snapshot(const PeerId& peer_id) {
500-
_fsm->on_pre_send_snapshot(peer_id);
501-
}
502-
503499
void FSMCaller::describe(std::ostream &os, bool use_html) {
504500
const char* newline = (use_html) ? "<br>" : "\n";
505501
TaskType cur_task = _cur_task;

src/braft/fsm_caller.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ class BAIDU_CACHELINE_ALIGNMENT FSMCaller {
116116
int on_leader_start(int64_t term, int64_t lease_epoch);
117117
int on_start_following(const LeaderChangeContext& start_following_context);
118118
int on_stop_following(const LeaderChangeContext& stop_following_context);
119-
void on_pre_send_snapshot(const PeerId& peer_id);
120119
BRAFT_MOCK int on_error(const Error& e);
121120
int64_t last_applied_index() const {
122121
return _last_applied_index.load(butil::memory_order_relaxed);

src/braft/node.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,11 +1367,6 @@ void NodeImpl::on_error(const Error& e) {
13671367
lck.unlock();
13681368
}
13691369

1370-
void NodeImpl::pre_send_snapshot(const PeerId& peer_id) {
1371-
_fsm_caller->on_pre_send_snapshot(peer_id);
1372-
}
1373-
1374-
13751370
void NodeImpl::handle_vote_timeout() {
13761371
std::unique_lock<raft_mutex_t> lck(_mutex);
13771372

src/braft/node.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ friend class VoteBallotCtx;
241241

242242
bool disable_cli() const { return _options.disable_cli; }
243243
bool is_witness() const { return _options.witness; }
244-
245-
// Called when leader start to send snapshot to remote peer
246-
void pre_send_snapshot(const PeerId& peer_id);
247244
private:
248245
friend class butil::RefCountedThreadSafe<NodeImpl>;
249246

src/braft/raft.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ void StateMachine::on_configuration_committed(const Configuration& conf, int64_t
313313

314314
void StateMachine::on_stop_following(const LeaderChangeContext&) {}
315315
void StateMachine::on_start_following(const LeaderChangeContext&) {}
316-
void StateMachine::on_pre_send_snapshot(const PeerId& peer_id) {}
317316

318317
BootstrapOptions::BootstrapOptions()
319318
: last_log_index(0)

src/braft/raft.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,6 @@ class StateMachine {
265265
// the very leader whom the follower starts to follow.
266266
// User can reset the node's information as it starts to follow some leader.
267267
virtual void on_start_following(const ::braft::LeaderChangeContext& ctx);
268-
269-
// Invoked when the leader start to send snapshot to |peer_id|
270-
// Default: Do nothing
271-
virtual void on_pre_send_snapshot(const PeerId& peer_id);
272-
273268
};
274269

275270
enum State {

src/braft/replicator.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ int Replicator::_prepare_entry(int offset, EntryMeta* em, butil::IOBuf *data) {
635635
} else {
636636
CHECK(entry->type != ENTRY_TYPE_CONFIGURATION) << "log_index=" << log_index;
637637
}
638-
// 优先使用group级别的配置
638+
// use group-level configuration preferentially
639639
if (is_witness() && !_options.send_data_to_witness) {
640640
entry->Release();
641641
return 0;
@@ -800,8 +800,6 @@ void Replicator::_install_snapshot() {
800800
add_one_more_task(true)) {
801801
return _block(butil::gettimeofday_us(), EBUSY);
802802
}
803-
804-
node_impl->pre_send_snapshot(_options.peer_id);
805803

806804
// pre-set replicator state to INSTALLING_SNAPSHOT, so replicator could be
807805
// blocked if something is wrong, such as throttled for a period of time

0 commit comments

Comments
 (0)