Documentation
¶
Overview ¶
Package restoreplan (#157) decides, per pack, HOW a restore fetches its chunks: dense packs (many needed chunks) download whole and amortize; sparse packs (cross-machine-dedup scatter: a couple of chunks out of thousands) fetch per-chunk via ranged reads. The restore holds its full entry list before fetching, so the plan is exact, not heuristic-per-miss.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wire ¶
func Wire(ctx context.Context, cs *store.ChunkStore, sess PackSource, plan *Plan, lruWindow int)
Wire installs the fetch policy on a ChunkStore backed by a pack source: sparse packs fetch single frames via ranged reads; dense packs decline to the whole-pack path, which downloads with LRU eviction (window) and refreshes recency on every local hit.
Types ¶
type PackSource ¶
type PackSource interface {
FetchChunkFrame(ctx context.Context, packNum uint32, offset int64) ([]byte, error)
TouchPack(n uint32)
DownloadPack(ctx context.Context, packNum uint32) error
EvictLRUPacks(window int)
}
PackSource is the pack-fetch surface Wire drives — exactly the four methods, no more. Defining it HERE (rather than importing the concrete *cloudsync.S3Session) is what keeps restoreplan inside the engine set (#542): the cloud layer satisfies this from the outside, the engine never names it. cloudsync.S3Session implements it as-is.
type Plan ¶
type Plan struct {
// contains filtered or unexported fields
}
Plan classifies packs for one restore.
func Build ¶
Build classifies packs from an in-memory entry slice; BuildFrom is the streaming form and the one a restore should call (#506).
func BuildFrom ¶
func BuildFrom(ea manifest.EntryAccessor, packOf func([32]byte) (uint32, bool), packMax int64) *Plan
BuildFrom is Build over an EntryAccessor (#506): the same per-pack counting, reading entries in batches so a 1.26M-entry chain never has to exist as one slice. Build delegates here through a slice accessor.