use std::sync::{Arc, Mutex, RwLock};
use crate::multi_raft::MultiRaft;
use crate::routing::RoutingTable;
use crate::topology::ClusterTopology;
use crate::transport::NexarTransport;
use super::health::ClusterHealth;
pub struct BootstrapCtx {
pub topology: Arc<RwLock<ClusterTopology>>,
pub routing: Arc<RwLock<RoutingTable>>,
pub transport: Arc<NexarTransport>,
pub multi_raft: Arc<Mutex<MultiRaft>>,
pub health: ClusterHealth,
}
impl BootstrapCtx {
pub fn new(
topology: Arc<RwLock<ClusterTopology>>,
routing: Arc<RwLock<RoutingTable>>,
transport: Arc<NexarTransport>,
multi_raft: Arc<Mutex<MultiRaft>>,
health: ClusterHealth,
) -> Self {
Self {
topology,
routing,
transport,
multi_raft,
health,
}
}
}