Table of Contents

Class BackupRetentionPolicy

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Which points a store keeps (05 §3, ADR-030's dual limit). Every value is load-bearing, so every one is stated: there is no default, and 0 means "no limit" for the limits, never a sentinel.

public sealed class BackupRetentionPolicy
Inheritance
BackupRetentionPolicy
Inherited Members

Remarks

The restorable points are walked newest first. A point is kept while it is among the newest MinKeep, or while it is within MaxAge AND among the newest MaxCount AND the packs every kept point needs stay within MaxTotalBytes; the walk stops at the first point that is not kept. KeepLastDrilled moves the cutoff back to the newest point whose drill passed.

MinKeep and KeepLastDrilled beat every limit: a limit they prevent is reported (BackupRetentionBlock), never met by deleting. MaxTotalBytes bounds the store in steady state; a compaction writes a whole image before the packs it replaces are deleted.

Constructors

BackupRetentionPolicy()

public BackupRetentionPolicy()

Properties

CompactThreshold

Compact a chain's head when a restore of it would read more packs than this. 0 = never; else at least 2 (a depth of 1 is already a base).

public required int CompactThreshold { get; init; }

Property Value

int

KeepLastDrilled

Never delete the newest point whose drill passed, nor any point after it.

public required bool KeepLastDrilled { get; init; }

Property Value

bool

MaxAge

Keep points frozen no longer ago than this. Zero = no age limit.

public required TimeSpan MaxAge { get; init; }

Property Value

TimeSpan

MaxCount

Keep at most this many restorable points. 0 = no count limit; else at least MinKeep.

public required int MaxCount { get; init; }

Property Value

int

MaxTotalBytes

Keep the points whose packs fit in this many bytes. 0 = no size limit.

public required long MaxTotalBytes { get; init; }

Property Value

long

MinKeep

Never keep fewer restorable points than this, whatever the limits. At least 1.

public required int MinKeep { get; init; }

Property Value

int

Methods

Validate(out string)

Checks the ranges, and that at least one of MaxAge, MaxCount, MaxTotalBytes limits something.

public bool Validate(out string error)

Parameters

error string

What is wrong, or null.

Returns

bool