[#220] blobstor: Add blobovnicza tree structure to BlobStor

Add blobovnicza instance to BlobStor structure. Create blobovnicza tree in
BlobStor constructor. Implement Open/Init/Close methods.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-30 17:16:11 +03:00 committed by Alex Vanin
parent 51ab6991d2
commit d8d38d3476
2 changed files with 28 additions and 1 deletions

View file

@ -13,6 +13,8 @@ import (
// BlobStor represents NeoFS local BLOB storage. // BlobStor represents NeoFS local BLOB storage.
type BlobStor struct { type BlobStor struct {
*cfg *cfg
blobovniczas *blobovniczas
} }
// Option represents BlobStor's constructor option. // Option represents BlobStor's constructor option.
@ -80,6 +82,7 @@ func New(opts ...Option) *BlobStor {
return &BlobStor{ return &BlobStor{
cfg: c, cfg: c,
blobovniczas: newBlobovniczaTree(c),
} }
} }

View file

@ -0,0 +1,24 @@
package blobstor
// Open opens BlobStor.
func (b *BlobStor) Open() error {
b.log.Debug("opening...")
return nil
}
// Init initializes internal data structures and system resources.
//
// If BlobStor is already initialized, then no action is taken.
func (b *BlobStor) Init() error {
b.log.Debug("initializing...")
return b.blobovniczas.init()
}
// Close releases all internal resources of BlobStor.
func (b *BlobStor) Close() error {
b.log.Debug("closing...")
return b.blobovniczas.close()
}