Flash-backed persistent key-value store (KVS) with integrated wear-leveling.
Instances are declared as instances of pw::kvs::KeyValueStoreBuffer<MAX_ENTRIES, MAX_SECTORS>
, which allocates buffers for tracking entries and flash sectors.
Classes | |
class | Item |
Representation of a key-value entry during iteration. More... | |
class | iterator |
Supported iteration methods. More... | |
struct | StorageStats |
Public Types | |
using | const_iterator = iterator |
Public Member Functions | |
Status | Init () |
bool | initialized () const |
StatusWithSize | Get (std::string_view key, span< std::byte > value, size_t offset_bytes=0) const |
template<typename Pointer , typename = std::enable_if_t<std::is_pointer<Pointer>::value>> | |
Status | Get (const std::string_view &key, const Pointer &pointer) const |
template<typename T , typename std::enable_if_t< ConvertsToSpan< T >::value > * = nullptr> | |
Status | Put (const std::string_view &key, const T &value) |
template<typename T , typename std::enable_if_t<!ConvertsToSpan< T >::value > * = nullptr> | |
Status | Put (const std::string_view &key, const T &value) |
Status | Delete (std::string_view key) |
StatusWithSize | ValueSize (std::string_view key) const |
Status | HeavyMaintenance () |
Status | FullMaintenance () |
Status | PartialMaintenance () |
void | LogDebugInfo () const |
iterator | begin () const |
iterator | end () const |
size_t | size () const |
size_t | total_entries_with_deleted () const |
size_t | max_size () const |
size_t | empty () const |
uint32_t | transaction_count () const |
StorageStats | GetStorageStats () const |
size_t | redundancy () const |
bool | error_detected () const |
size_t | max_key_value_size_bytes () const |
bool | CheckForErrors () |
Static Public Member Functions | |
static constexpr size_t | max_key_value_size_bytes (size_t partition_sector_size_bytes) |
Protected Types | |
using | Address = FlashPartition::Address |
using | Entry = internal::Entry |
using | KeyDescriptor = internal::KeyDescriptor |
using | SectorDescriptor = internal::SectorDescriptor |
Protected Member Functions | |
KeyValueStore (FlashPartition *partition, span< const EntryFormat > formats, const Options &options, size_t redundancy, Vector< SectorDescriptor > §or_descriptor_list, const SectorDescriptor **temp_sectors_to_skip, Vector< KeyDescriptor > &key_descriptor_list, Address *addresses) | |