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

Method prepTxnClient

ais/prxtxn.go:976–998  ·  view source on GitHub ↗

misc helpers and utilities

(msg *apc.ActionMsg, bck *cluster.Bck, waitmsync bool)

Source from the content-addressed store, hash-verified

974///
975
976func (p *proxy) prepTxnClient(msg *apc.ActionMsg, bck *cluster.Bck, waitmsync bool) *txnClientCtx {
977 c := &txnClientCtx{p: p, uuid: cos.GenUUID(), smap: p.owner.smap.get()}
978 c.msg = p.newAmsg(msg, nil, c.uuid)
979 body := cos.MustMarshal(c.msg)
980
981 query := make(url.Values, 2)
982 if bck == nil {
983 c.path = apc.URLPathTxn.S
984 } else {
985 c.path = apc.URLPathTxn.Join(bck.Name)
986 query = bck.AddToQuery(query)
987 }
988 config := cmn.GCO.Get()
989 c.timeout.netw = 2 * config.Timeout.MaxKeepalive.D()
990 c.timeout.host = config.Timeout.MaxHostBusy.D()
991 if !waitmsync { // when commit does not block behind metasync
992 query.Set(apc.QparamNetwTimeout, cos.UnixNano2S(int64(c.timeout.netw)))
993 }
994 query.Set(apc.QparamHostTimeout, cos.UnixNano2S(int64(c.timeout.host)))
995
996 c.req = cmn.HreqArgs{Method: http.MethodPost, Query: query, Body: body}
997 return c
998}
999
1000// rollback create-bucket
1001func (p *proxy) undoCreateBucket(msg *apc.ActionMsg, bck *cluster.Bck) {

Callers 11

createBucketMethod · 0.95
makeNCopiesMethod · 0.95
setBucketPropsMethod · 0.95
renameBucketMethod · 0.95
tcbMethod · 0.95
tcobjsMethod · 0.95
ecEncodeMethod · 0.95
createArchMultiObjMethod · 0.95
startMaintenanceMethod · 0.95
destroyBucketMethod · 0.95
promoteMethod · 0.95

Calls 10

GenUUIDFunction · 0.92
MustMarshalFunction · 0.92
UnixNano2SFunction · 0.92
newAmsgMethod · 0.80
JoinMethod · 0.80
DMethod · 0.80
getMethod · 0.65
GetMethod · 0.65
SetMethod · 0.65
AddToQueryMethod · 0.45

Tested by

no test coverage detected