Commit c187f0ba authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5ed9cbc0
...@@ -140,8 +140,26 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) { ...@@ -140,8 +140,26 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) {
wg, ctx := errgroup.WithContext(ctx) wg, ctx := errgroup.WithContext(ctx)
// loadBucket loads all ZData objects from leaf BTree bucket.
loadBucket := func(b *btree.Bucket) error {
err := b.PActivate(ctx)
if err != nil {
return err
}
defer b.PDeactivate()
// XXX go through all bucket key/v -> chunktab
// XXX off < 0 !ok
// XXX off + len > blksize !ok
return nil
}
// loadBTree spawns loading of all BTree children. // loadBTree spawns loading of all BTree children.
loadBTree := func(t *btree.BTree) error { var loadBTree func(t *btree.BTree) error
loadBTree = func(t *btree.BTree) error {
err := t.PActivate(ctx) err := t.PActivate(ctx)
if err != nil { if err != nil {
return err return err
...@@ -152,7 +170,7 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) { ...@@ -152,7 +170,7 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) {
switch child := e.Child().(type) { switch child := e.Child().(type) {
case *btree.BTree: case *btree.BTree:
wg.Go(func() error { wg.Go(func() error {
return loadBtree(child) return loadBTree(child)
}) })
case *btree.Bucket: case *btree.Bucket:
...@@ -168,23 +186,6 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) { ...@@ -168,23 +186,6 @@ func (zb *ZBlk1) LoadBlkData(ctx context.Context) ([]byte, error) {
return nil return nil
} }
// loadBucket loads all ZData objects from leaf BTree bucket.
loadBucket := func(b *btree.Bucket) error {
err := b.PActivate(ctx)
if err != nil {
return err
}
defer b.PDeactivate()
// XXX go through all bucket key/v -> chunktab
// XXX off < 0 !ok
// XXX off + len > blksize !ok
return nil
}
loadBTree(zb.chunktab) // XXX err loadBTree(zb.chunktab) // XXX err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment