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

Method objMv

ais/proxy.go:2160–2181  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, bck *cluster.Bck, objName string, msg *apc.ActionMsg)

Source from the content-addressed store, hash-verified

2158}
2159
2160func (p *proxy) objMv(w http.ResponseWriter, r *http.Request, bck *cluster.Bck, objName string, msg *apc.ActionMsg) {
2161 started := time.Now()
2162 if objName == msg.Name {
2163 p.writeErrMsg(w, r, "the new and the current name are the same")
2164 return
2165 }
2166 smap := p.owner.smap.get()
2167 si, err := cluster.HrwTarget(bck.MakeUname(objName), &smap.Smap)
2168 if err != nil {
2169 p.writeErr(w, r, err)
2170 return
2171 }
2172 if glog.FastV(4, glog.SmoduleAIS) {
2173 glog.Infof("%q %s/%s => %s", msg.Action, bck.Name, objName, si)
2174 }
2175
2176 // NOTE: Code 307 is the only way to http-redirect with the original JSON payload.
2177 redirectURL := p.redirectURL(r, si, started, cmn.NetIntraControl)
2178 http.Redirect(w, r, redirectURL, http.StatusTemporaryRedirect)
2179
2180 p.statsT.Add(stats.RenameCount, 1)
2181}
2182
2183func (p *proxy) doListRange(method, bucket string, msg *apc.ActionMsg, query url.Values) (xactID string, err error) {
2184 var (

Callers 1

httpobjpostMethod · 0.95

Calls 9

redirectURLMethod · 0.95
HrwTargetFunction · 0.92
FastVFunction · 0.92
InfofFunction · 0.92
writeErrMsgMethod · 0.80
writeErrMethod · 0.80
getMethod · 0.65
AddMethod · 0.65
MakeUnameMethod · 0.45

Tested by

no test coverage detected