[#1060] writecache: compress big object if needed
Small objects use `blobstor.Put`, so no changes are required. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
0d969d7a06
commit
486d5c2e86
5 changed files with 36 additions and 12 deletions
|
@ -99,6 +99,11 @@ func (c *cache) persistBigObject(objInfo objectInfo) {
|
|||
err := c.fsTree.Put(objInfo.obj.Address(), objInfo.data)
|
||||
if err == nil {
|
||||
metaIndex = 1
|
||||
if c.blobstor.NeedsCompression(objInfo.obj) {
|
||||
c.mtx.Lock()
|
||||
c.compressFlags[objInfo.addr] = struct{}{}
|
||||
c.mtx.Unlock()
|
||||
}
|
||||
c.objCounters.IncFS()
|
||||
storagelog.Write(c.log, storagelog.AddressField(objInfo.addr), storagelog.OpField("fstree PUT"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue