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

Method proxyStartSortHandler

ais/prxdsort.go:17–41  ·  view source on GitHub ↗

POST /v1/sort

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

Source from the content-addressed store, hash-verified

15
16// POST /v1/sort
17func (p *proxy) proxyStartSortHandler(w http.ResponseWriter, r *http.Request) {
18 rs := &dsort.RequestSpec{}
19 if cmn.ReadJSON(w, r, &rs) != nil {
20 return
21 }
22 parsedRS, err := rs.Parse()
23 if err != nil {
24 p.writeErr(w, r, err)
25 return
26 }
27
28 bck := cluster.CloneBck(&parsedRS.Bck)
29 args := bckInitArgs{p: p, w: w, r: r, bck: bck, headRemB: true, perms: apc.AceObjLIST | apc.AceGET}
30 if _, err = args.initAndTry(bck.Name); err != nil {
31 return
32 }
33
34 bck = cluster.CloneBck(&parsedRS.OutputBck)
35 args = bckInitArgs{p: p, w: w, r: r, bck: bck, headRemB: true, perms: apc.AcePUT}
36 if _, err = args.initAndTry(bck.Name); err != nil {
37 return
38 }
39
40 dsort.ProxyStartSortHandler(w, r, parsedRS)
41}

Callers 1

dsortHandlerMethod · 0.95

Calls 6

ParseMethod · 0.95
initAndTryMethod · 0.95
ReadJSONFunction · 0.92
CloneBckFunction · 0.92
ProxyStartSortHandlerFunction · 0.92
writeErrMethod · 0.80

Tested by

no test coverage detected