[#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:
parent
51ab6991d2
commit
d8d38d3476
2 changed files with 28 additions and 1 deletions
|
@ -13,6 +13,8 @@ import (
|
|||
// BlobStor represents NeoFS local BLOB storage.
|
||||
type BlobStor struct {
|
||||
*cfg
|
||||
|
||||
blobovniczas *blobovniczas
|
||||
}
|
||||
|
||||
// Option represents BlobStor's constructor option.
|
||||
|
@ -79,7 +81,8 @@ func New(opts ...Option) *BlobStor {
|
|||
}
|
||||
|
||||
return &BlobStor{
|
||||
cfg: c,
|
||||
cfg: c,
|
||||
blobovniczas: newBlobovniczaTree(c),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
24
pkg/local_object_storage/blobstor/control.go
Normal file
24
pkg/local_object_storage/blobstor/control.go
Normal 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()
|
||||
}
|
Loading…
Reference in a new issue