pub struct ProbationAdmission {
pub freq: Arc<dyn FrequencyEstimator>,
pub promotion_threshold: u32,
}Expand description
Admits a first-ever miss into Probation; once the shared estimator has
seen promotion_threshold prior sightings of a hash, admits straight to
Main. Reads estimate only — never calls observe (see the ordering
invariant in the module docs: a request must never count as evidence for
its own promotion).
The estimate read takes one sketch shard, so a fill decision and a concurrent serve completion collide only when their hashes share a shard.
Fields§
§freq: Arc<dyn FrequencyEstimator>The shared frequency estimator; read, never written, by this policy.
promotion_threshold: u32Prior sightings a hash needs before a miss is admitted straight to
Segment::Main instead of Probation.
Trait Implementations§
Source§impl AdmissionPolicy for ProbationAdmission
impl AdmissionPolicy for ProbationAdmission
Source§fn admit(&self, ctx: &AdmissionContext) -> AdmissionDecision
fn admit(&self, ctx: &AdmissionContext) -> AdmissionDecision
Judge one miss. Called on the serve path, so it must not block.
Auto Trait Implementations§
impl !RefUnwindSafe for ProbationAdmission
impl !UnwindSafe for ProbationAdmission
impl Freeze for ProbationAdmission
impl Send for ProbationAdmission
impl Sync for ProbationAdmission
impl Unpin for ProbationAdmission
impl UnsafeUnpin for ProbationAdmission
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.