pub struct JobRuntime {Show 16 fields
pub job_id: Uuid,
pub user_id: Uuid,
pub strategy_name: String,
pub base_sim_config: String,
pub sentinel_config: String,
pub payload_bytes: Vec<u8>,
pub work_context_hash: WorkContextHash,
pub status: JobRuntimeStatus,
pub priority: i32,
strategy: RuntimeStrategyState,
in_flight: FastMap<ClaimToken, ClaimRecord>,
pending_reclaims: VecDeque<RuntimeWorkItem>,
recent_completions: CompletionLog,
failed_items: u32,
next_chunk_id: u64,
next_item_id: u64,
}Fields§
§job_id: Uuid§user_id: Uuid§strategy_name: String§base_sim_config: String§sentinel_config: String§payload_bytes: Vec<u8>Encoded TournamentPayload, empty for non-tournament jobs.
work_context_hash: WorkContextHash§status: JobRuntimeStatus§priority: i32§strategy: RuntimeStrategyState§in_flight: FastMap<ClaimToken, ClaimRecord>§pending_reclaims: VecDeque<RuntimeWorkItem>§recent_completions: CompletionLog§failed_items: u32§next_chunk_id: u64§next_item_id: u64Implementations§
Source§impl JobRuntime
impl JobRuntime
fn new( init: JobRuntimeInit, strategy_name: &str, strategy: RuntimeStrategyState, ) -> Self
pub fn tournament( init: JobRuntimeInit, phases: Vec<Phase>, to_test: RoaringBitmap, ) -> Self
pub fn tournament_with_factorial( init: JobRuntimeInit, phases: Vec<Phase>, factorial: FactorialRuntime, ) -> Self
pub fn single(init: JobRuntimeInit, chunk_iterations: &[u32]) -> Self
Sourcepub fn stat_weights(init: JobRuntimeInit, runs: &[(u64, Vec<u32>)]) -> Self
pub fn stat_weights(init: JobRuntimeInit, runs: &[(u64, Vec<u32>)]) -> Self
Tag 0 is the full-fidelity baseline.
pub fn in_flight_len(&self) -> usize
pub fn in_flight_claims(&self) -> impl Iterator<Item = &ClaimRecord>
pub fn suggested_batch_size(&self) -> usize
Sourcepub fn progress_snapshot(&self) -> Option<ProgressSnapshot>
pub fn progress_snapshot(&self) -> Option<ProgressSnapshot>
None for non-tournament jobs.
Sourcepub fn claim_batch(
&mut self,
node_public_key: &str,
max_items: usize,
now_ms: u64,
) -> Option<AssignedBatch>
pub fn claim_batch( &mut self, node_public_key: &str, max_items: usize, now_ms: u64, ) -> Option<AssignedBatch>
Reassigns reclaimed work before fresh work.
pub fn reclaim_stale( &mut self, now_ms: u64, timeout_ms: u64, max_attempts: u32, ) -> ReclaimOutcome
pub fn has_failures(&self) -> bool
pub fn has_outstanding_work(&self) -> bool
pub fn is_complete(&self) -> bool
pub fn memory_breakdown(&self) -> RuntimeMemoryBreakdown
pub(in scheduler) fn claim_batch_with<F>(
&mut self,
node_public_key: &str,
max_items: usize,
now_ms: u64,
claim_token: F,
) -> Option<AssignedBatch>where
F: FnOnce() -> ClaimToken,
pub(crate) fn complete( &mut self, chunk_id: RuntimeChunkId, claim_token: &ClaimToken, work_context_hash: &WorkContextHash, node_public_key: &str, results: &[RuntimeWorkResult], ) -> Result<CompletionOutcome, StrategyError>
pub(crate) fn finalize(&self) -> Result<FinalOutput, StrategyError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JobRuntime
impl RefUnwindSafe for JobRuntime
impl Send for JobRuntime
impl Sync for JobRuntime
impl Unpin for JobRuntime
impl UnsafeUnpin for JobRuntime
impl UnwindSafe for JobRuntime
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more