feat: manual compact api (#1912)

* merge develop

* chore: merge develop

* fix: some cr commentx

* fix: cr comments
This commit is contained in:
Lei, HUANG
2023-07-11 12:00:39 +08:00
committed by GitHub
parent fc850c9988
commit a7ea3bbc16
22 changed files with 327 additions and 85 deletions

View File

@@ -285,6 +285,16 @@ pub struct FlushTableRequest {
pub wait: Option<bool>,
}
#[derive(Debug, Clone, Default)]
pub struct CompactTableRequest {
pub catalog_name: String,
pub schema_name: String,
pub table_name: Option<String>,
pub region_number: Option<RegionNumber>,
/// Wait until the compaction is done.
pub wait: Option<bool>,
}
#[macro_export]
macro_rules! meter_insert_request {
($req: expr) => {

View File

@@ -122,6 +122,14 @@ pub trait Table: Send + Sync {
fn statistics(&self) -> Option<TableStatistics> {
None
}
async fn compact(&self, region_number: Option<RegionNumber>, wait: Option<bool>) -> Result<()> {
let _ = (region_number, wait);
UnsupportedSnafu {
operation: "COMPACTION",
}
.fail()?
}
}
pub type TableRef = Arc<dyn Table>;