risingwave_stream/from_proto/
row_id_gen.rs1use risingwave_pb::stream_plan::RowIdGenNode;
16use risingwave_storage::StateStore;
17
18use super::ExecutorBuilder;
19use crate::error::StreamResult;
20use crate::executor::Executor;
21use crate::executor::row_id_gen::RowIdGenExecutor;
22use crate::task::ExecutorParams;
23
24pub struct RowIdGenExecutorBuilder;
25
26impl_stream_node_body!(RowIdGen(RowIdGenNode) => RowIdGenExecutorBuilder);
27
28impl ExecutorBuilder for RowIdGenExecutorBuilder {
29 type Node = RowIdGenNode;
30
31 async fn new_boxed_executor(
32 params: ExecutorParams,
33 node: &Self::Node,
34 _store: impl StateStore,
35 ) -> StreamResult<Executor> {
36 let [upstream]: [_; 1] = params.input.try_into().unwrap();
37 tracing::debug!("row id gen executor: {:?}", params.vnode_bitmap);
38 let vnodes = params
39 .vnode_bitmap
40 .expect("vnodes not set for row id gen executor");
41 let exec = RowIdGenExecutor::new(
42 params.actor_context,
43 upstream,
44 node.row_id_index as _,
45 vnodes,
46 );
47 Ok((params.info, exec).into())
48 }
49}