risingwave_stream/task/
mod.rs

1// Copyright 2025 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 crate::executor::exchange::permit::{Receiver, Sender};
16
17mod barrier_manager;
18mod env;
19mod stream_manager;
20
21pub use barrier_manager::*;
22pub use env::*;
23pub use stream_manager::*;
24
25pub type ConsumableChannelPair = (Option<Sender>, Option<Receiver>);
26pub type ActorId = u32;
27pub type FragmentId = u32;
28pub type DispatcherId = u64;
29/// (`upstream_actor_id`, `downstream_actor_id`)
30pub type UpDownActorIds = (ActorId, ActorId);
31pub type UpDownFragmentIds = (FragmentId, FragmentId);
32
33#[derive(Hash, Eq, PartialEq, Copy, Clone, Debug)]
34pub(crate) struct PartialGraphId(u32);
35
36#[cfg(test)]
37pub(crate) const TEST_DATABASE_ID: risingwave_common::catalog::DatabaseId =
38    risingwave_common::catalog::DatabaseId::new(u32::MAX);
39
40#[cfg(test)]
41pub(crate) const TEST_PARTIAL_GRAPH_ID: PartialGraphId = PartialGraphId(u32::MAX);
42
43impl PartialGraphId {
44    fn new(id: u32) -> Self {
45        Self(id)
46    }
47}
48
49impl From<PartialGraphId> for u32 {
50    fn from(val: PartialGraphId) -> u32 {
51        val.0
52    }
53}