|
The SwappyItems Key-Values Store
|
The SwappyItems Store is a flexible c++17 multicore single disk key-value storage. If the data in RAM gets large, it behaves similar to your system swap, but with more parameters and it swaps only the data - not the program code!
Main difference to other key-value stores:
SwappyItems.hpp)Go to the Documentation of SwappyItems or take a look to the SwappyItems Source Code.
Only the examples (see Makefile) need -lz -losmpbf -lprotobuf (additional libs) for phrasing OSM data.
vector<key> data can be very big, SwappyItems should additionally swap data from RAM to DISK, if to many items and vector elements are in RAM.key as a prio bucket and vector<key> with all keys with same prio. These keys are the keys from the 2nd SwappyItems Store, where the original data items is stored.examples/SwappyQueueTest/ folderIt trys to SwappyItems::wakeup() from hibernate files. The id parameter identifies the SwappyItems Store (important for the DISK/swap path!).
Makes a SwappyItems::hibernate() from RAM to DISK.
Set or create an item. It returns false, if the item is created (and not overwritten).
Set or create an item. It returns false, if the item is created (and not overwritten). You can add a vector with additional keys in it.
Get the value by key. You get a pointer to that data pair. If it does not exist, you get a nullptr.
Delete a item.
Get the smallest or the biggest key in the SwappyItems Store.
You get a SwappyItems::statistic_s with many values (inserts, sizes, deletes, lookup failures, ...) to deploy the SwappyItems Store.
true, the each() breaks)false if the loop did not break and iterated through all itemsIt is usable with a lambda function and similar to SwappyItems::get() and SwappyItems::set(). It does not change the swap data and behavior and thus this access it a bit slow. If you want to get or change data in the same SwappyItems store, where you iter through with SwappyItems::each(), then you must use SwappyItems::apply() in the lambda function of SwappyItems::each(). It returns false if the item does not exit.