forked from TrueCloudLab/frostfs-s3-gw
[#417] Complete multipart upload using tree service
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
6b2ddcadd0
commit
70957d75fd
5 changed files with 86 additions and 135 deletions
|
@ -237,7 +237,7 @@ func (n *layer) PutObject(ctx context.Context, p *PutObjectParams) (*data.Object
|
|||
|
||||
n.listsCache.CleanCacheEntriesContainingObject(p.Object, p.BktInfo.CID)
|
||||
|
||||
return &data.ObjectInfo{
|
||||
objInfo := &data.ObjectInfo{
|
||||
ID: *id,
|
||||
CID: p.BktInfo.CID,
|
||||
|
||||
|
@ -250,7 +250,20 @@ func (n *layer) PutObject(ctx context.Context, p *PutObjectParams) (*data.Object
|
|||
Headers: p.Header,
|
||||
ContentType: p.Header[api.ContentType],
|
||||
HashSum: hex.EncodeToString(hash),
|
||||
}, nil
|
||||
}
|
||||
|
||||
if err = n.objCache.PutObject(objInfo); err != nil {
|
||||
n.log.Warn("couldn't add object to cache", zap.Error(err),
|
||||
zap.String("object_name", p.Object), zap.String("bucket_name", p.BktInfo.Name),
|
||||
zap.String("cid", objInfo.CID.EncodeToString()), zap.String("oid", objInfo.ID.EncodeToString()))
|
||||
}
|
||||
if err = n.namesCache.Put(objInfo.NiceName(), objInfo.Address()); err != nil {
|
||||
n.log.Warn("couldn't put obj address to name cache",
|
||||
zap.String("obj nice name", objInfo.NiceName()),
|
||||
zap.Error(err))
|
||||
}
|
||||
|
||||
return objInfo, nil
|
||||
}
|
||||
|
||||
func (n *layer) putLockObject(ctx context.Context, bktInfo *data.BucketInfo, objName string, lock *data.ObjectLock) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue