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

Function SortHandler

dsort/handler.go:332–360  ·  view source on GitHub ↗

TARGET ////// SortHandler is the handler called for the HTTP endpoint /v1/sort.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

330
331// SortHandler is the handler called for the HTTP endpoint /v1/sort.
332func SortHandler(w http.ResponseWriter, r *http.Request) {
333 apiItems, err := checkRESTItems(w, r, 1, apc.URLPathdSort.L)
334 if err != nil {
335 return
336 }
337
338 switch apiItems[0] {
339 case apc.Init:
340 initSortHandler(w, r)
341 case apc.Start:
342 startSortHandler(w, r)
343 case apc.Records:
344 recordsHandler(Managers)(w, r)
345 case apc.Shards:
346 shardsHandler(Managers)(w, r)
347 case apc.Abort:
348 abortSortHandler(w, r)
349 case apc.Remove:
350 removeSortHandler(w, r)
351 case apc.List:
352 listSortHandler(w, r)
353 case apc.Metrics:
354 metricsHandler(w, r)
355 case apc.FinishedAck:
356 finishedAckHandler(w, r)
357 default:
358 cmn.WriteErrMsg(w, r, "invalid path")
359 }
360}
361
362// initSortHandler is the handler called for the HTTP endpoint /v1/sort/init.
363// It is responsible for initializing the dSort manager so it will be ready

Callers

nothing calls this directly

Calls 11

WriteErrMsgFunction · 0.92
initSortHandlerFunction · 0.85
startSortHandlerFunction · 0.85
recordsHandlerFunction · 0.85
shardsHandlerFunction · 0.85
abortSortHandlerFunction · 0.85
removeSortHandlerFunction · 0.85
listSortHandlerFunction · 0.85
metricsHandlerFunction · 0.85
finishedAckHandlerFunction · 0.85
checkRESTItemsFunction · 0.70

Tested by

no test coverage detected