[#1840] blobstor: Return info about all components

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-10-05 15:41:36 +03:00 committed by fyrchik
parent 6d7ffefec5
commit 4b005d3178
12 changed files with 246 additions and 88 deletions

View file

@ -5,7 +5,6 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/common"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/compression"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/fstree"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard/mode"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
@ -26,7 +25,16 @@ type BlobStor struct {
mode mode.Mode
}
type Info = fstree.Info
// Info contains information about blobstor.
type Info struct {
SubStorages []SubStorageInfo
}
// SubStorageInfo contains information about blobstor storage component.
type SubStorageInfo struct {
Type string
Path string
}
// Option represents BlobStor's constructor option.
type Option func(*cfg)

View file

@ -1,13 +1,14 @@
package blobstor
import "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor/fstree"
// DumpInfo returns information about blob stor.
func (b *BlobStor) DumpInfo() fstree.Info {
func (b *BlobStor) DumpInfo() Info {
sub := make([]SubStorageInfo, len(b.storage))
for i := range b.storage {
if b.storage[i].Storage.Type() == "fstree" {
return b.storage[i].Storage.(*fstree.FSTree).Info
}
sub[i].Path = b.storage[i].Storage.Path()
sub[i].Type = b.storage[i].Storage.Type()
}
return Info{
SubStorages: sub,
}
return fstree.Info{}
}