mirror of
https://github.com/arnaucube/arbo.git
synced 2026-02-11 18:56:38 +01:00
Implement addBatchInDisk for big trees
Implement addBatchInDisk for big trees, which does not puts the tree in memory, and works directly over the db data, parallelizing for each CPU.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
|
||||
qt "github.com/frankban/quicktest"
|
||||
"go.vocdoni.io/dvote/db"
|
||||
"go.vocdoni.io/dvote/db/badgerdb"
|
||||
)
|
||||
|
||||
@@ -16,7 +17,7 @@ func testVirtualTree(c *qt.C, maxLevels int, keys, values [][]byte) {
|
||||
c.Assert(len(keys), qt.Equals, len(values))
|
||||
|
||||
// normal tree, to have an expected root value
|
||||
database, err := badgerdb.New(badgerdb.Options{Path: c.TempDir()})
|
||||
database, err := badgerdb.New(db.Options{Path: c.TempDir()})
|
||||
c.Assert(err, qt.IsNil)
|
||||
tree, err := NewTree(database, maxLevels, HashFunctionSha256)
|
||||
c.Assert(err, qt.IsNil)
|
||||
@@ -121,7 +122,7 @@ func TestVirtualTreeAddBatch(t *testing.T) {
|
||||
}
|
||||
|
||||
// normal tree, to have an expected root value
|
||||
database, err := badgerdb.New(badgerdb.Options{Path: c.TempDir()})
|
||||
database, err := badgerdb.New(db.Options{Path: c.TempDir()})
|
||||
c.Assert(err, qt.IsNil)
|
||||
tree, err := NewTree(database, maxLevels, HashFunctionBlake2b)
|
||||
c.Assert(err, qt.IsNil)
|
||||
|
||||
Reference in New Issue
Block a user