pub struct Reporter<K: JobKind> { /* private fields */ }Expand description
The handle a running job reports through.
Every method takes &self and writes into the job under the queue’s lock,
so a console polling a status RPC sees a count that moves rather than a job
that sits at zero for four minutes and then jumps.
Implementations§
Source§impl<K: JobKind> Reporter<K>
impl<K: JobKind> Reporter<K>
Sourcepub fn progress(&self, done: u64, total: u64)
pub fn progress(&self, done: u64, total: u64)
How far along, in whatever the kind counts. Overwrites the previous reading; a progress that accumulated across reports would be a second counter to keep right.
Sourcepub fn snapshot(&self) -> Option<Job<K>>
pub fn snapshot(&self) -> Option<Job<K>>
The job as it stands right now, for a runner that has to read back what it reported.
The one caller is the mirror runner, which publishes an event-stream event
carrying the reference list it wrote through Reporter::report. That
list is on the JOB — it has to be, because a status RPC renders it —
and a runner that also kept its own copy would be two places the same
facts could disagree (one implementation).
None when the job is gone, which nothing does while a runner is
running: a live job is never pruned.
Source§impl Reporter<Purge>
impl Reporter<Purge>
Sourcepub fn found(&self, stores: u32)
pub fn found(&self, stores: u32)
How many stores the walk found. Called once, when the walk has finished counting and before it starts unlinking.
Sourcepub fn failed(&self, note: String)
pub fn failed(&self, note: String)
One store could NOT be reclaimed, and this is why.
Recorded and the walk continues. Stopping at the first failure would leave the rest of an account that is being closed on the disk because one directory had bad permissions — and the operator would have to run the purge again anyway.
Sourcepub fn principal_removed(&self)
pub fn principal_removed(&self)
The principal itself was removed.
Trait Implementations§
Auto Trait Implementations§
impl<K> Freeze for Reporter<K>
impl<K> RefUnwindSafe for Reporter<K>where
Arc<Inner<K>>: RefUnwindSafe,
impl<K> Send for Reporter<K>
impl<K> Sync for Reporter<K>
impl<K> Unpin for Reporter<K>
impl<K> UnsafeUnpin for Reporter<K>where
Arc<Inner<K>>: UnsafeUnpin,
impl<K> UnwindSafe for Reporter<K>where
Arc<Inner<K>>: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request