#[cfg(feature = "streaming")]
pub mod aggregator;
#[cfg(feature = "streaming")]
pub mod engine;
#[cfg(feature = "streaming")]
pub mod event;
#[cfg(feature = "streaming")]
pub mod join_manager;
#[cfg(feature = "streaming")]
pub mod join_optimizer;
#[cfg(feature = "streaming")]
pub mod operators;
#[cfg(feature = "streaming")]
pub mod state;
#[cfg(feature = "streaming")]
pub mod watermark;
#[cfg(feature = "streaming")]
pub mod window;
#[cfg(feature = "streaming")]
pub use aggregator::{AggregationType, Aggregator};
#[cfg(feature = "streaming")]
pub use engine::StreamRuleEngine;
#[cfg(feature = "streaming")]
pub use event::{EventMetadata, StreamEvent};
#[cfg(feature = "streaming")]
pub use join_manager::StreamJoinManager;
#[cfg(feature = "streaming")]
pub use join_optimizer::{JoinOptimization, JoinOptimizer, OptimizedJoinPlan, StreamStats};
#[cfg(feature = "streaming")]
pub use operators::{
AggregateResult, Aggregation, Average, Count, CustomAggregator, DataStream, GroupedStream,
KeyedStream, Max, Min, Sum, WindowConfig, WindowedStream,
};
#[cfg(feature = "streaming")]
pub use state::{
CheckpointMetadata, StateBackend, StateConfig, StateStatistics, StateStore, StatefulOperator,
};
#[cfg(feature = "streaming")]
pub use watermark::{
LateDataHandler, LateDataStats, LateDataStrategy, LateEventDecision, Watermark,
WatermarkGenerator, WatermarkStrategy, WatermarkedStream,
};
#[cfg(feature = "streaming")]
pub use window::{TimeWindow, WindowManager, WindowType};
#[cfg(not(feature = "streaming"))]
pub struct StreamRuleEngine;
#[cfg(not(feature = "streaming"))]
impl StreamRuleEngine {
pub fn new() -> Self {
StreamRuleEngine
}
pub fn with_config(_config: StreamConfig) -> Self {
panic!("StreamRuleEngine configuration methods require the 'streaming' feature to be enabled. Enable it in Cargo.toml: features = [\"streaming\"]");
}
pub async fn add_rule(&mut self, _grl_rule: &str) -> Result<()> {
Err(crate::RuleEngineError::FeatureNotEnabled {
feature: "streaming".to_string(),
message: "Streaming rule engine requires the 'streaming' feature to be enabled"
.to_string(),
})
}
pub async fn add_rule_file<P: AsRef<std::path::Path>>(&mut self, _path: P) -> Result<()> {
Err(crate::RuleEngineError::FeatureNotEnabled {
feature: "streaming".to_string(),
message: "Streaming rule engine requires the 'streaming' feature to be enabled"
.to_string(),
})
}
pub async fn register_action_handler<F>(&self, _action_type: &str, _handler: F)
where
F: Fn(&StreamAction) + Send + Sync + 'static,
{
panic!("StreamRuleEngine action handlers require the 'streaming' feature to be enabled. Enable it in Cargo.toml: features = [\"streaming\"]");
}
pub async fn start(&mut self) -> Result<()> {
Err(crate::RuleEngineError::FeatureNotEnabled {
feature: "streaming".to_string(),
message: "Streaming rule engine requires the 'streaming' feature to be enabled"
.to_string(),
})
}
pub async fn stop(&self) {
panic!("StreamRuleEngine stop method requires the 'streaming' feature to be enabled. Enable it in Cargo.toml: features = [\"streaming\"]");
}
pub async fn send_event(&self, _event: StreamEvent) -> Result<()> {
Err(crate::RuleEngineError::FeatureNotEnabled {
feature: "streaming".to_string(),
message: "Streaming rule engine requires the 'streaming' feature to be enabled"
.to_string(),
})
}
pub async fn execute_rules(&mut self) -> Result<StreamExecutionResult> {
Err(crate::RuleEngineError::FeatureNotEnabled {
feature: "streaming".to_string(),
message: "Streaming rule engine requires the 'streaming' feature to be enabled"
.to_string(),
})
}
pub async fn get_window_statistics(&self) -> crate::streaming::window::WindowStatistics {
panic!("StreamRuleEngine window statistics require the 'streaming' feature to be enabled. Enable it in Cargo.toml: features = [\"streaming\"]");
}
pub async fn get_field_analytics(
&self,
_field: &str,
) -> std::collections::HashMap<String, crate::types::Value> {
panic!("StreamRuleEngine field analytics require the 'streaming' feature to be enabled. Enable it in Cargo.toml: features = [\"streaming\"]");
}
pub async fn is_running(&self) -> bool {
panic!("StreamRuleEngine running status requires the 'streaming' feature to be enabled. Enable it in Cargo.toml: features = [\"streaming\"]");
}
}