Commit fe749737 authored by Jakub Sztandera's avatar Jakub Sztandera

blocks/blockstore: Add bloom filter

Replace write_cache with bloom_cache
Improve ARC caching
Fix small issue in case of AllKeysChan fails
deps: Update go-datastore
blocks/blockstore: Invalidate ARC cache before deletin block
deps: Update go-datastore

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent 4c2d0716
......@@ -87,12 +87,13 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration {
// just a much better idea.
func Session(ctx context.Context, net tn.Network, p testutil.Identity) Instance {
bsdelay := delay.Fixed(0)
const bloomSize = 512
const writeCacheElems = 100
adapter := net.Adapter(p)
dstore := ds_sync.MutexWrap(datastore2.WithDelay(ds.NewMapDatastore(), bsdelay))
bstore, err := blockstore.WriteCached(blockstore.NewBlockstore(ds_sync.MutexWrap(dstore)), writeCacheElems)
bstore, err := blockstore.BloomCached(blockstore.NewBlockstore(ds_sync.MutexWrap(dstore)), bloomSize, writeCacheElems)
if err != nil {
panic(err.Error()) // FIXME perhaps change signature and return error.
}
......
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