[#536] blobovnicza: Add blobovniczatree DB cache

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-08-31 11:32:09 +03:00
parent c672f59ab8
commit 7456c8556a
10 changed files with 124 additions and 20 deletions

View file

@ -47,7 +47,7 @@ func (b *Blobovniczas) Get(ctx context.Context, prm common.GetPrm) (res common.G
if prm.StorageID != nil {
id := blobovnicza.NewIDFromBytes(prm.StorageID)
shBlz := b.openBlobovnicza(id.String())
shBlz := b.getBlobovnicza(id.String())
blz, err := shBlz.Open()
if err != nil {
return res, err
@ -93,7 +93,7 @@ func (b *Blobovniczas) Get(ctx context.Context, prm common.GetPrm) (res common.G
// returns error if object could not be read from any blobovnicza of the same level.
func (b *Blobovniczas) getObjectFromLevel(ctx context.Context, prm blobovnicza.GetPrm, blzPath string) (common.GetRes, error) {
// open blobovnicza (cached inside)
shBlz := b.openBlobovnicza(blzPath)
shBlz := b.getBlobovnicza(blzPath)
blz, err := shBlz.Open()
if err != nil {
return common.GetRes{}, err