Table of Contents

Class PackChainPageSource

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

The image of a backup point, page by page, without materialising it (plan 1413 §2.10, 04 §3): the IPageSource through which IntegrityScanner checks a point. A page no pack of the chain holds is a hole and reads as zeros, as it would in the restored file.

public sealed class PackChainPageSource : IPageSource, IDisposable
Inheritance
PackChainPageSource
Implements
Inherited Members

Remarks

Single-threaded, as the scanner uses it, and side-effect free (PR-2): read-only handles, no store lock. Memory: 2 B per page for the source map, a fence per 4 096 INDEX entries, an LRU of INDEX blocks and one read window per pack.

Properties

ChainFiles

The packs of the chain, base first.

public IReadOnlyList<string> ChainFiles { get; }

Property Value

IReadOnlyList<string>

Damaged

Damaged pages met so far under ReportAbsent.

public IReadOnlyList<PackPageDamage> Damaged { get; }

Property Value

IReadOnlyList<PackPageDamage>

PageCount

Number of pages addressable in this source. Indices [0, PageCount) are in range.

public int PageCount { get; }

Property Value

int

PagesDecoded

Pages decoded so far.

public long PagesDecoded { get; }

Property Value

long

PointId

The point's id.

public uint PointId { get; }

Property Value

uint

PointLsn

The point's P.

public long PointLsn { get; }

Property Value

long

Methods

Describe()

Human-readable identity of the source, used to anchor findings: a bundle path, a backup id, or "live".

public string Describe()

Returns

string

Dispose()

public void Dispose()

Open(string, PointSelector, PackSourceOptions)

Opens the point point of the store at store. Throws BackupChainBrokenException when its chain does not resolve, BackupPackCorruptException when a pack's header, footer or INDEX fails its check.

public static PackChainPageSource Open(string store, PointSelector point, PackSourceOptions options = null)

Parameters

store string

The store directory.

point PointSelector

Which point.

options PackSourceOptions

Damage handling and memory.

Returns

PackChainPageSource

TryReadPage(int, Span<byte>)

Reads page index into destination.

public bool TryReadPage(int index, Span<byte> destination)

Parameters

index int

Zero-based file-page index.

destination Span<byte>

Buffer of at least PageSize bytes.

Returns

bool

true when the page was read in full; false when it does not exist in this source (out of range, or a hole in a sparse source such as an incremental backup). A false return is not an error — the caller decides whether an absent page is a finding.