From 7ab571fbe47034b2d7b3740b513d87ae14e0b47e Mon Sep 17 00:00:00 2001 From: yangjundong <1047934838@qq.com> Date: Tue, 14 Jan 2025 14:41:11 +0000 Subject: [PATCH] [fix][store] Remove unuse parameter and rename func name --- src/coordinator/coordinator_control.h | 4 ++-- src/coordinator/coordinator_control_coor.cc | 12 ++++++------ src/coordinator/coordinator_control_meta.cc | 4 ++-- src/server/coordinator_service.cc | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/coordinator/coordinator_control.h b/src/coordinator/coordinator_control.h index 95a1d54c0..941026f80 100644 --- a/src/coordinator/coordinator_control.h +++ b/src/coordinator/coordinator_control.h @@ -320,7 +320,7 @@ class CoordinatorControl : public MetaControl { // create region butil::Status CreateRegionWithJobList(std::vector &store_operations, - int64_t new_region_id, pb::coordinator_internal::MetaIncrement &meta_increment); + pb::coordinator_internal::MetaIncrement &meta_increment); // create schema // in: tenant_id @@ -885,7 +885,7 @@ class CoordinatorControl : public MetaControl { const pb::coordinator::RegionCmd ®ion_cmd, pb::coordinator::StoreOperation &store_operation); - butil::Status SendTaskStoreOperation(int64_t store_id, const pb::coordinator::StoreOperation &store_operation, + butil::Status SendStoreOperation(int64_t store_id, const pb::coordinator::StoreOperation &store_operation, pb::coordinator_internal::MetaIncrement &meta_increment); // move region_cmd from one store to another store diff --git a/src/coordinator/coordinator_control_coor.cc b/src/coordinator/coordinator_control_coor.cc index 36c59f55b..d5c2a1ac2 100644 --- a/src/coordinator/coordinator_control_coor.cc +++ b/src/coordinator/coordinator_control_coor.cc @@ -1547,7 +1547,7 @@ butil::Status CoordinatorControl::CreateRegionForSplit(const std::string& region if (!ret1.ok()) { return ret1; } - return CreateRegionWithJobList(store_operations, new_region_id, meta_increment); + return CreateRegionWithJobList(store_operations, meta_increment); } butil::Status CoordinatorControl::SelectStore(pb::common::StoreType store_type, int32_t replica_num, @@ -3767,7 +3767,7 @@ butil::Status CoordinatorControl::TransferLeaderRegionWithJobList( } butil::Status CoordinatorControl::CreateRegionWithJobList( - std::vector& store_operations, int64_t new_region_id, + std::vector& store_operations, pb::coordinator_internal::MetaIncrement& meta_increment) { // create task list auto* new_job_list = CreateJobList(meta_increment, "CreateRegion"); @@ -5958,7 +5958,7 @@ butil::Status CoordinatorControl::ProcessJobList() { } // process store_operation_map for (const auto& [store_id, store_operation] : store_operation_map) { - auto status = SendTaskStoreOperation(store_id, store_operation, meta_increment); + auto status = SendStoreOperation(store_id, store_operation, meta_increment); if (!status.ok()) { DINGO_LOG(ERROR) << fmt::format( "[joblist] ProcessSingleJobList failed, error:{}, store_id:{}, store_operation:{}", @@ -6710,9 +6710,9 @@ butil::Status CoordinatorControl::UpdateTaskProcess(const pb::coordinator_intern return butil::Status::OK(); } -butil::Status CoordinatorControl::SendTaskStoreOperation(int64_t store_id, - const pb::coordinator::StoreOperation& store_operation, - pb::coordinator_internal::MetaIncrement& meta_increment) { +butil::Status CoordinatorControl::SendStoreOperation(int64_t store_id, + const pb::coordinator::StoreOperation& store_operation, + pb::coordinator_internal::MetaIncrement& meta_increment) { auto store = GetStore(store_id); if (store.state() == pb::common::StoreState::STORE_NORMAL) { diff --git a/src/coordinator/coordinator_control_meta.cc b/src/coordinator/coordinator_control_meta.cc index 5138a4afc..490584bbe 100644 --- a/src/coordinator/coordinator_control_meta.cc +++ b/src/coordinator/coordinator_control_meta.cc @@ -755,7 +755,7 @@ butil::Status CoordinatorControl::CreateTable(int64_t schema_id, const pb::meta: << ", table_definition:" << table_definition.ShortDebugString() << " ret: " << ret.error_str(); return ret; } - CreateRegionWithJobList(store_operations, new_region_id, meta_increment); + CreateRegionWithJobList(store_operations, meta_increment); DINGO_LOG(INFO) << "CreateTable create region success, region_id=" << new_region_id; new_region_ids.push_back(new_region_id); @@ -1408,7 +1408,7 @@ butil::Status CoordinatorControl::CreateIndex(int64_t schema_id, const pb::meta: DINGO_LOG(ERROR) << "CreateRegion failed in CreateIndex index_name=" << table_definition.name(); return ret; } - CreateRegionWithJobList(store_operations, new_region_id, meta_increment); + CreateRegionWithJobList(store_operations, meta_increment); DINGO_LOG(INFO) << "CreateIndex create region success, region_id=" << new_region_id; new_region_ids.push_back(new_region_id); diff --git a/src/server/coordinator_service.cc b/src/server/coordinator_service.cc index fc13c0943..89a3a647c 100644 --- a/src/server/coordinator_service.cc +++ b/src/server/coordinator_service.cc @@ -1317,7 +1317,7 @@ void DoCreateRegion(google::protobuf::RpcController * /*controller*/, response->mutable_error()->set_errmsg(ret.error_str()); return; } - ret = coordinator_control->CreateRegionWithJobList(store_operations, new_region_id, meta_increment); + ret = coordinator_control->CreateRegionWithJobList(store_operations, meta_increment); } else { // store_ids is empty, will auto select store std::vector store_ids; @@ -1332,7 +1332,7 @@ void DoCreateRegion(google::protobuf::RpcController * /*controller*/, response->mutable_error()->set_errmsg(ret.error_str()); return; } - ret = coordinator_control->CreateRegionWithJobList(store_operations, new_region_id, meta_increment); + ret = coordinator_control->CreateRegionWithJobList(store_operations, meta_increment); } if (!ret.ok()) {