[#188] shard: Implement SetMode method

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-19 15:56:10 +03:00 committed by Alex Vanin
parent 2fb379b7dd
commit 3fa3661cad
2 changed files with 16 additions and 0 deletions

View file

@ -4,12 +4,15 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobstor"
meta "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/metabase"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
"go.uber.org/atomic"
)
// Shard represents single shard of NeoFS Local Storage Engine.
type Shard struct {
*cfg
mode *atomic.Uint32
weight WeightValues
blobStor *blobstor.BlobStor
@ -44,6 +47,7 @@ func New(opts ...Option) *Shard {
return &Shard{
cfg: c,
mode: atomic.NewUint32(0), // TODO: init with particular mode
blobStor: blobstor.New(c.blobOpts...),
metaBase: meta.NewDB(c.metaOpts...),
}