mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-29 11:20:38 +00:00
feat: implement manual type for async index build (#7104)
* feat: prepare for index_build command Signed-off-by: SNC123 <sinhco@outlook.com> * feat: impl manual index build Signed-off-by: SNC123 <sinhco@outlook.com> * chore: clippy and fmt Signed-off-by: SNC123 <sinhco@outlook.com> * test: add idempotency check for manual build Signed-off-by: SNC123 <sinhco@outlook.com> * chore: apply suggestions Signed-off-by: SNC123 <sinhco@outlook.com> * chore: update proto Signed-off-by: SNC123 <sinhco@outlook.com> * chore: apply suggestions Signed-off-by: SNC123 <sinhco@outlook.com> * chore: fmt Signed-off-by: SNC123 <sinhco@outlook.com> * chore: update proto souce to greptimedb Signed-off-by: SNC123 <sinhco@outlook.com> * fix: cargo.lock Signed-off-by: SNC123 <sinhco@outlook.com> --------- Signed-off-by: SNC123 <sinhco@outlook.com>
This commit is contained in:
@@ -22,9 +22,10 @@ use api::v1::column_def::{
|
||||
};
|
||||
use api::v1::region::bulk_insert_request::Body;
|
||||
use api::v1::region::{
|
||||
AlterRequest, AlterRequests, BulkInsertRequest, CloseRequest, CompactRequest, CreateRequest,
|
||||
CreateRequests, DeleteRequests, DropRequest, DropRequests, FlushRequest, InsertRequests,
|
||||
OpenRequest, TruncateRequest, alter_request, compact_request, region_request, truncate_request,
|
||||
AlterRequest, AlterRequests, BuildIndexRequest, BulkInsertRequest, CloseRequest,
|
||||
CompactRequest, CreateRequest, CreateRequests, DeleteRequests, DropRequest, DropRequests,
|
||||
FlushRequest, InsertRequests, OpenRequest, TruncateRequest, alter_request, compact_request,
|
||||
region_request, truncate_request,
|
||||
};
|
||||
use api::v1::{
|
||||
self, Analyzer, ArrowIpc, FulltextBackend as PbFulltextBackend, Option as PbOption, Rows,
|
||||
@@ -166,6 +167,7 @@ impl RegionRequest {
|
||||
region_request::Body::Alter(alter) => make_region_alter(alter),
|
||||
region_request::Body::Flush(flush) => make_region_flush(flush),
|
||||
region_request::Body::Compact(compact) => make_region_compact(compact),
|
||||
region_request::Body::BuildIndex(index) => make_region_build_index(index),
|
||||
region_request::Body::Truncate(truncate) => make_region_truncate(truncate),
|
||||
region_request::Body::Creates(creates) => make_region_creates(creates),
|
||||
region_request::Body::Drops(drops) => make_region_drops(drops),
|
||||
@@ -354,6 +356,14 @@ fn make_region_compact(compact: CompactRequest) -> Result<Vec<(RegionId, RegionR
|
||||
)])
|
||||
}
|
||||
|
||||
fn make_region_build_index(index: BuildIndexRequest) -> Result<Vec<(RegionId, RegionRequest)>> {
|
||||
let region_id = index.region_id.into();
|
||||
Ok(vec![(
|
||||
region_id,
|
||||
RegionRequest::BuildIndex(RegionBuildIndexRequest {}),
|
||||
)])
|
||||
}
|
||||
|
||||
fn make_region_truncate(truncate: TruncateRequest) -> Result<Vec<(RegionId, RegionRequest)>> {
|
||||
let region_id = truncate.region_id.into();
|
||||
match truncate.kind {
|
||||
|
||||
Reference in New Issue
Block a user