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

#include <volume.h>

Public Member Functions

std::tuple< aku_Status, uint32_t > get_nblocks (uint32_t id) const
 Get number of blocks in the volume.
 
std::tuple< aku_Status, uint32_t > get_capacity (uint32_t id) const
 Get total capacity of the volume.
 
std::tuple< aku_Status, uint32_t > get_generation (uint32_t id) const
 Get volume's generation.
 
size_t get_nvolumes () const
 
aku_Status update (uint32_t id, uint32_t nblocks, uint32_t capacity, uint32_t gen)
 
aku_Status set_nblocks (uint32_t id, uint32_t nblocks)
 Set number of used blocks for the volume.
 
aku_Status set_capacity (uint32_t id, uint32_t nblocks)
 Set volume capacity.
 
aku_Status set_generation (uint32_t id, uint32_t nblocks)
 Set generation.
 
void flush ()
 Flush entire file.
 
aku_Status flush (uint32_t id)
 Flush one entry.
 

Static Public Member Functions

static void create_new (const char *path, size_t capacity, uint32_t const *vol_capacities)
 
static std::unique_ptr
< MetaVolume
open_existing (const char *path)
 

Detailed Description

Class that represents metadata volume. MetaVolume is a file that contains some information about each regullar volume - write position, generation, etc.

Hardware asumptions. At this point we assume that disck sector size is 4KB and sector writes are atomic (each write less or equal to 4K will be fully written to disk or not, FS checksum failure is a hardware bug, not a result of the partial sector write).

Member Function Documentation

void Akumuli::StorageEngine::MetaVolume::create_new ( const char *  path,
size_t  capacity,
uint32_t const *  vol_capacities 
)
static

Create new meta-volume.

Parameters
pathPath to created file.
capacitySize of the created file (in blocks).
vol_capacitiesArray of capacities of all volumes.
Exceptions
std::runtime_exception
std::unique_ptr< MetaVolume > Akumuli::StorageEngine::MetaVolume::open_existing ( const char *  path)
static

Open existing meta-volume.

Parameters
pathPath to meta-volume.
Exceptions
std::runtime_erroron error.
Returns
new MetaVolume instance.

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