pub struct Cluster {
pub task_graph: Arc<TaskGraph>,
pub worker_pool: Arc<WorkerPool>,
pub scheduler: Arc<Scheduler>,
pub coordinator: Arc<ClusterCoordinator>,
pub fault_tolerance: Arc<FaultToleranceManager>,
pub locality_optimizer: Arc<DataLocalityOptimizer>,
pub cache: Arc<DistributedCache>,
pub replication: Arc<ReplicationManager>,
pub metrics: Arc<ClusterMetrics>,
}Expand description
Complete cluster instance.
The Cluster struct provides access to all cluster components including
the task graph, worker pool, scheduler, coordinator, fault tolerance,
data locality optimizer, distributed cache, and replication manager.
§Examples
use oxigdal_cluster::Cluster;
#[tokio::main]
async fn main() -> oxigdal_cluster::Result<()> {
// Create and start a cluster
let cluster = Cluster::new();
cluster.start().await?;
// Access cluster components
let metrics = cluster.metrics.snapshot();
println!("Tasks completed: {}", metrics.tasks_completed);
// Get cluster statistics
let stats = cluster.get_statistics();
println!("Total workers: {}", stats.worker_pool.total_workers);
// Stop the cluster
cluster.stop().await?;
Ok(())
}Fields§
§task_graph: Arc<TaskGraph>Task graph
worker_pool: Arc<WorkerPool>Worker pool
scheduler: Arc<Scheduler>Scheduler
coordinator: Arc<ClusterCoordinator>Coordinator
fault_tolerance: Arc<FaultToleranceManager>Fault tolerance manager
locality_optimizer: Arc<DataLocalityOptimizer>Data locality optimizer
cache: Arc<DistributedCache>Distributed cache
replication: Arc<ReplicationManager>Replication manager
metrics: Arc<ClusterMetrics>Cluster metrics
Implementations§
Source§impl Cluster
impl Cluster
Sourcepub fn get_statistics(&self) -> ClusterStatistics
pub fn get_statistics(&self) -> ClusterStatistics
Get cluster-wide statistics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cluster
impl !RefUnwindSafe for Cluster
impl Send for Cluster
impl Sync for Cluster
impl Unpin for Cluster
impl UnsafeUnpin for Cluster
impl !UnwindSafe for Cluster
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