[#1048] node: Fill shard's info with its components' infos

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-12-20 13:03:06 +03:00 committed by Alex Vanin
parent 0e5410603e
commit 284188f8f9
3 changed files with 29 additions and 2 deletions

View file

@ -9,12 +9,19 @@ import (
"go.uber.org/zap"
)
// Info groups the information about write-cache.
type Info struct {
// Full path to the write-cache.
Path string
}
// 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
DumpInfo() Info
Init() error
Open() error
@ -90,6 +97,12 @@ func New(opts ...Option) Cache {
return c
}
func (c *cache) DumpInfo() Info {
return Info{
Path: c.path,
}
}
// Open opens and initializes database. Reads object counters from the ObjectCounters instance.
func (c *cache) Open() error {
err := c.openStore()