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

Function ProxyAbortSortHandler

dsort/handler.go:230–262  ·  view source on GitHub ↗

DELETE /v1/sort/abort

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

Source from the content-addressed store, hash-verified

228
229// DELETE /v1/sort/abort
230func ProxyAbortSortHandler(w http.ResponseWriter, r *http.Request) {
231 if !checkHTTPMethod(w, r, http.MethodDelete) {
232 return
233 }
234 _, err := checkRESTItems(w, r, 0, apc.URLPathdSortAbort.L)
235 if err != nil {
236 return
237 }
238
239 var (
240 query = r.URL.Query()
241 managerUUID = query.Get(apc.QparamUUID)
242 path = apc.URLPathdSortAbort.Join(managerUUID)
243 responses = broadcastTargets(http.MethodDelete, path, nil, nil, ctx.smapOwner.Get())
244 )
245 allNotFound := true
246 for _, resp := range responses {
247 if resp.statusCode == http.StatusNotFound {
248 continue
249 }
250 allNotFound = false
251
252 if resp.err != nil {
253 cmn.WriteErr(w, r, resp.err, resp.statusCode)
254 return
255 }
256 }
257 if allNotFound {
258 err := cmn.NewErrNotFound("%s job %q", DSortName, managerUUID)
259 cmn.WriteErr(w, r, err, http.StatusNotFound)
260 return
261 }
262}
263
264// DELETE /v1/sort
265func ProxyRemoveSortHandler(w http.ResponseWriter, r *http.Request) {

Callers 1

dsortHandlerMethod · 0.92

Calls 7

WriteErrFunction · 0.92
NewErrNotFoundFunction · 0.92
checkHTTPMethodFunction · 0.85
broadcastTargetsFunction · 0.85
JoinMethod · 0.80
checkRESTItemsFunction · 0.70
GetMethod · 0.65

Tested by

no test coverage detected