use super::NotImplemented;
use crate::common::Result;
pub async fn repair_cluster(
_coordinator_url: &str,
_replicas: usize,
_dry_run: bool,
) -> Result<RepairReport> {
Err(NotImplemented::REPAIR.into())
}
pub async fn auto_rebalance_cluster(_coordinator_url: &str) -> Result<()> {
Err(NotImplemented::REBALANCE.into())
}
#[derive(Debug, serde::Serialize)]
pub struct RepairReport {
pub keys_checked: usize,
pub keys_repaired: usize,
pub bytes_copied: u64,
}
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn repair_and_rebalance_fail_instead_of_reporting() {
let repair = repair_cluster("http://127.0.0.1:1", 3, true).await;
assert_eq!(
repair.unwrap_err().to_string(),
"repair is not implemented (roadmap: 2.2.0)"
);
let rebalance = auto_rebalance_cluster("http://127.0.0.1:1").await;
assert_eq!(
rebalance.unwrap_err().to_string(),
"rebalance is not implemented (roadmap: 2.2.0)"
);
}
}