InMemoryIngestionLedger

In-memory IngestionLedger backed by a concurrent set of seen hashes.

Suitable for a single process or tests; consumers needing cross-session deduplication supply a durable implementation.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun forget(contentHash: String)

Release a previously recorded content hash so it is no longer treated as seen. Used to undo a claim when the work it guarded did not complete, keeping retries of failed content un-deduplicated.

Link copied to clipboard
open override fun record(contentHash: String)

Record that content with the given hash has been ingested.

Link copied to clipboard
open override fun recordIfAbsent(contentHash: String): Boolean

Atomically claim a content hash: record it and report whether the claim was new. This collapses the check-then-record sequence into a single step so concurrent attempts to ingest identical content cannot both pass a separate seen-check before either records.

Link copied to clipboard
open override fun seen(contentHash: String): Boolean

Whether content with the given hash has already been recorded.