etcd: add kvdb.Prefetch

This commit extends the kvdb interface in a backwards compatible way
such that we'll be able to prefetch all keys in a bucket in one go reducing the
number of roundtrips.
This commit is contained in:
Andras Banki-Horvath committed 2021-09-14 13:12:22 +02:00
1 parent daec66a4e4
commit 256b62e0d5
3 files changed
+77

No files matched your search

+7
View File
@@ -41,6 +41,13 @@ func rootBucket(tx *readWriteTx) *readWriteBucket {
return newReadWriteBucket(tx, tx.rootBucketID[:], tx.rootBucketID[:])
}
// RootBucket will return a handle to the root bucket. This is not a real handle
// but just a wrapper around the root bucket ID to allow derivation of child
// keys.
func (tx *readWriteTx) RootBucket() walletdb.ReadBucket {
return rootBucket(tx)
}
// ReadBucket opens the root bucket for read only access. If the bucket
// described by the key does not exist, nil is returned.
func (tx *readWriteTx) ReadBucket(key []byte) walletdb.ReadBucket {