pub struct ShuffleReceiver { /* private fields */ }Expand description
Inbound side of the shuffle fabric: a Tonic ShuffleTransport server
surfacing every received frame, attributed to its sending peer, on the
bounded crossfire queue.
Implementations§
Source§impl ShuffleReceiver
impl ShuffleReceiver
Sourcepub async fn bind(local_id: ShufflePeerId, addr: SocketAddr) -> Result<Self>
pub async fn bind(local_id: ShufflePeerId, addr: SocketAddr) -> Result<Self>
Bind on addr and start serving. The bound address (with any ephemeral
port resolved) is exposed via Self::local_addr.
§Errors
Returns io::Error on bind failure.
Sourcepub async fn bind_with_kv(
local_id: ShufflePeerId,
addr: SocketAddr,
kv: Arc<dyn ClusterKv>,
) -> Result<Self>
pub async fn bind_with_kv( local_id: ShufflePeerId, addr: SocketAddr, kv: Arc<dyn ClusterKv>, ) -> Result<Self>
Bind and publish the listener’s address into kv under
SHUFFLE_ADDR_KEY for peer discovery.
§Errors
Returns io::Error on bind failure.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Local socket address the server is bound to.
Sourcepub async fn recv(&self) -> Option<(ShufflePeerId, ShuffleMessage)>
pub async fn recv(&self) -> Option<(ShufflePeerId, ShuffleMessage)>
Await the next (peer_id, msg). None once the server task has stopped
and every queued item is drained. Single-owner; concurrent callers
serialise via rx_returned. Cancellation-safe — a dropped recv()
future returns the receiver to its slot via the RAII guard.
Sourcepub fn drain_available(&self) -> Vec<(ShufflePeerId, ShuffleMessage)>
pub fn drain_available(&self) -> Vec<(ShufflePeerId, ShuffleMessage)>
Drain every currently-available (peer_id, msg) without blocking. Empty
when the queue is empty or a recv() currently holds the receiver.
Sourcepub fn drain_vnode_data_for(&self, stage: &str) -> Vec<RecordBatch>
pub fn drain_vnode_data_for(&self, stage: &str) -> Vec<RecordBatch>
Non-blocking drain of the ShuffleMessage::VnodeData batches for
stage; other stages stay bucketed for their own drainer. Empty if the
queue is empty or a recv() holds it.
Sourcepub fn drain_staged_with_prefix(
&self,
prefix: &str,
) -> FxHashMap<String, Vec<RecordBatch>>
pub fn drain_staged_with_prefix( &self, prefix: &str, ) -> FxHashMap<String, Vec<RecordBatch>>
Single lock-cycle drain of every staged stage whose key starts with
prefix, lifting those out and leaving operator stages untouched. Lets
the subscription router pull all __sub:: batches in one pass.
Sourcepub fn stage_batch(&self, stage: String, batch: RecordBatch)
pub fn stage_batch(&self, stage: String, batch: RecordBatch)
Stage batch under stage for a later Self::drain_vnode_data_for /
Self::drain_all_staged — used when no operator for stage exists yet
at drain time.
Sourcepub fn drain_staged_barriers(&self) -> Vec<(ShufflePeerId, CheckpointBarrier)>
pub fn drain_staged_barriers(&self) -> Vec<(ShufflePeerId, CheckpointBarrier)>
Take the barriers stashed by Self::drain_vnode_data_for (peers that
fanned out before this node began aligning).
Sourcepub fn drain_all_staged(&self) -> Vec<(String, RecordBatch)>
pub fn drain_all_staged(&self) -> Vec<(String, RecordBatch)>
Empty the per-stage holdover, returning every buffered (stage, batch).
Trait Implementations§
Source§impl Debug for ShuffleReceiver
impl Debug for ShuffleReceiver
Source§impl Drop for ShuffleReceiver
impl Drop for ShuffleReceiver
Auto Trait Implementations§
impl !Freeze for ShuffleReceiver
impl !RefUnwindSafe for ShuffleReceiver
impl !UnwindSafe for ShuffleReceiver
impl Send for ShuffleReceiver
impl Sync for ShuffleReceiver
impl Unpin for ShuffleReceiver
impl UnsafeUnpin for ShuffleReceiver
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].