Struct mz_compute::TraceManager
source · [−]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: usize
maintenance_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
sourceimpl TraceManager
impl TraceManager
sourcepub fn new(metrics: TraceMetrics, worker_id: usize) -> Self
pub fn new(metrics: TraceMetrics, worker_id: usize) -> Self
TODO(undocumented)
sourcepub fn maintenance(&mut self)
pub fn maintenance(&mut self)
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.
sourcepub fn allow_compaction(
&mut self,
id: GlobalId,
frontier: AntichainRef<'_, Timestamp>
)
pub fn allow_compaction(
&mut self,
id: GlobalId,
frontier: AntichainRef<'_, Timestamp>
)
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
.
sourcepub fn get(&self, id: &GlobalId) -> Option<&TraceBundle>
pub fn get(&self, id: &GlobalId) -> Option<&TraceBundle>
Returns a reference to the trace for id
, should it exist.
sourcepub fn get_mut(&mut self, id: &GlobalId) -> Option<&mut TraceBundle>
pub fn get_mut(&mut self, id: &GlobalId) -> Option<&mut TraceBundle>
Returns a mutable reference to the trace for id
, should it
exist.
sourcepub fn set(&mut self, id: GlobalId, trace: TraceBundle)
pub fn set(&mut self, id: GlobalId, trace: TraceBundle)
Binds the arrangement for id
to trace
.
sourcepub fn del_all_traces(&mut self)
pub fn del_all_traces(&mut self)
Removes all managed traces.
Auto Trait Implementations
impl !RefUnwindSafe for TraceManager
impl !Send for TraceManager
impl !Sync for TraceManager
impl Unpin for TraceManager
impl !UnwindSafe for TraceManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<P, R> ProtoType<R> for P where
R: RustType<P>,
impl<P, R> ProtoType<R> for P where
R: RustType<P>,
sourcefn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See RustType::from_proto
.
sourcefn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See RustType::into_proto
.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more