pub struct StreamingQuery { /* private fields */ }Expand description
A running streaming query that connects compiled pipelines to Ring 1 via bridges.
StreamingQuery manages the lifecycle (start/pause/resume/stop), processes
events through compiled or fallback pipelines, and produces Ring1Actions
for downstream stateful operators.
Implementations§
Source§impl StreamingQuery
impl StreamingQuery
Sourcepub fn start(&mut self) -> Result<(), QueryError>
pub fn start(&mut self) -> Result<(), QueryError>
Transitions from QueryState::Ready to QueryState::Running.
§Errors
Returns QueryError::InvalidState if not in Ready state.
Sourcepub fn pause(&mut self) -> Result<(), QueryError>
pub fn pause(&mut self) -> Result<(), QueryError>
Transitions from QueryState::Running to QueryState::Paused.
§Errors
Returns QueryError::InvalidState if not in Running state.
Sourcepub fn resume(&mut self) -> Result<(), QueryError>
pub fn resume(&mut self) -> Result<(), QueryError>
Transitions from QueryState::Paused to QueryState::Running.
§Errors
Returns QueryError::InvalidState if not in Paused state.
Sourcepub fn stop(&mut self) -> Result<(), QueryError>
pub fn stop(&mut self) -> Result<(), QueryError>
Transitions to QueryState::Stopped from any non-terminal state.
§Errors
Returns QueryError::InvalidState if already in Stopped state.
Sourcepub fn submit_row(
&mut self,
row: &EventRow<'_>,
event_time: i64,
key_hash: u64,
) -> Result<SubmitResult, QueryError>
pub fn submit_row( &mut self, row: &EventRow<'_>, event_time: i64, key_hash: u64, ) -> Result<SubmitResult, QueryError>
Submits an event row for processing through all pipelines.
For compiled pipelines, the row is executed through the native function and the result is sent to the corresponding bridge. For fallback pipelines, the input row is sent directly (passthrough) for Ring 1 interpreted execution.
§Errors
Returns QueryError::InvalidState if not in Running state.
Returns QueryError::PipelineError if a compiled pipeline returns Error.
Returns QueryError::Bridge if a bridge send fails.
Sourcepub fn advance_watermark(&self, timestamp: i64) -> Result<(), QueryError>
pub fn advance_watermark(&self, timestamp: i64) -> Result<(), QueryError>
Sends a watermark advance through all bridges.
§Errors
Returns QueryError::InvalidState if not in Running state.
Returns QueryError::Bridge if any bridge send fails.
Sourcepub fn checkpoint(&self, epoch: u64) -> Result<(), QueryError>
pub fn checkpoint(&self, epoch: u64) -> Result<(), QueryError>
Sends a checkpoint barrier through all bridges.
§Errors
Returns QueryError::InvalidState if not in Running state.
Returns QueryError::Bridge if any bridge send fails.
Sourcepub fn send_eof(&self) -> Result<(), QueryError>
pub fn send_eof(&self) -> Result<(), QueryError>
Sends an end-of-stream marker through all bridges.
§Errors
Returns QueryError::Bridge if any bridge send fails.
Sourcepub fn poll_ring1(&mut self) -> SmallVec<[Ring1Action; 4]>
pub fn poll_ring1(&mut self) -> SmallVec<[Ring1Action; 4]>
Drains all consumers and returns concatenated Ring 1 actions.
Sourcepub fn check_latency_flush(&mut self) -> SmallVec<[Ring1Action; 4]>
pub fn check_latency_flush(&mut self) -> SmallVec<[Ring1Action; 4]>
Checks all consumers for latency-triggered flushes.
Sourcepub fn swap(
&mut self,
new: StreamingQuery,
) -> Result<StreamingQuery, QueryError>
pub fn swap( &mut self, new: StreamingQuery, ) -> Result<StreamingQuery, QueryError>
Swaps this query’s pipelines, bridges, and consumers with those from new.
Both queries must have the same number of pipelines. The new query
inherits the current Running or Paused state.
§Errors
Returns QueryError::InvalidState if in Ready or Stopped state.
Returns QueryError::IncompatibleSchemas if pipeline counts differ.
Sourcepub fn state(&self) -> QueryState
pub fn state(&self) -> QueryState
Returns the current lifecycle state.
Sourcepub fn metadata(&self) -> &QueryMetadata
pub fn metadata(&self) -> &QueryMetadata
Returns compilation metadata.
Sourcepub fn pipeline_count(&self) -> usize
pub fn pipeline_count(&self) -> usize
Returns the number of pipelines in this query.
Sourcepub fn metrics(&self) -> QueryMetrics
pub fn metrics(&self) -> QueryMetrics
Aggregates runtime metrics from all pipelines and bridges.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamingQuery
impl !RefUnwindSafe for StreamingQuery
impl Send for StreamingQuery
impl Sync for StreamingQuery
impl Unpin for StreamingQuery
impl UnsafeUnpin for StreamingQuery
impl !UnwindSafe for StreamingQuery
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more