[#762] storage/shard: Try to read headers from write-cache

Shard should try to read object headers from write-cache if it is enabled.

Extend `writecache.Cache` interface with `Head` method. Call the method in
`Shard.Head` if `Shard.hasWriteCache` returns true.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-08-31 14:04:58 +03:00 committed by Leonard Lyubich
parent aa2151fbeb
commit 3f293cb55e
2 changed files with 27 additions and 3 deletions

View file

@ -13,6 +13,7 @@ import (
// Cache represents write-cache for objects.
type Cache interface {
Get(*objectSDK.Address) (*object.Object, error)
Head(*objectSDK.Address) (*object.Object, error)
Delete(*objectSDK.Address) error
Put(*object.Object) error