Table of Contents

Class BackupRestorePlan

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

What a restore would do, worked out without doing any of it (PlanRestore(string, PointSelector, string, BackupRestoreOptions)): the point (or, for an LSN or a time, the base and the archived WAL), the target as the restore resolves it, what would stop it, and the fingerprint ApprovedPlan binds a restore to.

public sealed record BackupRestorePlan : IEquatable<BackupRestorePlan>
Inheritance
BackupRestorePlan
Implements
Inherited Members

Constructors

BackupRestorePlan(string, string, string, IReadOnlyList<uint>, long, uint, long, long, long, Guid, int, long, long, DateTime?, RestoreRefusalReason?, RestoreUnreachableReason?, string, IReadOnlyList<long>)

What a restore would do, worked out without doing any of it (PlanRestore(string, PointSelector, string, BackupRestoreOptions)): the point (or, for an LSN or a time, the base and the archived WAL), the target as the restore resolves it, what would stop it, and the fingerprint ApprovedPlan binds a restore to.

public BackupRestorePlan(string Fingerprint, string ResolvedTarget, string DisplacedBundle, IReadOnlyList<uint> Chain, long BytesToRead, uint BaseBackupId, long CheckpointLsn, long PointLsn, long TargetLsn, Guid TimelineId, int ArchivedSegments, long ArchivedBytes, long SampleLsn, DateTime? SampleUtc, RestoreRefusalReason? Refusal, RestoreUnreachableReason? Unreachable, string RefusalMessage, IReadOnlyList<long> NearestRestorable)

Parameters

Fingerprint string

Identifies what would be restored and where; it changes when the chain, the archived WAL used, the cut or the target change.

ResolvedTarget string

The bundle the restore writes; null when no target was given or it is refused by name.

DisplacedBundle string

Where Replace moves the existing target; null when there is none.

Chain IReadOnlyList<uint>

The points whose packs are read, base first.

BytesToRead long

The packs' and archived segments' bytes.

BaseBackupId uint

The point restored (the base, for an LSN or a time); 0 when unreachable.

CheckpointLsn long

The base's C.

PointLsn long

The restored database's last LSN: the point's P, or L' for an LSN or a time.

TargetLsn long

The LSN asked for, or the one an instant resolved to; 0 for a point.

TimelineId Guid

The timeline restored from.

ArchivedSegments int

Archived WAL segments the restore reads.

ArchivedBytes long

Their file bytes.

SampleLsn long

For an instant, the LSN of the time sample used; 0 otherwise.

SampleUtc DateTime?

For an instant, the sample's time; null otherwise.

Refusal RestoreRefusalReason?

Why the restore would be refused; null when it would not.

Unreachable RestoreUnreachableReason?

Why an LSN or a time cannot be reached; null when it can.

RefusalMessage string

The refusal's message; null when none.

NearestRestorable IReadOnlyList<long>

For an unreachable target, the restorable LSNs nearest it.

Properties

ArchivedBytes

Their file bytes.

public long ArchivedBytes { get; init; }

Property Value

long

ArchivedSegments

Archived WAL segments the restore reads.

public int ArchivedSegments { get; init; }

Property Value

int

BaseBackupId

The point restored (the base, for an LSN or a time); 0 when unreachable.

public uint BaseBackupId { get; init; }

Property Value

uint

BytesToRead

The packs' and archived segments' bytes.

public long BytesToRead { get; init; }

Property Value

long

CanRestore

Whether the restore would proceed as planned.

public bool CanRestore { get; }

Property Value

bool

Chain

The points whose packs are read, base first.

public IReadOnlyList<uint> Chain { get; init; }

Property Value

IReadOnlyList<uint>

CheckpointLsn

The base's C.

public long CheckpointLsn { get; init; }

Property Value

long

DisplacedBundle

Where Replace moves the existing target; null when there is none.

public string DisplacedBundle { get; init; }

Property Value

string

Fingerprint

Identifies what would be restored and where; it changes when the chain, the archived WAL used, the cut or the target change.

public string Fingerprint { get; init; }

Property Value

string

NearestRestorable

For an unreachable target, the restorable LSNs nearest it.

public IReadOnlyList<long> NearestRestorable { get; init; }

Property Value

IReadOnlyList<long>

PointLsn

The restored database's last LSN: the point's P, or L' for an LSN or a time.

public long PointLsn { get; init; }

Property Value

long

Refusal

Why the restore would be refused; null when it would not.

public RestoreRefusalReason? Refusal { get; init; }

Property Value

RestoreRefusalReason?

RefusalMessage

The refusal's message; null when none.

public string RefusalMessage { get; init; }

Property Value

string

ResolvedTarget

The bundle the restore writes; null when no target was given or it is refused by name.

public string ResolvedTarget { get; init; }

Property Value

string

SampleLsn

For an instant, the LSN of the time sample used; 0 otherwise.

public long SampleLsn { get; init; }

Property Value

long

SampleUtc

For an instant, the sample's time; null otherwise.

public DateTime? SampleUtc { get; init; }

Property Value

DateTime?

TargetLsn

The LSN asked for, or the one an instant resolved to; 0 for a point.

public long TargetLsn { get; init; }

Property Value

long

TimelineId

The timeline restored from.

public Guid TimelineId { get; init; }

Property Value

Guid

Unreachable

Why an LSN or a time cannot be reached; null when it can.

public RestoreUnreachableReason? Unreachable { get; init; }

Property Value

RestoreUnreachableReason?

Methods

Deconstruct(out string, out string, out string, out IReadOnlyList<uint>, out long, out uint, out long, out long, out long, out Guid, out int, out long, out long, out DateTime?, out RestoreRefusalReason?, out RestoreUnreachableReason?, out string, out IReadOnlyList<long>)

public void Deconstruct(out string Fingerprint, out string ResolvedTarget, out string DisplacedBundle, out IReadOnlyList<uint> Chain, out long BytesToRead, out uint BaseBackupId, out long CheckpointLsn, out long PointLsn, out long TargetLsn, out Guid TimelineId, out int ArchivedSegments, out long ArchivedBytes, out long SampleLsn, out DateTime? SampleUtc, out RestoreRefusalReason? Refusal, out RestoreUnreachableReason? Unreachable, out string RefusalMessage, out IReadOnlyList<long> NearestRestorable)

Parameters

Fingerprint string
ResolvedTarget string
DisplacedBundle string
Chain IReadOnlyList<uint>
BytesToRead long
BaseBackupId uint
CheckpointLsn long
PointLsn long
TargetLsn long
TimelineId Guid
ArchivedSegments int
ArchivedBytes long
SampleLsn long
SampleUtc DateTime?
Refusal RestoreRefusalReason?
Unreachable RestoreUnreachableReason?
RefusalMessage string
NearestRestorable IReadOnlyList<long>

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(BackupRestorePlan?)

public bool Equals(BackupRestorePlan? other)

Parameters

other BackupRestorePlan

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(BackupRestorePlan?, BackupRestorePlan?)

public static bool operator ==(BackupRestorePlan? left, BackupRestorePlan? right)

Parameters

left BackupRestorePlan
right BackupRestorePlan

Returns

bool

operator !=(BackupRestorePlan?, BackupRestorePlan?)

public static bool operator !=(BackupRestorePlan? left, BackupRestorePlan? right)

Parameters

left BackupRestorePlan
right BackupRestorePlan

Returns

bool