• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geo-engine / geoengine / 5620963373

21 Jul 2023 08:49AM UTC coverage: 89.159% (-0.03%) from 89.193%
5620963373

push

github

web-flow
Merge pull request #830 from geo-engine/chunk-bencher

Chunk bencher

51 of 51 new or added lines in 2 files covered. (100.0%)

102800 of 115300 relevant lines covered (89.16%)

62790.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/operators/src/pro/engine/execution_context.rs
1
use crate::engine::{
2
    CreateSpan, ExecutionContext, InitializedPlotOperator, InitializedRasterOperator,
3
    InitializedVectorOperator, MetaData, MetaDataProvider, MockExecutionContext, ResultDescriptor,
4
    WorkflowOperatorPath,
5
};
6
use crate::pro::meta::wrapper::InitializedOperatorWrapper;
7
use crate::util::Result;
8
use async_trait::async_trait;
9
use geoengine_datatypes::dataset::{DataId, NamedData};
10
use geoengine_datatypes::raster::TilingSpecification;
11
use geoengine_datatypes::util::test::TestDefault;
12
use rayon::ThreadPool;
13
use std::path::PathBuf;
14
use std::sync::Arc;
15

16
/// A mock execution context that wraps all operators with a statistics operator.
17
pub struct StatisticsWrappingMockExecutionContext {
18
    pub inner: MockExecutionContext,
19
}
20

21
impl TestDefault for StatisticsWrappingMockExecutionContext {
22
    fn test_default() -> Self {
×
23
        Self {
×
24
            inner: MockExecutionContext::test_default(),
×
25
        }
×
26
    }
×
27
}
28

29
#[async_trait::async_trait]
30
impl ExecutionContext for StatisticsWrappingMockExecutionContext {
31
    fn thread_pool(&self) -> &Arc<ThreadPool> {
×
32
        &self.inner.thread_pool
×
33
    }
×
34

35
    fn tiling_specification(&self) -> TilingSpecification {
×
36
        self.inner.tiling_specification
×
37
    }
×
38

39
    fn wrap_initialized_raster_operator(
×
40
        &self,
×
41
        op: Box<dyn InitializedRasterOperator>,
×
42
        span: CreateSpan,
×
43
        path: WorkflowOperatorPath,
×
44
    ) -> Box<dyn InitializedRasterOperator> {
×
45
        InitializedOperatorWrapper::new(op, span, path).boxed()
×
46
    }
×
47

48
    fn wrap_initialized_vector_operator(
×
49
        &self,
×
50
        op: Box<dyn InitializedVectorOperator>,
×
51
        span: CreateSpan,
×
52
        path: WorkflowOperatorPath,
×
53
    ) -> Box<dyn InitializedVectorOperator> {
×
54
        InitializedOperatorWrapper::new(op, span, path).boxed()
×
55
    }
×
56

57
    fn wrap_initialized_plot_operator(
×
58
        &self,
×
59
        op: Box<dyn InitializedPlotOperator>,
×
60
        _span: CreateSpan,
×
61
        _path: WorkflowOperatorPath,
×
62
    ) -> Box<dyn InitializedPlotOperator> {
×
63
        op
×
64
    }
×
65

66
    async fn read_ml_model(&self, path: PathBuf) -> Result<String> {
×
67
        self.inner.read_ml_model(path).await
×
68
    }
×
69

70
    async fn write_ml_model(&mut self, path: PathBuf, ml_model_str: String) -> Result<()> {
×
71
        self.inner.write_ml_model(path, ml_model_str).await
×
72
    }
×
73

74
    async fn resolve_named_data(&self, data: &NamedData) -> Result<DataId> {
×
75
        self.inner.resolve_named_data(data).await
×
76
    }
×
77
}
78

79
#[async_trait]
80
impl<L, R, Q> MetaDataProvider<L, R, Q> for StatisticsWrappingMockExecutionContext
81
where
82
    L: 'static,
83
    R: 'static + ResultDescriptor,
84
    Q: 'static,
85
{
86
    async fn meta_data(&self, id: &DataId) -> Result<Box<dyn MetaData<L, R, Q>>> {
×
87
        self.inner.meta_data(id).await
×
88
    }
×
89
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc