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>
impl<'a> Scheduler<'a>
sourcepub fn new(dag: Dag<&'static str>, data_switch: DataSwitch<'a>) -> Self
pub fn new(dag: Dag<&'static str>, data_switch: DataSwitch<'a>) -> Self
Instantiate a new scheduler
sourcepub async fn validate_series_direct(
&self,
series_id: impl AsRef<str>,
tests: &[impl AsRef<str>],
timerange: Timerange
) -> Result<Receiver<Result<ValidateSeriesResponse, Error>>, Error>
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
sourcepub 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>
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§
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> 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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request