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§
Sourcefn 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 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.
fn send_halt( &self, id: GlobalId, error: Option<(StatusNamespace, HealthStatusUpdate)>, )
Provided Methods§
Sourcefn chosen_worker(&self) -> Option<usize>
fn chosen_worker(&self) -> Option<usize>
Optionally override the chosen worker index. Default is semi-random. Only useful for tests.