Works out which buckets a restore has to read before it reads any of them.
Preflight already proves what a restore can put back, and it proves it by materialising every
subject - which means by the time it has an answer it has already read the cold bucket. This runs
first and answers a smaller question from the placement index: which tiers hold the objects that
replay is going to want. It reads the commits and the anchor chain, which are small, and looks the
frames up locally rather than fetching them.
An object with no placement row is counted and never guessed at. While there is one, every tier is
reported as possibly needed.
How many frames one walk looks up before it stops and says it was bounded.
A full anchor names every subject on the site, and the question here has at most a handful of
possible answers, so reading the whole index to reach one of them is waste. The walk also stops
as soon as every tier is required, because nothing further can change the answer.
Resolves the anchor chain and the frames it names.
\Drupal\strata\Cas\FrameIndexInterface
$index
Maps a frame address to the object holding it, and to its delta parent.
\Drupal\strata\Site\SiteContext
$site
Applies the same key scoping the provider does, so a placement lookup uses the key the bucket
actually holds.
Returns
mixed
—
require()
require(string $target, int $limit = \self::FRAME_LIMIT) : \Drupal\strata\Tier\TierRequirementReport
Which tiers a restore to one commit needs.
Parameters
string
$target
Commit id to replay to.
int
$limit
Most frames to look up before the walk reports itself bounded.
Returns
\Drupal\strata\Tier\TierRequirementReport
—
The answer.
objectKeys()
objectKeys(string $target, int $limit, list$problems, bool $bounded) : list<string>
Every object key a replay to a commit reads.
Parameters
string
$target
Commit id.
int
$limit
Most frames to resolve.
list
$problems
Collects one line per object the walk could not resolve.
bool
$bounded
Set to TRUE when the walk stopped early.
Returns
list
—
Object keys, deduplicated, scoped exactly as the bucket holds them.
addAnchor()
addAnchor(string $anchor, array$keys, int $limit, int $seen, list$problems, bool $bounded) : void
Adds an anchor chain and the objects holding the frames it names.
Parameters
string
$anchor
Anchor address.
array
$keys
Collected keys, added to by reference.
int
$limit
Most frames to resolve.
int
$seen
Frames resolved so far, counted across every anchor rather than per anchor.
list
$problems
Collects one line per object the walk could not resolve.
bool
$bounded
Set to TRUE when the walk stopped early.
Returns
void
—
addFrame()
addFrame(string $hash, array$keys) : void
Adds the object holding one frame, and the objects holding its delta chain.
A frame the index does not know is not added at all. It would be a guess about which bucket
holds an object nothing can locate, and Preflight is the pass that reports that as
unrestorable.
Turns per-tier object counts into the report's rows.
Parameters
array
$counts
Tier index keyed to how many needed objects it holds.
Returns
array
—
The rows.
scope()
scope(string $key) : string
A key as the bucket holds it.
Frames, packs, media blocks and dictionaries are shared between the sites in a bucket and carry
no site prefix; everything else does. Applying the wrong rule would look up a key nothing has
a placement row for and report every object as unplaced.