pub enum ReadPolicy<T> {
    NoPolicy {
        initial_since: Antichain<T>,
    },
    ValidFrom(Antichain<T>),
    LagWriteFrontier(Arc<dyn Fn(AntichainRef<'_, T>) -> Antichain<T> + Send + Sync>),
    Multiple(Vec<ReadPolicy<T>>),
}
Expand description

Compaction policies for collections maintained by Controller.

NOTE(benesch): this might want to live somewhere besides the storage crate, because it is fundamental to both storage and compute.

Variants§

§

NoPolicy

Fields

§initial_since: Antichain<T>

No-one has yet requested a ReadPolicy from us, which means that we can still change the implied_capability/the collection since if we need to.

§

ValidFrom(Antichain<T>)

Maintain the collection as valid from this frontier onward.

§

LagWriteFrontier(Arc<dyn Fn(AntichainRef<'_, T>) -> Antichain<T> + Send + Sync>)

Maintain the collection as valid from a function of the write frontier.

This function will only be re-evaluated when the write frontier changes. If the intended behavior is to change in response to external signals, consider using the ValidFrom variant to manually pilot compaction.

The Arc makes the function cloneable.

§

Multiple(Vec<ReadPolicy<T>>)

Allows one to express multiple read policies, taking the least of the resulting frontiers.

Implementations§

Creates a read policy that lags the write frontier “by one”.

Creates a read policy that lags the write frontier by the indicated amount, rounded down to (at most) the specified value. The rounding down is done to reduce the number of changes the capability undergoes.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Converts to this type from a reference to the input type.
Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Upcasts this ProgressEventTimestamp to Any. Read more
Returns the name of the concrete type of this object. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more