pub struct BrickDataTracker { /* private fields */ }Expand description
Track where brick weights/data reside across workers
Used for locality-aware scheduling to minimize data movement.
Implementations§
Source§impl BrickDataTracker
impl BrickDataTracker
Sourcepub fn track_data(&self, key: &str, worker_id: WorkerId, size_bytes: usize)
pub fn track_data(&self, key: &str, worker_id: WorkerId, size_bytes: usize)
Register that a worker has certain data
Sourcepub fn track_weights(&self, brick_name: &str, worker_id: WorkerId)
pub fn track_weights(&self, brick_name: &str, worker_id: WorkerId)
Register that a worker has brick weights
Sourcepub fn remove_data(&self, key: &str, worker_id: WorkerId)
pub fn remove_data(&self, key: &str, worker_id: WorkerId)
Remove data location from a worker
Sourcepub fn get_workers_for_data(&self, key: &str) -> Vec<WorkerId>
pub fn get_workers_for_data(&self, key: &str) -> Vec<WorkerId>
Get workers that have specific data
Sourcepub fn calculate_affinity(
&self,
dependencies: &[String],
) -> HashMap<WorkerId, f64>
pub fn calculate_affinity( &self, dependencies: &[String], ) -> HashMap<WorkerId, f64>
Calculate affinity scores for workers based on data dependencies
Sourcepub fn find_best_worker(&self, brick: &dyn Brick) -> Option<WorkerId>
pub fn find_best_worker(&self, brick: &dyn Brick) -> Option<WorkerId>
Find the best worker for a brick based on data locality
Sourcepub fn find_best_worker_for_distributed<B: Brick>(
&self,
brick: &DistributedBrick<B>,
) -> Option<WorkerId>
pub fn find_best_worker_for_distributed<B: Brick>( &self, brick: &DistributedBrick<B>, ) -> Option<WorkerId>
Find best worker for distributed brick with dependencies
Sourcepub fn total_data_size(&self) -> usize
pub fn total_data_size(&self) -> usize
Get total data size tracked
Trait Implementations§
Source§impl Debug for BrickDataTracker
impl Debug for BrickDataTracker
Auto Trait Implementations§
impl !Freeze for BrickDataTracker
impl RefUnwindSafe for BrickDataTracker
impl Send for BrickDataTracker
impl Sync for BrickDataTracker
impl Unpin for BrickDataTracker
impl UnsafeUnpin for BrickDataTracker
impl UnwindSafe for BrickDataTracker
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> 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<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().