[#661] blobovniczatree: Do not sort DB's and indicies

Put stores object to next active DB, so there is no need to sort DBs.
In addition, it adds unnecessary DB openings.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-10-10 18:22:53 +03:00
parent 52c625df0f
commit f8606db7f2

View file

@ -128,7 +128,9 @@ func (b *Blobovniczas) iterateSorted(ctx context.Context, addr *oid.Address, cur
} }
indices := indexSlice(levelWidth) indices := indexSlice(levelWidth)
hrw.SortSliceByValue(indices, addressHash(addr, filepath.Join(curPath...))) if !isLeafLevel {
hrw.SortSliceByValue(indices, addressHash(addr, filepath.Join(curPath...)))
}
exec := uint64(len(curPath)) == execDepth exec := uint64(len(curPath)) == execDepth
@ -243,7 +245,6 @@ func (b *Blobovniczas) iterateSordedDBPathsInternal(ctx context.Context, path st
} }
if len(dbIdxs) > 0 { if len(dbIdxs) > 0 {
hrw.SortSliceByValue(dbIdxs, addressHash(&addr, path))
for _, dbIdx := range dbIdxs { for _, dbIdx := range dbIdxs {
dbPath := filepath.Join(path, u64ToHexStringExt(dbIdx)) dbPath := filepath.Join(path, u64ToHexStringExt(dbIdx))
stop, err := f(dbPath) stop, err := f(dbPath)