feat: Report disk usage stats to metasrv thru heartbeat (#1167)

* feat: Report disk usage stats to metasrv thru heartbeat

Signed-off-by: Zheming Li <nkdudu@126.com>

* Update src/catalog/src/error.rs

Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com>

* Update src/catalog/src/lib.rs

Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com>

* Update src/mito/src/table.rs

Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com>

---------

Signed-off-by: Zheming Li <nkdudu@126.com>
Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com>
This commit is contained in:
Zheming Li
2023-03-15 11:11:32 +08:00
committed by GitHub
parent cbf64e65b9
commit f712f978cf
5 changed files with 75 additions and 14 deletions

View File

@@ -103,6 +103,14 @@ pub trait Table: Send + Sync {
async fn close(&self) -> Result<()> {
Ok(())
}
/// Get region stats in this table.
fn region_stats(&self) -> Result<Vec<RegionStat>> {
UnsupportedSnafu {
operation: "REGION_STATS",
}
.fail()?
}
}
pub type TableRef = Arc<dyn Table>;
@@ -113,3 +121,9 @@ pub trait TableIdProvider {
}
pub type TableIdProviderRef = Arc<dyn TableIdProvider + Send + Sync>;
#[derive(Default, Debug)]
pub struct RegionStat {
pub region_id: u64,
pub disk_usage_bytes: u64,
}