hycdong commented on a change in pull request #603:
URL: https://github.com/apache/incubator-pegasus/pull/603#discussion_r502157946
##########
File path: src/server/pegasus_server_impl.cpp
##########
@@ -2798,5 +2800,28 @@ void
pegasus_server_impl::set_ingestion_status(dsn::replication::ingestion_statu
_ingestion_status = status;
}
+void pegasus_server_impl::on_detect_hotkey(const
dsn::replication::detect_hotkey_request &req,
+
dsn::replication::detect_hotkey_response &resp)
+{
+
+ if (dsn_unlikely(req.action != dsn::replication::detect_action::START &&
+ req.action != dsn::replication::detect_action::STOP)) {
+ resp.err = dsn::ERR_OBJECT_NOT_FOUND;
+ resp.__set_err_hint("invalid detect_action");
+ return;
+ }
+
+ if (dsn_unlikely(req.type != dsn::replication::hotkey_type::READ &&
+ req.type != dsn::replication::hotkey_type::WRITE)) {
+ resp.err = dsn::ERR_OBJECT_NOT_FOUND;
+ resp.__set_err_hint("invalid hotkey_type");
+ return;
+ }
Review comment:
I think check if detect_action and hotkey_type can be implmented in
`replica_stub::on_detect_hotkey` function, besides its error code should be
`ERR_INVALID_PARAMETERS`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]