PINNED_PREFIXES
PINNED_PREFIXES = [\Drupal\strata\Tree\RefStore::PREFIX]
Key prefixes that never leave the nearest tier.
Matched as a whole path segment, so it catches both the bare prefix and the site-scoped form a shared bucket produces.
Decides which tier an object is written to, read from, and moved into.
All of it is pure: a key, an age and a placement in, tier indexes out. That is deliberate, because these are the decisions that decide whether history is readable, and a decision that needs a bucket to answer cannot be tested against the cases that matter.
Three rules do the work.
Every write lands in the nearest tier and nowhere else. A far tier is written to exactly once per object, by TierMigrator, and never on the flush path. That is what makes a far tier cheap: its class-A request count is the number of objects that have ever aged into it, not the number of times the site was written to.
Refs are pinned to the nearest tier. A ref is the only mutable object in the store and the only place two writers can collide, so it lives in exactly one bucket. A second ref in a far tier would be a second opinion about where history ends, with no rule for resolving a disagreement that is not a guess. It also keeps the cost of reading a ref at one request whatever the ladder depth, which matters because every flush reads one.
A read tries the tiers a placement names, then the rest nearest-first. A known object costs what an untiered read costs. An unknown one costs one request per tier and records what it found, so it is only ever unknown once.
$tiers : \Drupal\strata\Tier\TierMap
tierForWrite() : int
Where a write goes.
One tier rather than a set, and that is the point rather than a simplification: a body may be an open stream, the contract says a stream is read once and not rewound, and a write fanned out to two tiers would hand the second one an exhausted stream. A second copy is made later, from the bytes in the bucket, by TierMigrator.
The nearest tier's index.
readOrder(string $key, \Drupal\strata\Tier\Placement|null $placement) : list<int>
The order tiers are tried in when reading.
| string | $key | The object key. |
| \Drupal\strata\Tier\Placement|null | $placement | What is known about where it is, or NULL when nothing is. |
Tier indexes to try, in order. A pinned key resolves to the nearest tier alone, so a ref that is genuinely absent costs one request rather than one per tier.
promotionFor(string $key, int $from, int $age) : int|null
Whether an object should move out of the tier it is in.
| string | $key | The object key. |
| int | $from | Tier index it is in now. |
| int | $age | Seconds since it was last written. |
The tier index to promote it into, or NULL when it is already where it belongs. Only ever one step, so an object crossing two thresholds at once is moved by two passes and every intermediate state is one this code can describe.