-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(storage-manager): implement cache for History::Latest
The changes introduced in #1367 were actually redundant (and incomplete): the method `is_latest` was checking that a received Sample was more recent than what is currently stored. This commit removes the redundant checks and implements a correct caching strategy by leveraging both approaches: the method `is_latest` will check if there is an entry in the cache and, if not, it will query the Storage for the latest value. In addition, the cache is now filled at initialisation. This approach has one main advantage: the Storage will only be queried for missing key expressions (because of garbage collection for old keys), hence reducing its load. * plugins/zenoh-plugin-storage-manager/src/storages_mgt/mod.rs: * plugins/zenoh-plugin-storage-manager/src/storages_mgt/service.rs Signed-off-by: Julien Loudet <[email protected]>
- Loading branch information
Showing
2 changed files
with
150 additions
and
123 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