# Cache Tool¶

## Internals¶

type Megabytes

A Scalar type with a scale of 2~20~.

type CacheStripeBlocks

A Scalar type with a scale of 2~27~. This represents the units in which storage is allocated to stripes.

class VolumeConfig

A container for parsed cache volume configuration.

class Data

Configuration information for a single cache volume.

int _idx

The volume index, 0 if not specified in the configuration.

int _percent

Volume size if specified as a percentage, otherwise 0 if not specified.

Megabytes _size

Volume size if specified as an explicit size, otherwise 0 if not specified.

CacheStripeBlocks _alloc

Already allocated size, used during allocation computations.

class VolumeAllocator

This class provides handling for allocating storage space to stripes based on volume configuration.

class V

Cache volume data for a single cache volume.

VolumeConfig::Data const &_config

A reference to the (parsed) volume configuration for a single volume to be used for allocating storage to that cache volume.

std::vector<V> _av

Cache volume data for all the volumes in the configuration.

VolumeConfig _vols

The parsed cache volume configuration.