Akumuli
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Static Public Member Functions | List of all members
Akumuli::StorageEngine::Volume Class Reference

Public Member Functions

void reset ()
 
std::tuple< aku_Status, BlockAddr > append_block (const uint8_t *source)
 Append block to file (source size should be 4 at least BLOCK_SIZE)
 
void flush ()
 Flush volume.
 
aku_Status read_block (uint32_t ix, uint8_t *dest) const
 Read filxed size block from file.
 
uint32_t get_size () const
 Return size in blocks.
 

Static Public Member Functions

static void create_new (const char *path, size_t capacity)
 
static std::unique_ptr< Volumeopen_existing (const char *path, size_t pos)
 

Member Function Documentation

void Akumuli::StorageEngine::Volume::create_new ( const char *  path,
size_t  capacity 
)
static

Create new volume.

Parameters
pathPath to volume.
capacitySize of the volume in blocks.
Exceptions
std::runtime_exceptionon error.
std::unique_ptr< Volume > Akumuli::StorageEngine::Volume::open_existing ( const char *  path,
size_t  pos 
)
static

Open volume.

Exceptions
std::runtime_erroron error.
Parameters
pathPath to volume file.
posWrite position inside volume (in blocks).
Returns
New instance of V2::Volume.

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