Skip to content

Commit

Permalink
use better desc
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer committed Jul 2, 2020
1 parent 036dff1 commit aadd35e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions server/api/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,16 +559,16 @@ func (h *regionsHandler) GetTopSize(w http.ResponseWriter, r *http.Request) {
}

// @Tags region
// @Summary Improve regions scheduling priority in given range
// @Summary Accelerate regions scheduling priority in given range
// @Accept json
// @Param body body object true "json params"
// @Produce json
// @Param limit query integer false "Limit count" default(16)
// @Produce json
// @Success 200 {object} string "The regions in given range have been improve schedule priority"
// @Failure 400 {string} string "The input is invalid."
// @Router /regions/keys/improve-schedule [post]
func (h *regionsHandler) ImproveRegionsSchedulePriorityInRange(w http.ResponseWriter, r *http.Request) {
// @Router /regions/keys/accelerate-schedule [post]
func (h *regionsHandler) AccelerateRegionsSchedulePriorityInRange(w http.ResponseWriter, r *http.Request) {
rc := getCluster(r.Context())
var input map[string]interface{}
if err := apiutil.ReadJSONRespondError(h.rd, w, r.Body, &input); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion server/api/region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (s *testRegionSuite) TestImproveRegionsSchedulePriorityInRange(c *C) {
r3 := newTestRegionInfo(3, 1, []byte("c"), []byte("d"), core.SetWrittenBytes(500), core.SetReadBytes(800), core.SetRegionConfVer(3), core.SetRegionVersion(2))
mustRegionHeartbeat(c, s.svr, r3)

err := postJSON(testDialClient, fmt.Sprintf("%s/regions/keys/improve-schedule", s.urlPrefix), []byte(`{"start_key":"b", "end_key": "d"}`))
err := postJSON(testDialClient, fmt.Sprintf("%s/regions/keys/accelerate-schedule", s.urlPrefix), []byte(`{"start_key":"b", "end_key": "d"}`))
c.Assert(err, IsNil)
}

Expand Down
2 changes: 1 addition & 1 deletion server/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func createRouter(ctx context.Context, prefix string, svr *server.Server) *mux.R
clusterRouter.HandleFunc("/regions/check/hist-size", regionsHandler.GetSizeHistogram).Methods("GET")
clusterRouter.HandleFunc("/regions/check/hist-keys", regionsHandler.GetKeysHistogram).Methods("GET")
clusterRouter.HandleFunc("/regions/sibling/{id}", regionsHandler.GetRegionSiblings).Methods("GET")
clusterRouter.HandleFunc("/regions/keys/improve-schedule", regionsHandler.ImproveRegionsSchedulePriorityInRange).Methods("POST")
clusterRouter.HandleFunc("/regions/keys/accelerate-schedule", regionsHandler.AccelerateRegionsSchedulePriorityInRange).Methods("POST")

apiRouter.Handle("/version", newVersionHandler(rd)).Methods("GET")
apiRouter.Handle("/status", newStatusHandler(svr, rd)).Methods("GET")
Expand Down

0 comments on commit aadd35e

Please sign in to comment.