-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit aims to improve the internal bmcd persistency: * Its more lean, no sqlite implementation anymore * Implemented a writeback mechanism that tries to reduce the amount of writes to the file system (can be disabled all together) * read cache The implementation is based on the following assumptions: * This store will only be used for internal application state. * We expect that it will contain a maximum of approximately 10 settings. * Settings are not updated frequently. Users will setup their system once and no changes can occur in weeks . The solution aims to reduce the amount of writes to the filesystem. Secondly, no additional database driver is used. The key/value store gets written as raw bytes. All to make sure the actual space on the filesystem stays as small as possible. Since the key/value store is not expected to go over 1 LEB, the whole key/value store gets written on a update, even when only one value changed. furthermore the api of the persistency store got extended, differentiating between try_* and get/set. Non-try functions will panic on serialization errors, or when the given key is not registered. A persistency component gets initialized using the `PersistencyBuilder`. It enforces users to declare all the keys that are used by the application. This is to make sure to limit the possibilities of using wrong keys. Note 1: There is no migration implemented from the old sqlite implementation. This means that users will lose their settings when upgrading to this version. At the moment of writing, there are only 2 low impact key/value pairs, which does not justify writing migration code. Note 2: There is no protection implemented for trans serializing different types. Its up to the developer to make sure to use the correct data types. this commit fixes #107, turing-machines/BMC-Firmware#107
- Loading branch information
1 parent
8e6c5a4
commit f9c6524
Showing
10 changed files
with
673 additions
and
880 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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.