Struct SolidSyslogBlockStoreConfig¶
ClassList > SolidSyslogBlockStoreConfig
#include <SolidSyslogBlockStore.h>
struct SolidSyslogBlockStoreConfig
{
struct SolidSyslogBlockDevice* BlockDevice;
size_t MaxBlocks;
SolidSyslogDiscardPolicyFunction GetDiscardPolicy;
void* DiscardPolicyContext;
struct SolidSyslogSecurityPolicy* SecurityPolicy;
SolidSyslogStoreThresholdFunction GetCapacityThreshold;
SolidSyslogStoreThresholdCallback OnThresholdCrossed;
void* ThresholdContext;
};
Detailed Description¶
Wiring for SolidSyslogBlockStore_Create.
The threshold is active when GetCapacityThreshold is set, and a crossing is raised as an event whether or not OnThresholdCrossed is; each callback's context is passed back unchanged. Every injected object is caller-owned and must outlive the store; Destroy releases only the store's own slot.
Public Attributes Documentation¶
BlockDevice¶
Required: Create refuses a NULL device, and one with fewer than four blocks.
SolidSyslogNullBlockDevice_Get() says no store is wanted: Create gives the Null store and reports nothing. The block store is the sole writer.
DiscardPolicyContext¶
GetCapacityThreshold¶
Optional: no threshold when NULL.
GetDiscardPolicy¶
Asked, with DiscardPolicyContext, on a write the full store cannot fit: Oldest evicts the oldest block, Newest and Halt refuse the record.
NULL applies Oldest. Records lost either way are reported as SOLIDSYSLOG_CAT_STORE_RECORDS_LOST describes.
MaxBlocks¶
Retention ceiling in blocks, clamped to between 2 and the device's block count less 2; GetDiscardPolicy governs the overflow.
The record that takes a new block is appended before the oldest is evicted, so an eviction that fails freezes the store with one block more than this on the media, that record in it, and the next start keeps it. The write is still answered as not retained, so the record is sent directly as well, and the next start may send it again.
A start that finds more blocks than this - after such a freeze, a power cut before the eviction, or a ceiling lowered between runs - keeps them all. Under Oldest the first write that needs a new block evicts the oldest down to the ceiling before taking it, reported as any eviction is; under Newest and Halt the store is full, and refuses as a full store does.
OnThresholdCrossed¶
Optional: nothing is called when NULL.
SecurityPolicy¶
Optional: no per-record integrity trailer when NULL.
ThresholdContext¶
Shared by GetCapacityThreshold and OnThresholdCrossed.
The documentation for this class was generated from the following file Core/Interface/SolidSyslogBlockStore.h