forked from TrueCloudLab/frostfs-node
[#1840] blobstor: Return info about all components
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
6d7ffefec5
commit
4b005d3178
12 changed files with 246 additions and 88 deletions
|
@ -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)
|
||||
|
|
|
@ -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{}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue