Skip to content

Commit b28877e

Browse files
committed
add comment
1 parent 1aa0cc6 commit b28877e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/query/catalog/src/table_context.rs

+3
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ pub trait TableContext: Send + Sync {
419419
unimplemented!()
420420
}
421421

422+
/// Calling this function will automatically create a pipeline for broadcast data in `build_distributed_pipeline()`
423+
///
424+
/// The returned id can be used to get sender and receiver for broadcasting data.
422425
fn get_next_broadcast_id(&self) -> u32;
423426

424427
fn reset_broadcast_id(&self) {

src/query/service/src/sessions/query_ctx.rs

+9
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,22 @@ impl QueryContext {
291291
pub fn broadcast_source_receiver(&self, broadcast_id: u32) -> Receiver<BlockMetaInfoPtr> {
292292
self.shared.broadcast_source_receiver(broadcast_id)
293293
}
294+
295+
/// Get a sender to broadcast data
296+
///
297+
/// Note: The channel must be closed by calling close() after data transmission is completed
294298
pub fn broadcast_source_sender(&self, broadcast_id: u32) -> Sender<BlockMetaInfoPtr> {
295299
self.shared.broadcast_source_sender(broadcast_id)
296300
}
297301

302+
/// A receiver to receive broadcast data
303+
///
304+
/// Note: receive() can be called repeatedly until an Error is returned, indicating
305+
/// that the upstream channel has been closed
298306
pub fn broadcast_sink_receiver(&self, broadcast_id: u32) -> Receiver<BlockMetaInfoPtr> {
299307
self.shared.broadcast_sink_receiver(broadcast_id)
300308
}
309+
301310
pub fn broadcast_sink_sender(&self, broadcast_id: u32) -> Sender<BlockMetaInfoPtr> {
302311
self.shared.broadcast_sink_sender(broadcast_id)
303312
}

0 commit comments

Comments
 (0)