MCPcopy
hub / github.com/NVIDIA/aistore / startSortHandler

Function startSortHandler

dsort/handler.go:403–421  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

401// 2. participateInRecordDistribution
402// 3. distributeShardRecords
403func 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
423func (m *Manager) startDSort() {
424 errHandler := func(err error) {

Callers 1

SortHandlerFunction · 0.85

Calls 5

WriteErrMsgFunction · 0.92
checkHTTPMethodFunction · 0.85
startDSortMethod · 0.80
checkRESTItemsFunction · 0.70
GetMethod · 0.65

Tested by

no test coverage detected