pub struct TraceManager {
    pub(crate) traces: HashMap<GlobalId, TraceBundle>,
    worker_id: usize,
    maintenance_metrics: HashMap<GlobalId, MaintenanceMetrics>,
    doing_maintenance: DeleteOnDropGauge<'static, AtomicU64, Vec<String>>,
    metrics: TraceMetrics,
}
Expand description

A TraceManager stores maps from global identifiers to the primary arranged representation of that collection.

Fields

traces: HashMap<GlobalId, TraceBundle>worker_id: usizemaintenance_metrics: HashMap<GlobalId, MaintenanceMetrics>doing_maintenance: DeleteOnDropGauge<'static, AtomicU64, Vec<String>>

1 if this worker is currently doing maintenance.

If maintenance turns out to take a very long time, this will allow us to gain a sense that materialize is stuck on maintenance before the maintenance completes

metrics: TraceMetrics

Implementations

TODO(undocumented)

performs maintenance work on the managed traces.

In particular, this method enables the physical merging of batches, so that at most a logarithmic number of batches need to be maintained. Any new batches introduced after this method is called will not be physically merged until the method is called again. This is mostly due to limitations of differential dataflow, which requires users to perform this explicitly; if that changes we may be able to remove this code.

Enables compaction of traces associated with the identifier.

Compaction may not occur immediately, but once this method is called the associated traces may not accumulate to the correct quantities for times not in advance of frontier. Users should take care to only rely on accumulations at times in advance of frontier.

Returns a reference to the trace for id, should it exist.

Returns a mutable reference to the trace for id, should it exist.

Binds the arrangement for id to trace.

Removes the trace for id.

Removes all managed traces.

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.

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

Should always be Self

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