feat: flush or compact table and region functions (#3363)

* feat: adds Requester to process table flush and compaction request

* feat: admin_fn macros for administration functions

* test: add query result

* feat: impl flush_region, flush_table, compact_region, and flush_region functions

* docs: add Arguments to admin_fn macro

* chore: apply suggestion

Co-authored-by: Zhenchi <zhongzc_arch@outlook.com>

* chore: apply suggestion

Co-authored-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: group_requests_by_peer and adds log

* Update src/common/macro/src/admin_fn.rs

Co-authored-by: Ruihang Xia <waynestxia@gmail.com>

* feat: adds todo for spawan thread

* feat: rebase with main

---------

Co-authored-by: Zhenchi <zhongzc_arch@outlook.com>
Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
dennis zhuang
2024-02-27 16:57:38 +08:00
committed by GitHub
parent dbb1ce1a9b
commit 4b36c285f1
44 changed files with 1590 additions and 389 deletions

View File

@@ -868,6 +868,8 @@ async fn find_region_distribution_by_sql(cluster: &GreptimeDbCluster) -> RegionD
let recordbatches = RecordBatches::try_collect(stream).await.unwrap();
info!("SQL result:\n {}", recordbatches.pretty_print().unwrap());
let mut distribution = RegionDistribution::new();
for batch in recordbatches.take() {
@@ -911,6 +913,8 @@ async fn trigger_migration_by_sql(
let recordbatches = RecordBatches::try_collect(stream).await.unwrap();
info!("SQL result:\n {}", recordbatches.pretty_print().unwrap());
let Value::String(procedure_id) = recordbatches.take()[0].column(0).get(0) else {
unreachable!();
};
@@ -932,6 +936,8 @@ async fn query_procedure_by_sql(instance: &Arc<Instance>, pid: &str) -> String {
let recordbatches = RecordBatches::try_collect(stream).await.unwrap();
info!("SQL result:\n {}", recordbatches.pretty_print().unwrap());
let Value::String(state) = recordbatches.take()[0].column(0).get(0) else {
unreachable!();
};