Interface WalkConsumer
public interface WalkConsumer
The walk half of the two-route derived-metadata contract. A plugin keeps its derived state correct by exactly two
routes, and a correct plugin implements both: live events (
PublicationObserver's
onPublished / onDeleted) for the steady state, and the full walk - this interface - for
first-activation back-fill, periodic refresh and self-heal. A scheduled walk pass (RebuildPass) drives
every discovered consumer from one enumeration, so N metadata rebuilders never mean N tree walks. The walk alone must be able to
fully rebuild the plugin's derived state from the durable store wherever the truth model permits; where a surface
genuinely cannot be re-derived (a human decision, a point-in-time observation), the plugin's documentation names
it and the plugin degrades gracefully rather than serving a silently-incomplete view as if it were whole.
onRetained(ArtifactDescriptor, ArtifactStore) is called once per retained artifact per pass - and, across a crash-resume, at least once
for the uncommitted stride tail - so it must be idempotent (upsert / re-judge semantics). A streaming
consumer (a reconcile leg, a sidecar heal, a per-shard index) simply resumes mid-pass with the segment cursor; a
snapshot rebuilder (one artifact committed at pass end) restarts its own accumulation after a crash and says so -
degrade-and-say-so is recorded per consumer, never silent.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<WalkConsumer> Every enabled consumer discovered viaServiceLoader(a parallel SPI: ajenesis.repository.<name>=falseskips one,Features), in discovery order - what the scheduled walk pass drives from its one enumeration.name()The consumer's name - its signal and settings namespace, and itswalks/<name>/pass-state scope.default voidonPassCompleted(WalkPass pass) The pass enumerated everything - the commit / compact / heal hook for a consumer that acts at pass end.default voidonPassStarted(WalkPass pass) The pass is starting - the moment a snapshot rebuilder resets its accumulation.voidonRetained(build.jenesis.repository.store.ArtifactDescriptor artifact, build.jenesis.repository.store.ArtifactStore store) One retained artifact, visited in total key order; must be idempotent per artifact (see the class contract for the exactly-once-per-pass / at-least-once-across-a-crash delivery semantics).
-
Method Details
-
name
String name()The consumer's name - its signal and settings namespace, and itswalks/<name>/pass-state scope. -
onRetained
void onRetained(build.jenesis.repository.store.ArtifactDescriptor artifact, build.jenesis.repository.store.ArtifactStore store) throws IOException One retained artifact, visited in total key order; must be idempotent per artifact (see the class contract for the exactly-once-per-pass / at-least-once-across-a-crash delivery semantics).- Throws:
IOException
-
onPassStarted
The pass is starting - the moment a snapshot rebuilder resets its accumulation. -
onPassCompleted
The pass enumerated everything - the commit / compact / heal hook for a consumer that acts at pass end. -
discovered
Every enabled consumer discovered viaServiceLoader(a parallel SPI: ajenesis.repository.<name>=falseskips one,Features), in discovery order - what the scheduled walk pass drives from its one enumeration.
-