11use crate :: core:: Event ;
22use crate :: parsing:: janusql_parser:: WindowDefinition ;
33use crate :: storage:: segmented_storage:: StreamingSegmentedStorage ;
4- use std:: sync :: Arc ;
4+ use std:: rc :: Rc ;
55
66/// Operator for processing historical data with a fixed window.
77/// Unlike sliding windows, this queries a single fixed time range [start, end].
88pub struct HistoricalFixedWindowOperator {
9- storage : Arc < StreamingSegmentedStorage > ,
9+ storage : Rc < StreamingSegmentedStorage > ,
1010 window_def : WindowDefinition ,
1111 has_yielded : bool ,
1212}
@@ -18,7 +18,7 @@ impl HistoricalFixedWindowOperator {
1818 ///
1919 /// * `storage` - The storage backend to query.
2020 /// * `window_def` - The window definition with start and end timestamps.
21- pub fn new ( storage : Arc < StreamingSegmentedStorage > , window_def : WindowDefinition ) -> Self {
21+ pub fn new ( storage : Rc < StreamingSegmentedStorage > , window_def : WindowDefinition ) -> Self {
2222 HistoricalFixedWindowOperator { storage, window_def, has_yielded : false }
2323 }
2424}
@@ -75,7 +75,7 @@ mod tests {
7575 let _ = fs:: remove_dir_all ( test_dir) ;
7676
7777 let config = create_test_config ( test_dir) ;
78- let storage = Arc :: new ( StreamingSegmentedStorage :: new ( config) . unwrap ( ) ) ;
78+ let storage = Rc :: new ( StreamingSegmentedStorage :: new ( config) . unwrap ( ) ) ;
7979
8080 // Write events at timestamps 100, 200, 300, 400, 500, 600
8181 for i in 1 ..=6 {
0 commit comments