Use set for batch indexer request restore.

This commit is contained in:
Kishore Nallan 2021-11-30 19:35:41 +05:30
parent 1bd028e951
commit 11f919c4f8

View File

@ -354,7 +354,7 @@ void BatchedIndexer::load_state(const nlohmann::json& state) {
queued_writes = state["queued_writes"].get<int64_t>();
size_t num_reqs_restored = 0;
std::vector<uint64_t> queue_ids;
std::set<uint64_t> queue_ids;
for(auto& kv: state["req_res_map"].items()) {
std::shared_ptr<http_req> req = std::make_shared<http_req>();
@ -382,7 +382,7 @@ void BatchedIndexer::load_state(const nlohmann::json& state) {
const std::string& coll_name = get_collection_name(req);
uint64_t queue_id = StringUtils::hash_wy(coll_name.c_str(), coll_name.size()) % num_threads;
queue_ids.push_back(queue_id);
queue_ids.insert(queue_id);
std::unique_lock qlk(qmutuxes[queue_id].mcv);
queues[queue_id].emplace_back(req->start_ts);
}