Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
hermes::BufferHeader Struct Reference

#include <buffer_pool.h>

Collaboration diagram for hermes::BufferHeader:

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
 

Detailed Description

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.

Member Data Documentation

◆ id

BufferID hermes::BufferHeader::id

The unique identifier for this buffer.

◆ next_free

BufferID hermes::BufferHeader::next_free

The next free BufferID on the free list.

◆ data_offset

ptrdiff_t hermes::BufferHeader::data_offset

The offset (from the beginning of shared memory or a file) of the actual buffered data.

◆ used

u32 hermes::BufferHeader::used

The number of bytes this buffer is actually using.

◆ capacity

u32 hermes::BufferHeader::capacity

The total capacity of this buffer.

◆ device_id

DeviceID hermes::BufferHeader::device_id

An index into the array of Devices in the BufferPool that represents this buffer's Device.

◆ in_use

bool hermes::BufferHeader::in_use

True if this buffer is being used by Hermes to buffer data, false if it is free.

◆ locked

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.


The documentation for this struct was generated from the following file: