startSortHandler is the handler called for the HTTP endpoint /v1/sort/start. There are three major phases to this function: 1. extractLocalShards 2. participateInRecordDistribution 3. distributeShardRecords
(w http.ResponseWriter, r *http.Request)
| 401 | // 2. participateInRecordDistribution |
| 402 | // 3. distributeShardRecords |
| 403 | func startSortHandler(w http.ResponseWriter, r *http.Request) { |
| 404 | if !checkHTTPMethod(w, r, http.MethodPost) { |
| 405 | return |
| 406 | } |
| 407 | apiItems, err := checkRESTItems(w, r, 1, apc.URLPathdSortStart.L) |
| 408 | if err != nil { |
| 409 | return |
| 410 | } |
| 411 | |
| 412 | managerUUID := apiItems[0] |
| 413 | dsortManager, exists := Managers.Get(managerUUID) |
| 414 | if !exists { |
| 415 | s := fmt.Sprintf("invalid request: job %q does not exist", managerUUID) |
| 416 | cmn.WriteErrMsg(w, r, s, http.StatusNotFound) |
| 417 | return |
| 418 | } |
| 419 | |
| 420 | go dsortManager.startDSort() |
| 421 | } |
| 422 | |
| 423 | func (m *Manager) startDSort() { |
| 424 | errHandler := func(err error) { |
no test coverage detected