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

storage client retry #405

Closed

Conversation

panda-sheep
Copy link
Contributor

@panda-sheep panda-sheep commented Feb 1, 2021

As title

Co-authored-by: panda-sheep <59197347+panda-sheep@users.noreply.github.com>
std::unordered_map<PartitionID, K> getReqPartsIdFromContainer(
const std::unordered_map<PartitionID, K> &t, PartitionID partId) const {
std::unordered_map<PartitionID, K> ret;
ret.emplace(partId, t.at(partId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it is more straightforward to do so.

return std::unordered_map<PartitionID, K>{{partId, t.at(partId)}};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good,thx

}

template <typename K>
void addPartRequest(std::unordered_map<PartitionID, K> &oldMap,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const std::unordered_map<PartitionID, K> &oldMap

auto it = newMap.find(partId);
if (it != newMap.end()) {
it->second.insert(newMap.at(partId).end(),
oldMap.at(partId).begin(), oldMap.at(partId).end());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to use the move iterator(oldMap) here.

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2021

CLA assistant check
All committers have signed the CLA.

@Sophie-Xie Sophie-Xie closed this Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants