sweep

open fun sweep(diff: <Error class: unknown class>, policy: DriftQuarantinePolicy, contextId: <Error class: unknown class>, batchSize: Int = DEFAULT_BATCH_SIZE): QuarantineResult

Sweep one context against diff: page through the candidates, evaluate them, and persist every quarantine policy decides on.

The default body is the whole sweep, written once against the three operations above so every implementation gets the same bounded, scoped behaviour. It reads a page of at most batchSize candidates, hands the page to policy, applies what came back, then asks for the next page starting after the last id it saw, until a page comes back short.

Only mention types policy says could matter are ever read (DriftQuarantinePolicy.candidateMentionTypes), so a diff that touches one type reads one type's propositions however large the context is. When the diff could affect nothing, no page is read at all.

Nothing here advances the swept baseline. A host sweeps every context it means to reconcile and then calls SweptBaselineStore.markSwept itself, because only the host knows when it is finished. See that method for what goes wrong if the baseline moves early.

Return

Every decision the sweep made, gathered across pages in the order they were read.

Parameters

diff

The comparison to evaluate against, ordinarily DriftCheckResult.quarantineDiff.

policy

Decides which propositions the change stranded.

contextId

The context to sweep.

batchSize

How many candidates to read per page. Must be positive.

Throws