risingwave_stream/executor/source/batch_source/
mod.rs1mod batch_posix_fs_list;
16pub use batch_posix_fs_list::*;
17mod batch_posix_fs_fetch;
18pub use batch_posix_fs_fetch::*;
19mod batch_opendal_fs_list;
20pub(crate) use batch_opendal_fs_list::*;
21mod batch_opendal_fs_fetch;
22pub use batch_opendal_fs_fetch::*;
23mod batch_iceberg_list;
24pub use batch_iceberg_list::*;
25mod batch_iceberg_fetch;
26pub use batch_iceberg_fetch::*;
27
28macro_rules! feature_gated_executor_mod {
54 (
55 $mod_name:ident,
56 $executor_name:ident <S: StateStore>,
57 $source_name:literal,
58 ( $( $param_name:ident : $param_type:ty ),* $(,)? )
59 ) => {
60 paste::paste! {
61 #[cfg(feature = "source-" $source_name)]
62 mod $mod_name;
63 #[cfg(feature = "source-" $source_name)]
64 pub use $mod_name::*;
65
66 #[cfg(not(feature = "source-" $source_name))]
67 #[doc = "Dummy implementation for executor when the feature `source-" $source_name "` is not enabled."]
68 mod [<$mod_name _stub>] {
69 #![allow(unused_imports)]
70 use std::sync::Arc;
71
72 use risingwave_common::id::TableId;
73 use risingwave_storage::StateStore;
74 use tokio::sync::mpsc::UnboundedReceiver;
75
76 use crate::executor::prelude::*;
77 use crate::executor::source::StreamSourceCore;
78 use crate::task::LocalBarrierManager;
79
80 fn err_feature_not_enabled() -> StreamExecutorError {
81 StreamExecutorError::from(anyhow::anyhow!(
82 "Feature `source-{}` is not enabled at compile time. \
83 Please enable it in `Cargo.toml` and rebuild.",
84 $source_name
85 ))
86 }
87
88 #[doc = "A dummy executor that returns an error, as the feature `source-" $source_name "` is currently not enabled."]
89 pub struct $executor_name<S: StateStore> {
90 _marker: std::marker::PhantomData<S>,
91 }
92
93 impl<S: StateStore> $executor_name<S> {
94 #[allow(clippy::too_many_arguments)]
95 pub fn new( $( $param_name : $param_type ),* ) -> Self {
96 $( let _ = $param_name; )*
98 Self {
99 _marker: std::marker::PhantomData,
100 }
101 }
102 }
103
104 impl<S: StateStore> Execute for $executor_name<S> {
105 fn execute(self: Box<Self>) -> BoxedMessageStream {
106 futures::stream::once(async { Err(err_feature_not_enabled()) }).boxed()
107 }
108 }
109
110 impl<S: StateStore> std::fmt::Debug for $executor_name<S> {
111 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
112 f.debug_struct(concat!(stringify!($executor_name), " (stub)"))
113 .finish()
114 }
115 }
116 }
117 #[cfg(not(feature = "source-" $source_name))]
118 pub use [<$mod_name _stub>]::*;
119 }
120 };
121}
122
123feature_gated_executor_mod!(
124 batch_adbc_snowflake_list,
125 BatchAdbcSnowflakeListExecutor<S: StateStore>,
126 "adbc_snowflake",
127 (
128 _actor_ctx: ActorContextRef,
129 _stream_source_core: StreamSourceCore<S>,
130 _metrics: Arc<StreamingMetrics>,
131 _barrier_receiver: UnboundedReceiver<Barrier>,
132 _barrier_manager: LocalBarrierManager,
133 _associated_table_id: Option<TableId>,
134 )
135);
136
137feature_gated_executor_mod!(
138 batch_adbc_snowflake_fetch,
139 BatchAdbcSnowflakeFetchExecutor<S: StateStore>,
140 "adbc_snowflake",
141 (
142 _actor_ctx: ActorContextRef,
143 _stream_source_core: StreamSourceCore<S>,
144 _upstream: Executor,
145 _barrier_manager: LocalBarrierManager,
146 _associated_table_id: Option<TableId>,
147 )
148);