MCPcopy Index your code
hub / github.com/NVIDIA/aistore / doListRangeRequest

Function doListRangeRequest

api/multiobj.go:72–96  ·  view source on GitHub ↗

Handles multi-object (delete, prefetch, evict) operations as well as (archive, copy and ETL) transactions

(baseParams BaseParams, bck cmn.Bck, action string, msg interface{})

Source from the content-addressed store, hash-verified

70// Handles multi-object (delete, prefetch, evict) operations
71// as well as (archive, copy and ETL) transactions
72func doListRangeRequest(baseParams BaseParams, bck cmn.Bck, action string, msg interface{}) (xactID string, err error) {
73 q := bck.AddToQuery(nil)
74 switch action {
75 case apc.ActDeleteObjects, apc.ActEvictObjects:
76 baseParams.Method = http.MethodDelete
77 case apc.ActPrefetchObjects, apc.ActCopyObjects, apc.ActETLObjects:
78 baseParams.Method = http.MethodPost
79 case apc.ActArchive:
80 baseParams.Method = http.MethodPut
81 default:
82 err = fmt.Errorf("invalid action %q", action)
83 return
84 }
85 reqParams := AllocRp()
86 {
87 reqParams.BaseParams = baseParams
88 reqParams.Path = apc.URLPathBuckets.Join(bck.Name)
89 reqParams.Body = cos.MustMarshal(apc.ActionMsg{Action: action, Value: msg})
90 reqParams.Header = http.Header{cos.HdrContentType: []string{cos.ContentJSON}}
91 reqParams.Query = q
92 }
93 err = reqParams.DoHTTPReqResp(&xactID)
94 FreeRp(reqParams)
95 return
96}

Callers 9

CreateArchMultiObjFunction · 0.85
CopyMultiObjFunction · 0.85
ETLMultiObjFunction · 0.85
DeleteListFunction · 0.85
DeleteRangeFunction · 0.85
PrefetchListFunction · 0.85
PrefetchRangeFunction · 0.85
EvictListFunction · 0.85
EvictRangeFunction · 0.85

Calls 6

MustMarshalFunction · 0.92
AllocRpFunction · 0.85
FreeRpFunction · 0.85
JoinMethod · 0.80
DoHTTPReqRespMethod · 0.80
AddToQueryMethod · 0.45

Tested by

no test coverage detected