Class PackChainPageSource
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
Damaged
Damaged pages met so far under ReportAbsent.
public IReadOnlyList<PackPageDamage> Damaged { get; }
Property Value
PageCount
Number of pages addressable in this source. Indices [0, PageCount) are in range.
public int PageCount { get; }
Property Value
PagesDecoded
Pages decoded so far.
public long PagesDecoded { get; }
Property Value
PointId
The point's id.
public uint PointId { get; }
Property Value
PointLsn
The point's P.
public long PointLsn { get; }
Property Value
Methods
Describe()
Human-readable identity of the source, used to anchor findings: a bundle path, a backup id, or "live".
public string Describe()
Returns
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
storestringThe store directory.
pointPointSelectorWhich point.
optionsPackSourceOptionsDamage handling and memory.
Returns
TryReadPage(int, Span<byte>)
Reads page index into destination.
public bool TryReadPage(int index, Span<byte> destination)
Parameters
Returns
- bool
truewhen the page was read in full;falsewhen it does not exist in this source (out of range, or a hole in a sparse source such as an incremental backup). Afalsereturn is not an error — the caller decides whether an absent page is a finding.