hycdong commented on a change in pull request #662:
URL: https://github.com/apache/incubator-pegasus/pull/662#discussion_r548807328
##########
File path: src/server/hotkey_collector.cpp
##########
@@ -272,6 +276,20 @@ void
hotkey_collector::on_stop_detect(dsn::replication::detect_hotkey_response &
ddebug_replica(hint);
}
+void hotkey_collector::query_result(dsn::replication::detect_hotkey_response
&resp)
+{
+ if (_state != hotkey_collector_state::FINISHED) {
+ resp.err = dsn::ERR_BUSY;
+ std::string hint = fmt::format("hotkey is detecting now, now state:
{}",
+ dsn::enum_to_string(_hotkey_type));
+ resp.err_hint = hint;
Review comment:
I recommend use `__set_err_hint` instead.
##########
File path: src/server/hotkey_collector.cpp
##########
@@ -272,6 +276,20 @@ void
hotkey_collector::on_stop_detect(dsn::replication::detect_hotkey_response &
ddebug_replica(hint);
}
+void hotkey_collector::query_result(dsn::replication::detect_hotkey_response
&resp)
+{
+ if (_state != hotkey_collector_state::FINISHED) {
+ resp.err = dsn::ERR_BUSY;
+ std::string hint = fmt::format("hotkey is detecting now, now state:
{}",
+ dsn::enum_to_string(_hotkey_type));
+ resp.err_hint = hint;
+ ddebug_replica(hint);
+ } else {
+ resp.err = dsn::ERR_OK;
+ resp.hotkey_result = _result.hot_hash_key;
Review comment:
I recommend use `__set_hotkey_result` instead.
----------------------------------------------------------------
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]