Skip to content

Commit

Permalink
[fix][store] Remove unuse parameter and rename func name
Browse files Browse the repository at this point in the history
  • Loading branch information
visualYJD committed Jan 15, 2025
1 parent c60599c commit 7ab571f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/coordinator/coordinator_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class CoordinatorControl : public MetaControl {

// create region
butil::Status CreateRegionWithJobList(std::vector<pb::coordinator::StoreOperation> &store_operations,
int64_t new_region_id, pb::coordinator_internal::MetaIncrement &meta_increment);
pb::coordinator_internal::MetaIncrement &meta_increment);

// create schema
// in: tenant_id
Expand Down Expand Up @@ -885,7 +885,7 @@ class CoordinatorControl : public MetaControl {
const pb::coordinator::RegionCmd &region_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
Expand Down
12 changes: 6 additions & 6 deletions src/coordinator/coordinator_control_coor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -3767,7 +3767,7 @@ butil::Status CoordinatorControl::TransferLeaderRegionWithJobList(
}

butil::Status CoordinatorControl::CreateRegionWithJobList(
std::vector<pb::coordinator::StoreOperation>& store_operations, int64_t new_region_id,
std::vector<pb::coordinator::StoreOperation>& store_operations,
pb::coordinator_internal::MetaIncrement& meta_increment) {
// create task list
auto* new_job_list = CreateJobList(meta_increment, "CreateRegion");
Expand Down Expand Up @@ -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:{}",
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/coordinator/coordinator_control_meta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/server/coordinator_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t> store_ids;
Expand All @@ -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()) {
Expand Down

0 comments on commit 7ab571f

Please sign in to comment.