$operations
$operations : list<\Drupal\strata\Journal\JournalOp>
Operations added so far, keyed by nothing; order is preserved.
Turns a window of journal operations into a manifest, storing each payload as it goes.
The order is fixed and each step depends on the last. Operations are collapsed first, so a subject touched ten times in the window is stored once. Payloads then go through the object store, which deduplicates against everything already held, so an unchanged value costs a lookup rather than an upload. Only what survives both is written.
A payload is supplied by the caller rather than read here, because the value is already in memory at capture time. Nothing in this class reads Drupal.
$operations : list<\Drupal\strata\Journal\JournalOp>
Operations added so far, keyed by nothing; order is preserved.
$store : \Drupal\strata\Cas\ObjectStore
__construct(\Drupal\strata\Cas\ObjectStore $store, int $level = 0, callable|null $previous = null) : mixed
Constructs a builder.
| \Drupal\strata\Cas\ObjectStore | $store | Where payloads are stored. |
| int | $level | Compaction level to stamp on the manifest. |
| callable|null | $previous | Given a subject path, returns the frame map of that subject's previous version as a
|
add(\Drupal\strata\Journal\JournalOp $operation, string|null $payload = null) : $this
Adds an operation and the payload it captured.
Adding the same operation key twice is expected: that is what collapsing exists for. The later payload wins, matching the surviving operation the collapser produces.
| \Drupal\strata\Journal\JournalOp | $operation | The operation. |
| string|null | $payload | The value the operation captured, or NULL for an operation that carries none. |
The builder, for chaining.
build() : \Drupal\strata\Segment\SegmentManifest|null
Collapses, stores the surviving payloads, and produces the manifest.
Clears the builder, so the same instance can start the next window.
When storing a payload fails.
The manifest, or NULL when nothing was added.
previousMap(\Drupal\strata\Journal\JournalOp $operation) : list<string>
The frame map of one subject's previous version.
| \Drupal\strata\Journal\JournalOp | $operation | The operation being stored. |
Frame addresses, empty when there is no previous version or no lookup was supplied.