Struct rove::Scheduler

source ·
pub struct Scheduler<'a> { /* private fields */ }
Expand description

Receiver type for QC runs

Holds information about test dependencies and data sources

Implementations§

source§

impl<'a> Scheduler<'a>

source

pub fn new(dag: Dag<&'static str>, data_switch: DataSwitch<'a>) -> Self

Instantiate a new scheduler

source

pub async fn validate_series_direct( &self, series_id: impl AsRef<str>, tests: &[impl AsRef<str>], timerange: Timerange ) -> Result<Receiver<Result<ValidateSeriesResponse, Error>>, Error>

Run a set of timeseries QC tests on some data

series_id is a string identifier of the data to be QCed in the form “data_source_id:data_id”, where data_source_id is the key identifying a connector in the DataSwitch, and data_id is an extra identifier that gets passed to the relevant DataConnector. The format of data_id is connector-specific. timerange represents the range of the time in the time series whose data is to be QCed.

tests represents the QC tests to be run. Any tests these depend on will be found via the DAG, and run as well.

Errors

Returned from the function if:

  • The provided test array is empty
  • A test in the provided array did not have a matching entry in the DAG
  • The data_source_id component of the provided series_id did not have a matching entry in the Scheduler’s DataSwitch

In the the returned channel if:

  • The test harness encounters an error on during one of the QC tests. This will also result in the channel being closed
source

pub async fn validate_spatial_direct( &self, spatial_id: impl AsRef<str>, tests: &[impl AsRef<str>], polygon: &Polygon, time: Timestamp ) -> Result<Receiver<Result<ValidateSpatialResponse, Error>>, Error>

Run a set of spatial QC tests on some data

spatial_id is a string identifier of the data to be QCed in the form “data_source_id:data_id”, where data_source_id is the key identifying a connector in the DataSwitch, and data_id is an extra identifier that gets passed to the relevant DataConnector. The format of data_id is connector-specific. time represents the timestamp of the spatial slice to be QCed, while polygon is a vec of lat-lon pairs that encode the vertices of a polygon defining the region of the spatial slice in which data should be QCed.

tests represents the QC tests to be run. Any tests these depend on will be found via the DAG, and run as well.

Errors

Returned from the function if:

  • The provided test array is empty
  • A test in the provided array did not have a matching entry in the DAG
  • The data_source_id component of the provided spatial_id did not have a matching entry in the Scheduler’s DataSwitch

In the the returned channel if:

  • The test harness encounters an error on during one of the QC tests. This will also result in the channel being closed

Trait Implementations§

source§

impl<'a> Clone for Scheduler<'a>

source§

fn clone(&self) -> Scheduler<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Scheduler<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Scheduler<'a>

§

impl<'a> Send for Scheduler<'a>

§

impl<'a> Sync for Scheduler<'a>

§

impl<'a> Unpin for Scheduler<'a>

§

impl<'a> !UnwindSafe for Scheduler<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more