Skip to main content

risingwave_stream/from_proto/
no_op.rs

1// Copyright 2023 RisingWave Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use risingwave_pb::stream_plan::NoOpNode;
16use risingwave_storage::StateStore;
17
18use super::ExecutorBuilder;
19use crate::error::StreamResult;
20use crate::executor::{Executor, NoOpExecutor};
21use crate::task::ExecutorParams;
22
23pub struct NoOpExecutorBuilder;
24
25impl_stream_node_body!(NoOp(NoOpNode) => NoOpExecutorBuilder);
26
27impl ExecutorBuilder for NoOpExecutorBuilder {
28    type Node = NoOpNode;
29
30    async fn new_boxed_executor(
31        params: ExecutorParams,
32        _node: &NoOpNode,
33        _store: impl StateStore,
34    ) -> StreamResult<Executor> {
35        let [input]: [_; 1] = params.input.try_into().unwrap();
36        Ok((params.info, NoOpExecutor::new(params.actor_context, input)).into())
37    }
38}