Furrballs v0.0.1
A Caching and Storage Solution
Loading...
Searching...
No Matches
FurrBall Class Referencefinal

A Cache with size_t as Keys, void* as values and ARC eviction policy. More...

#include <Furrballs.h>

Classes

struct  ImplDetail
 

Public Member Functions

 FurrBall (const FurrBall &cpy)=delete
 
 FurrBall (FurrBall &&mv) noexcept
 
void * Get (void *vAddress) noexcept
 
void StoreLargeData (void *buffer, size_t size)
 Large data is stored seperate and a pointer to it is added to the cache.
 
const LockablePage * GenerateLockablePage ()
 
const Page * SetPageToLockable (Page *page)
 
void LockPage (const Page *page)
 
 ~FurrBall () noexcept
 Cleans up.
 

Static Public Member Functions

static FurrBallCreateBall (std::string DBpath, size_t PageSize, size_t numPages, bool overwrite=false) noexcept
 Constructs a DB and allocates the Cache (with it's pages).
 

Detailed Description

Furrballs are a LZ4 Compressed DB using RocksDB with Cache and Paging Logic.

Definition at line 312 of file Furrballs.h.

Constructor & Destructor Documentation

◆ FurrBall() [1/2]

FurrBall ( const FurrBall & cpy)
delete

◆ FurrBall() [2/2]

FurrBall ( FurrBall && mv)
inlinenoexcept

Definition at line 353 of file Furrballs.h.

◆ ~FurrBall()

~FurrBall ( )
noexcept

Definition at line 67 of file Furrballs.cpp.

Member Function Documentation

◆ 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
DBpaththe Path to create (or load) a DB.
PageSizeThe 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.
numPagesThe number of pages to preallocate.
overwriteIf 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

Definition at line 392 of file Furrballs.h.

◆ 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
vAddressa 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

Definition at line 400 of file Furrballs.h.

◆ SetPageToLockable()

const Page * SetPageToLockable ( Page * page)
inline

Definition at line 396 of file Furrballs.h.

Referenced by FurrBall::LockPage().

◆ StoreLargeData()

void StoreLargeData ( void * buffer,
size_t size )
Parameters
bufferThe original data, a pointer to it is stored in the cache to avoid copying and moving data. Do not free.
sizeBuffer size.

Definition at line 62 of file Furrballs.cpp.


The documentation for this class was generated from the following files: