Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
fix by review
Browse files Browse the repository at this point in the history
  • Loading branch information
hycdong committed Jun 22, 2020
1 parent 5962f62 commit a2a1d93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
11 changes: 11 additions & 0 deletions src/dist/replication/meta_server/meta_bulk_load_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ void bulk_load_service::handle_bulk_load_finish(const bulk_load_response &respon
}
}

// The replicas have cleaned up their bulk load states and removed temporary sst files
bool group_cleaned_up = response.is_group_bulk_load_context_cleaned_up;
ddebug_f("receive bulk load response from node({}) app({}) partition({}), primary status = {}, "
"is_group_bulk_load_context_cleaned_up = {}",
Expand Down Expand Up @@ -1000,6 +1001,16 @@ void bulk_load_service::remove_bulk_load_dir_on_remote_storage(std::shared_ptr<a
});
}

template <typename T>
inline void erase_map_elem_by_id(int32_t app_id, std::unordered_map<gpid, T> &mymap)
{
for (auto iter = mymap.begin(); iter != mymap.end();) {
if (iter->first.get_app_id() == app_id) {
mymap.erase(iter++);
}
}
}

// ThreadPool: THREAD_POOL_META_STATE
void bulk_load_service::reset_local_bulk_load_states(int32_t app_id, const std::string &app_name)
{
Expand Down
12 changes: 1 addition & 11 deletions src/dist/replication/meta_server/meta_bulk_load_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ struct bulk_load_info
DEFINE_JSON_SERIALIZATION(app_id, app_name, partition_count)
};

template <typename T>
inline void erase_map_elem_by_id(int32_t app_id, std::unordered_map<gpid, T> &mymap)
{
for (auto iter = mymap.begin(); iter != mymap.end();) {
if (iter->first.get_app_id() == app_id) {
mymap.erase(iter++);
}
}
}

///
/// Bulk load process:
/// when client sent `start_bulk_load_rpc` to meta server to start bulk load,
Expand Down Expand Up @@ -200,7 +190,7 @@ class bulk_load_service
bulk_load_status::type new_status,
bool should_send_request);

// callled when app is not available or dropped during bulk load, remove bulk load directory on
// called when app is not available or dropped during bulk load, remove bulk load directory on
// remote storage
void remove_bulk_load_dir_on_remote_storage(int32_t app_id, const std::string &app_name);

Expand Down

0 comments on commit a2a1d93

Please sign in to comment.