pub struct ClusterStreamCoordinator { /* private fields */ }Expand description
Manages stream job distribution across a cluster.
Uses the DistributedStreamTopology to place job partitions on nodes
and tracks running jobs.
Implementations§
Source§impl ClusterStreamCoordinator
impl ClusterStreamCoordinator
Sourcepub fn new(topology: Arc<DistributedStreamTopology>) -> Self
pub fn new(topology: Arc<DistributedStreamTopology>) -> Self
Creates a new coordinator backed by the given topology.
Sourcepub async fn submit_job(&self, job: StreamJob) -> DistributedResult<String>
pub async fn submit_job(&self, job: StreamJob) -> DistributedResult<String>
Submits a new stream job, distributing its partitions across available nodes.
Returns the job ID on success.
Sourcepub fn cancel_job(&self, job_id: &str) -> DistributedResult<()>
pub fn cancel_job(&self, job_id: &str) -> DistributedResult<()>
Cancels an active job by ID.
Sourcepub fn get_job(&self, job_id: &str) -> Option<StreamJob>
pub fn get_job(&self, job_id: &str) -> Option<StreamJob>
Returns a snapshot of a specific job by ID.
Sourcepub fn stats(&self) -> CoordinatorStats
pub fn stats(&self) -> CoordinatorStats
Returns coordinator statistics.
Sourcepub async fn rebalance_all_jobs(&self) -> DistributedResult<usize>
pub async fn rebalance_all_jobs(&self) -> DistributedResult<usize>
Rebalances all active jobs when the topology changes.
Returns the number of jobs that were rebalanced.
Auto Trait Implementations§
impl Freeze for ClusterStreamCoordinator
impl !RefUnwindSafe for ClusterStreamCoordinator
impl Send for ClusterStreamCoordinator
impl Sync for ClusterStreamCoordinator
impl Unpin for ClusterStreamCoordinator
impl UnsafeUnpin for ClusterStreamCoordinator
impl !UnwindSafe for ClusterStreamCoordinator
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.