Hermes
0.9.5-beta
Hierarchical Distributed I/O Buffering System
|
#include <buffer_pool.h>
Public Attributes | |
BufferID | id |
BufferID | next_free |
ptrdiff_t | data_offset |
u32 | used |
u32 | capacity |
DeviceID | device_id |
bool | in_use |
std::atomic< bool > | locked |
Metadata for a Hermes buffer.
An array of BufferHeaders is initialized during BufferPool initialization. For a RAM Device, one BufferHeader is created for each block. This is to facilitate splitting and merging. For non-RAM Devices, we only need one BufferHeader per buffer. A typical workflow is to retrieve a BufferHeader from a BufferID using the GetHeaderByBufferId function.
BufferID hermes::BufferHeader::id |
The unique identifier for this buffer.
ptrdiff_t hermes::BufferHeader::data_offset |
The offset (from the beginning of shared memory or a file) of the actual buffered data.
u32 hermes::BufferHeader::used |
The number of bytes this buffer is actually using.
u32 hermes::BufferHeader::capacity |
The total capacity of this buffer.
DeviceID hermes::BufferHeader::device_id |
An index into the array of Devices in the BufferPool that represents this buffer's Device.
bool hermes::BufferHeader::in_use |
True if this buffer is being used by Hermes to buffer data, false if it is free.
std::atomic<bool> hermes::BufferHeader::locked |
A simple lock that is atomically set to true when the data in this buffer is being read or written by an I/O client or the BufferOrganizer.