Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Merge branch 'fds_test_fix' of github.com:zhangyifan27/rdsn into fds_…
Browse files Browse the repository at this point in the history
…test_fix
  • Loading branch information
zhangyifan27 committed Oct 10, 2020
2 parents a421036 + b78b848 commit d4b3864
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions include/dsn/dist/replication/replication_app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ class replication_app_base : public replica_base

virtual ingestion_status::type get_ingestion_status() { return ingestion_status::IS_INVALID; }

virtual void on_detect_hotkey(const detect_hotkey_request &req,
/*out*/ detect_hotkey_response &resp)
{
resp.err = dsn::ERR_OBJECT_NOT_FOUND;
resp.__set_err_hint("on_detect_hotkey implementation not found");
}

public:
//
// utility functions to be used by app
Expand Down
6 changes: 6 additions & 0 deletions src/replica/replica.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,5 +459,11 @@ void replica::init_table_level_latency_counters()
}
}
}

void replica::on_detect_hotkey(const detect_hotkey_request &req, detect_hotkey_response &resp)
{
_app->on_detect_hotkey(req, resp);
}

} // namespace replication
} // namespace dsn
2 changes: 2 additions & 0 deletions src/replica/replica.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ class replica : public serverlet<replica>, public ref_counter, public replica_ba

void init_table_level_latency_counters();

void on_detect_hotkey(const detect_hotkey_request &req, /*out*/ detect_hotkey_response &resp);

private:
friend class ::dsn::replication::test::test_checker;
friend class ::dsn::replication::mutation_queue;
Expand Down
2 changes: 1 addition & 1 deletion src/replica/replica_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,7 @@ void replica_stub::on_detect_hotkey(detect_hotkey_rpc rpc)

replica_ptr rep = get_replica(request.pid);
if (rep != nullptr) {
response.err = ERR_OK;
rep->on_detect_hotkey(request, response);
} else {
response.err = ERR_OBJECT_NOT_FOUND;
response.err_hint = fmt::format("not find the replica {} \n", request.pid);
Expand Down

0 comments on commit d4b3864

Please sign in to comment.