You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2020/10/13 07:40:44 UTC

[GitHub] [incubator-pegasus] levy5307 commented on a change in pull request #616: feat(hotkey): add a state machine of hotkey_collector

levy5307 commented on a change in pull request #616:
URL: https://github.com/apache/incubator-pegasus/pull/616#discussion_r503732876



##########
File path: src/server/hotkey_state_machine.h
##########
@@ -0,0 +1,65 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <dsn/utility/enum_helper.h>
+
+namespace pegasus {
+namespace server {
+
+//                     hotkey_collector
+//                      state machine
+// data has been cleared, +--------+
+// ready to start         |  STOP  <-----------+-------------+
+//                        +---+----+           |             |
+//                            |                |             |
+//                        Receive START RPC  Time out        |
+//                            |                +             |
+//  is running coarse     +---v----+           |             |
+//  capture and analysis  | COARSE +-----------^       Receive STOP RPC
+//                        +---+----+           |             |
+//                            |                +             |
+//                        Find a hot bucket  Time out        |
+//                            |                +             |
+//  is running fine       +---v----+           |             |
+//  capture and analysis  |  FINE  +-----------+             |
+//                        +---+----+                         |
+//                            |                              |
+//                        Find a hotkey                      |
+//                            |                              |
+//  capture and analyse   +---v----+                         |
+//  is done, ready to get | FINISH +-------------------------+
+//  the result            +--------+
+
+enum class collector_state

Review comment:
       what about hotkey_collector_state?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org