pub struct ResolveLimits<'a> {
pub base_budget: u64,
pub row_batch: usize,
pub workers: usize,
pub lookahead_bytes: u64,
pub check_every: u64,
pub watchdog: Option<Arc<MemWatchdog>>,
pub cancel: Option<&'a AtomicBool>,
pub progress: Option<&'a IndexProgress>,
pub label: &'a str,
pub on_pause: Option<&'a (dyn Fn() -> u64 + Sync)>,
}Expand description
The knobs and hooks the indexer hands the resolver. ResolveLimits::none
is the old behaviour: unbounded bases, no watchdog, no progress.
Fields§
§base_budget: u64Ceiling on held delta-base bytes; 0 = unbounded.
row_batch: usizeRows per batch to the row sink.
workers: usizeHow many subtrees are walked at once. 1 is the serial resolver and
the reference every other value is compared against; the output is the
same stream at any value (see the_same_pack_resolves_to_the_same_bytes_at_1_2_and_4_workers).
lookahead_bytes: u64Bytes of resolved-but-not-yet-emitted objects the workers may hold. 0
takes DEFAULT_LOOKAHEAD_BYTES.
check_every: u64Objects between two checkpoints (cancel flag, watchdog).
watchdog: Option<Arc<MemWatchdog>>§cancel: Option<&'a AtomicBool>§progress: Option<&'a IndexProgress>§label: &'a strNames the repository in log lines.
on_pause: Option<&'a (dyn Fn() -> u64 + Sync)>Called once per watchdog pause and again every re-flush: the owner drops
whatever it holds that can be rebuilt (the store’s caches) and returns
how much it dropped. Zero means the owner had nothing to give, which
is the fact index.spilled reported 627 times and nobody acted on —
see crate::memguard::PauseEnd::NothingToGive.
Implementations§
Source§impl<'a> ResolveLimits<'a>
impl<'a> ResolveLimits<'a>
Sourcepub fn none() -> Self
pub fn none() -> Self
Unbounded, unwatched, unreported — what a test or a one-off resolve uses.
Sourcepub fn for_indexer(
label: &'a str,
cancel: &'a AtomicBool,
progress: &'a IndexProgress,
watchdog: Arc<MemWatchdog>,
on_pause: &'a (dyn Fn() -> u64 + Sync),
) -> Self
pub fn for_indexer( label: &'a str, cancel: &'a AtomicBool, progress: &'a IndexProgress, watchdog: Arc<MemWatchdog>, on_pause: &'a (dyn Fn() -> u64 + Sync), ) -> Self
The indexer’s: budget and batch from the environment (once per process), the process-wide watchdog, this store’s cancel flag and progress counter.