mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-19 06:20:38 +00:00
feat: manual compact api (#1912)
* merge develop * chore: merge develop * fix: some cr commentx * fix: cr comments
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user