AllocationOutcome

sealed interface AllocationOutcome

What one FairShareAllocator.schedule call did at a parent: delegated something, found nothing to delegate, or stopped because the parent cannot be ordered at all or its pick met the lifetime limit.

The empty answers are separate arms because they clear differently. NothingToDelegate is the ordinary answer, and it clears by itself once holdings or demand arrive. WeightBudget is a property of the parent's children, and it lasts until those change. LifetimeExhausted lasts while the full edge is picked.

Inheritors

Types

Link copied to clipboard
data class Delegated(val grants: Int) : AllocationOutcome

grants allocation rounds landed, each a delegation down the tree. Always positive: zero grants is NothingToDelegate, never Delegated(0). A call that granted and then met a refusal answers this, and the next call answers the refusal.

Link copied to clipboard
data class LifetimeExhausted(val parent: GroupId) : AllocationOutcome

The pick at parent chose an edge whose effective issuance the grant would carry past the lifetime watermark, Long.MAX_VALUE less LocalHeddle.LIFETIME_HEADROOM, on this peer's view (#3475). Nothing was written. It lasts while that edge is picked: a refusal moves no position, so a full edge that is next in line stalls its parent, as in LocalHeddle.acquire.

Link copied to clipboard

The allocator ran and delegated nothing: it found no holdings to move toward any demand, no child wants anything, or no child is seated yet.

Link copied to clipboard
data class WeightBudget(val parent: GroupId) : AllocationOutcome

parent's active children carry weights that fail weightsFitTheBudget: a product a pick forms leaves Long, so no pick there can be computed, or the set is too fine for one full lease (#3353). Nothing was written. A replicated ledger can hold such a set however carefully each write was checked: two peers can each activate a child that fits on its own view, and the merge of the two does not fit.