risingwave_frontend/scheduler/
mod.rsuse std::sync::Arc;
use std::time::Duration;
use futures::Stream;
use risingwave_common::array::DataChunk;
use crate::error::Result;
use crate::session::SessionImpl;
mod distributed;
pub use distributed::*;
pub mod plan_fragmenter;
pub use plan_fragmenter::BatchPlanFragmenter;
mod snapshot;
pub use snapshot::*;
mod local;
pub use local::*;
use crate::scheduler::task_context::FrontendBatchTaskContext;
mod error;
pub mod streaming_manager;
mod task_context;
pub use self::error::SchedulerError;
pub type SchedulerResult<T> = std::result::Result<T, SchedulerError>;
pub trait DataChunkStream = Stream<Item = Result<DataChunk>>;
pub struct ExecutionContext {
session: Arc<SessionImpl>,
timeout: Option<Duration>,
}
pub type ExecutionContextRef = Arc<ExecutionContext>;
impl ExecutionContext {
pub fn new(session: Arc<SessionImpl>, timeout: Option<Duration>) -> Self {
Self { session, timeout }
}
pub fn session(&self) -> &SessionImpl {
&self.session
}
pub fn timeout(&self) -> Option<Duration> {
self.timeout
}
pub fn to_batch_task_context(&self) -> FrontendBatchTaskContext {
FrontendBatchTaskContext::new(self.session.clone())
}
}