Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: implement local barrier manager as event handler #14342

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compute/src/rpc/service/stream_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl StreamService for StreamServiceImpl {
}

self.mgr
.send_barrier(&barrier, req.actor_ids_to_send, req.actor_ids_to_collect)
.send_barrier(barrier, req.actor_ids_to_send, req.actor_ids_to_collect)
.await?;

Ok(Response::new(InjectBarrierResponse {
Expand Down
2 changes: 1 addition & 1 deletion src/stream/src/executor/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ where
.into()));

// Collect barriers to local barrier manager
self.context.lock_barrier_manager().collect(id, &barrier);
self.context.barrier_manager().collect(id, &barrier);

// Then stop this actor if asked
if barrier.is_stop(id) {
Expand Down
4 changes: 1 addition & 3 deletions src/stream/src/executor/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ impl Executor for ChainExecutor {
#[cfg(test)]
mod test {
use std::default::Default;
use std::sync::Arc;

use futures::StreamExt;
use risingwave_common::array::stream_chunk::StreamChunkTestExt;
Expand All @@ -144,8 +143,7 @@ mod test {
#[tokio::test]
async fn test_basic() {
let barrier_manager = LocalBarrierManager::for_test();
let progress =
CreateMviewProgress::for_test(Arc::new(parking_lot::Mutex::new(barrier_manager)));
let progress = CreateMviewProgress::for_test(barrier_manager);
let actor_id = progress.actor_id();

let schema = Schema::new(vec![Field::unnamed(DataType::Int64)]);
Expand Down
4 changes: 1 addition & 3 deletions src/stream/src/executor/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ impl Executor for ValuesExecutor {

#[cfg(test)]
mod tests {
use std::sync::Arc;

use futures::StreamExt;
use risingwave_common::array::{
Expand All @@ -174,8 +173,7 @@ mod tests {
#[tokio::test]
async fn test_values() {
let barrier_manager = LocalBarrierManager::for_test();
let progress =
CreateMviewProgress::for_test(Arc::new(parking_lot::Mutex::new(barrier_manager)));
let progress = CreateMviewProgress::for_test(barrier_manager);
let actor_id = progress.actor_id();
let (tx, barrier_receiver) = unbounded_channel();
let value = StructValue::new(vec![Some(1.into()), Some(2.into()), Some(3.into())]);
Expand Down
2 changes: 1 addition & 1 deletion src/stream/src/from_proto/barrier_recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl ExecutorBuilder for BarrierRecvExecutorBuilder {
let (sender, barrier_receiver) = unbounded_channel();
stream
.context
.lock_barrier_manager()
.barrier_manager()
.register_sender(params.actor_context.id, sender);

Ok(BarrierRecvExecutor::new(params.actor_context, params.info, barrier_receiver).boxed())
Expand Down
2 changes: 1 addition & 1 deletion src/stream/src/from_proto/now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl ExecutorBuilder for NowExecutorBuilder {
let (sender, barrier_receiver) = unbounded_channel();
stream
.context
.lock_barrier_manager()
.barrier_manager()
.register_sender(params.actor_context.id, sender);

let state_table =
Expand Down
2 changes: 1 addition & 1 deletion src/stream/src/from_proto/source/trad_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl ExecutorBuilder for SourceExecutorBuilder {
let (sender, barrier_receiver) = unbounded_channel();
stream
.context
.lock_barrier_manager()
.barrier_manager()
.register_sender(params.actor_context.id, sender);
let system_params = params.env.system_params_manager_ref().get_params();

Expand Down
2 changes: 1 addition & 1 deletion src/stream/src/from_proto/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl ExecutorBuilder for ValuesExecutorBuilder {
let (sender, barrier_receiver) = unbounded_channel();
stream
.context
.lock_barrier_manager()
.barrier_manager()
.register_sender(params.actor_context.id, sender);
let progress = stream
.context
Expand Down
Loading
Loading