$engine
$engine : \Drupal\strata\Engine
The passes that make stored history cheaper, and the two that remove parts of it.
Recompaction, re-anchoring, dictionary training and reindexing change no restore target: each
rewrites or rebuilds derived state, so the worst case of running one at the wrong moment is wasted
work. strata:compact therefore never prunes, whatever else it does.
Pruning and collecting do remove restore targets, so both print their receipt in full and ask
before acting, and both go through Compactor::prune() rather than deleting objects themselves. A
pack survives while one frame in it is live, a candidate is dropped only when all three
reachability classes agree, and an incomplete walk refuses the whole pass; putting a second
deletion path beside that one would mean maintaining those rules twice.
$engine : \Drupal\strata\Engine
$keyMaker : \Drupal\strata\Crypto\KeyMaker
__construct(\Drupal\strata\Engine $engine, \Drupal\strata\Crypto\KeyMaker $keyMaker, \Drupal\Core\Config\ConfigFactoryInterface $configFactory) : mixed
Constructs the command set.
| \Drupal\strata\Engine | $engine | Builds the compactor, the reachability set and the passes over them. |
| \Drupal\strata\Crypto\KeyMaker | $keyMaker | Creates the key entity |
| \Drupal\Core\Config\ConfigFactoryInterface | $configFactory | Holds which key is current and which are retired. |
compact(array$options = ['budget' => 0]) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Rewrites stored objects at a setting the flush path cannot afford.
Folds each retention level into the one above, breaks delta chains that have grown past the
cap, and recompresses packs. No content address changes and nothing is removed, so the pass is
safe to schedule and safe to interrupt. Removing what history no longer needs is
strata:prune.
| array |
$options | Command options. |
What the pass did.
reanchor(array$options = ['budget' => 0, 'dry-run' => false]) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Breaks delta chains that have grown past the configured cap.
A chain past the cap still decodes; every frame in it has to be fetched to do so. Re-anchoring stores the deepest frames standalone again, trading stored bytes for a bounded restore cost.
| array |
$options | Command options. |
What the pass did, or would do.
newKey(array$options = ['id' => \Drupal\strata\Crypto\KeyMaker::DEFAULT_ID]) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Creates an encryption key, selects it, and retires the one it displaced.
Encryption ships on with no key, so a fresh install refuses every flush until somebody creates a key entity of the right type and length in another module. This is that, in one command.
Retiring the outgoing key is not optional and there is no flag to skip it: everything sealed
before this moment stays readable only while the key that sealed it is on the ring, and a store
whose key was dropped is indistinguishable from a corrupt one. strata:rotate-key is the pass
that ends that state, and it reports when the old key is safe to remove.
| array |
$options | Command options. |
What was created and what was retired.
rotateKey(array$options = ['budget' => 0, 'dry-run' => false]) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Re-seals frames that still open under a retired key.
A rotation is a state the store is in, not an event: a new key seals everything written from the moment it is configured, and everything written before it stays readable only while the key that sealed it is still on the ring. This is the pass that ends that state. It is bounded, safe to interrupt and safe to repeat, and it moves nothing: a frame is addressed by its decoded bytes, so re-sealing rewrites one object and nothing that references it.
Removing a retired key before complete says yes makes every frame still sealed under it
unreadable, and nothing afterwards can tell that apart from corruption.
| array |
$options | Command options. |
What the pass did, or what a measurement found.
trainDict(array$options = ['ref' => \Drupal\strata\Tree\RefStore::MAIN, 'realm' => \self::REQ]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Trains a compression dictionary per realm from what the store already holds.
A dictionary is what makes small payloads compress at all: a 200-byte field delta has almost no internal redundancy, and the shared structure it does have lives in the other payloads from the same realm. Existing frames stay decodable, because each names the dictionary it used.
| array |
$options | Command options. |
One row per realm, empty when there is no history to sample.
reindex(array$options = ['keep' => false, 'adopt-ref' => false]) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Rebuilds the local indexes from what the bucket holds.
The commit index and the frame index are caches over the store, so a site restored from a database dump, or one that imported an archive, has objects the indexes do not know about. This reads the objects back and rewrites both tables from them. Nothing in the bucket is touched.
| array |
$options | Command options. |
What was rebuilt.
prune(array$options = ['dry-run' => false, 'limit' => 1000]) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Removes what no reachable history needs, or explains why it would not.
The receipt is printed before anything is deleted, and the numbers in a dry run are the same ones an applied run produces. Every candidate held back is named with its reason, so a pass that frees nothing says which frames kept it from doing so.
| array |
$options | Command options. |
The receipt.
gc(array$options = ['dry-run' => false, 'limit' => 1000]) : \Consolidation\OutputFormatters\StructuredData\RowsOfFields
Reports what the reachability walk reached, and removes the frames it did not.
The walk's own totals are what answer "why is nothing collectable": a frame is held by a reachable commit, by a live frame that was compressed against its dictionary, or by something that decodes against it as a delta parent, and the counts say which class is doing the holding. The removal itself is the same prune pass, so the pack and dictionary rules apply unchanged.
| array |
$options | Command options. |
One row per reachability class, plus what is collectable.
value(array$options, string $name) : string|null
Reads an option that carries a value.
A value option declares DrushCommands::REQ as its default, and Drush replaces that with the
string the operator supplied or with NULL before the command body runs. A method called
directly - from a test, a hook, or another command - still sees the sentinel, and both forms
mean that nothing was supplied. Drush only ever passes a string, so an integer sentinel cannot
be confused with a value.
| array |
$options | The options the command was called with. |
| string | $name | The option name. |
The value, or NULL when none was supplied.
number(array$options, string $name, int $fallback) : int
Reads an option that carries a whole number.
| array |
$options | The options the command was called with. |
| string | $name | The option name. |
| int | $fallback | What to return when nothing was supplied. |
The value, or the fallback.
agreed(string $question) : bool
Asks before doing something that removes a restore target or overwrites live data.
Drush answers this itself under --yes and --no, so a scripted run never blocks. The
default is no, because the question is only ever asked about something irreversible.
| string | $question | What is about to happen, phrased as a question. |
TRUE to go ahead.
announce(bool $acted, string $summary) : void
States what a pass did, at the severity the outcome deserves.
A pass that ran and a pass that declined to run both produce a summary worth reading, and the difference between them is what an operator watching a scheduled job needs to see.
| bool | $acted | TRUE when the pass did the thing it was asked to do. |
| string | $summary | The one-line summary to print. |
digest(string|null $digest) : string
Shortens a content address for a table cell.
Anything that is not a digest is returned whole, so an object key or a refusal reason passed here is readable rather than truncated to twelve characters of a path.
| string|null | $digest | The digest, or NULL. |
The first twelve characters of a digest, the value unchanged when it is not one, or "-".
adoptRef(bool $asked) : string|null
Points a lost ref at the newest commit a rebuild recovered.
A rebuild reads objects; it does not decide what history is current, and a ref is a restore target rather than derived state. So this is asked for explicitly and never happens on its own. Without it a store whose ref was deleted can have every object recovered and still have no head, which leaves a verify pass with nothing to walk and a restore with nothing to plan against - recoverable in principle and unrecoverable in practice.
| bool | $asked | TRUE when |
The commit adopted, or NULL when nothing was asked for, a ref already exists, or the rebuild recovered no commit to adopt.
receiptList(\Drupal\strata\Compaction\PruneReceipt $receipt) : \Consolidation\OutputFormatters\StructuredData\PropertyList
Turns a receipt into the command's result.
| \Drupal\strata\Compaction\PruneReceipt | $receipt | The receipt. |
The result.