A Cache with size_t as Keys, void* as values and ARC eviction policy.
More...
#include <Furrballs.h>
|
static FurrBall * | CreateBall (std::string DBpath, size_t PageSize, size_t numPages, bool overwrite=false) noexcept |
| Constructs a DB and allocates the Cache (with it's pages).
|
|
Furrballs are a LZ4 Compressed DB using RocksDB with Cache and Paging Logic.
Definition at line 312 of file Furrballs.h.
◆ FurrBall() [1/2]
◆ FurrBall() [2/2]
◆ ~FurrBall()
◆ CreateBall()
FurrBall * CreateBall |
( |
std::string | DBpath, |
|
|
size_t | PageSize, |
|
|
size_t | numPages, |
|
|
bool | overwrite = false ) |
|
staticnoexcept |
Uses Paging to avoid loading the entire DB in memory and only loads following the ARC eviction policy
- Parameters
-
DBpath | the Path to create (or load) a DB. |
PageSize | The Page size in bytes. This acts as a hint to calculate the optimal Page size, the result will be equal or larger than the specified size. Set to 0 if you want the library to decide the optimal size. MUST BE POWER OF 2. |
numPages | The number of pages to preallocate. |
overwrite | If DBpath points to an existing DB and this is true it will be overwritten instead of Loaded. |
- See also
- ARCPolicy
Definition at line 21 of file Furrballs.cpp.
◆ GenerateLockablePage()
const LockablePage * GenerateLockablePage |
( |
| ) |
|
|
inline |
◆ Get()
void * Get |
( |
void * | vAddress | ) |
|
|
inlinenoexcept |
Returns a pointer to the page that contains the vAddress. if vAddress is not found and is far from all pages available Get() doesn't create an entry and considers the vAddress to be invalid to preserve "contingency".
- Parameters
-
vAddress | a pointer to a virtual address used to index into the cache. |
- Returns
- a valid Pointer to memory on success or nullptr_t on error.
Definition at line 379 of file Furrballs.h.
◆ LockPage()
void LockPage |
( |
const Page * | page | ) |
|
|
inline |
◆ SetPageToLockable()
const Page * SetPageToLockable |
( |
Page * | page | ) |
|
|
inline |
◆ StoreLargeData()
void StoreLargeData |
( |
void * | buffer, |
|
|
size_t | size ) |
- Parameters
-
buffer | The original data, a pointer to it is stored in the cache to avoid copying and moving data. Do not free. |
size | Buffer size. |
Definition at line 62 of file Furrballs.cpp.
The documentation for this class was generated from the following files: