pub(super) fn extract_system_as_of_ms(
plan: Option<&nodedb_physical::physical_plan::PhysicalPlan>,
) -> Option<i64> {
use nodedb_physical::physical_plan::PhysicalPlan;
match plan? {
PhysicalPlan::Document(op) => extract_doc_as_of(op),
PhysicalPlan::Columnar(op) => extract_columnar_as_of(op),
PhysicalPlan::Timeseries(op) => extract_timeseries_as_of(op),
PhysicalPlan::Vector(_)
| PhysicalPlan::Graph(_)
| PhysicalPlan::Kv(_)
| PhysicalPlan::Text(_)
| PhysicalPlan::Spatial(_)
| PhysicalPlan::Crdt(_)
| PhysicalPlan::Query(_)
| PhysicalPlan::Meta(_)
| PhysicalPlan::Array(_)
| PhysicalPlan::ClusterArray(_) => None,
}
}
fn extract_doc_as_of(op: &nodedb_physical::physical_plan::DocumentOp) -> Option<i64> {
use nodedb_physical::physical_plan::DocumentOp;
match op {
DocumentOp::Scan { system_time, .. } => system_time.as_of_ms(),
_ => None,
}
}
fn extract_columnar_as_of(op: &nodedb_physical::physical_plan::ColumnarOp) -> Option<i64> {
use nodedb_physical::physical_plan::ColumnarOp;
match op {
ColumnarOp::Scan { system_time, .. } => system_time.as_of_ms(),
_ => None,
}
}
fn extract_timeseries_as_of(op: &nodedb_physical::physical_plan::TimeseriesOp) -> Option<i64> {
use nodedb_physical::physical_plan::TimeseriesOp;
match op {
TimeseriesOp::Scan { system_time, .. } => system_time.as_of_ms(),
_ => None,
}
}