-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make KVItem.Value() method asynchronous, and return error.
KVItem.Value() now takes a func that is called with the slice containing the bytes for the value. This slice directly references the memory map for the value log. It allows us to avoid copying bytes from the mmap-ed value log. Other related changes: * Add a field to KVItem to hold a reference to the corresponding KV. * Add a field to KVItem to track whether the value has been prefetched. * Add a field to KVItem to record any errors during prefetching. * Change the semantics of iteration. We don’t fetch values by design anymore. So FetchValues does not apply normally. It only applies in the case of prefetching. So renamed it to PrefetchValues. PrefetchSize now only applies if PrefetchValues is true. * If PrefetchValues is true, we copy values from mmap and set item.val. * Remove KV.FillValue() method. We don’t fetch value synchronously anymore, this method is not relevant. * Refactor some private methods in value.go * Fixes to tests. Added a helper method to asynchronously retrieve the value and assign it to a variable.
- Loading branch information
1 parent
b87ae27
commit b9aae1b
Showing
7 changed files
with
257 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.