Trait HealthOperator

Source
pub trait HealthOperator {
    // Required methods
    fn record_new_status(
        &self,
        collection_id: GlobalId,
        ts: DateTime<Utc>,
        new_status: Status,
        new_error: Option<&str>,
        hints: &BTreeSet<String>,
        namespaced_errors: &BTreeMap<StatusNamespace, String>,
        write_namespaced_map: bool,
    );
    fn send_halt(
        &self,
        id: GlobalId,
        error: Option<(StatusNamespace, HealthStatusUpdate)>,
    );

    // Provided method
    fn chosen_worker(&self) -> Option<usize> { ... }
}
Expand description

A trait that lets a user configure the health_operator with custom behavior. This is mostly useful for testing, and the DefaultWriter should be the correct implementation for everyone.

Required Methods§

Source

fn record_new_status( &self, collection_id: GlobalId, ts: DateTime<Utc>, new_status: Status, new_error: Option<&str>, hints: &BTreeSet<String>, namespaced_errors: &BTreeMap<StatusNamespace, String>, write_namespaced_map: bool, )

Record a new status.

Source

fn send_halt( &self, id: GlobalId, error: Option<(StatusNamespace, HealthStatusUpdate)>, )

Provided Methods§

Source

fn chosen_worker(&self) -> Option<usize>

Optionally override the chosen worker index. Default is semi-random. Only useful for tests.

Implementors§