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:
3 files changed
+77
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user