- Address review comments

This commit is contained in:
Sreenath Bodagala 2021-07-26 19:39:08 +00:00
parent de020efa7f
commit 82774ae62c
2 changed files with 9 additions and 9 deletions

View File

@ -74,7 +74,7 @@ struct Tag {
int toTagDataIndex() const { return locality >= 0 ? 2 * locality : 1 - (2 * locality); }
bool isPseudoTag() const { return locality < 0; }
bool isNonPrimaryTLogType() const { return locality < 0; }
std::string toString() const { return format("%d:%d", locality, id); }

View File

@ -996,11 +996,11 @@ struct LogPushData : NonCopyable {
writtenLocations.clear();
}
// copy written_tags into given set
void saveTags(std::set<Tag>& writtenTags, bool filterPseudoTags = true) {
for (auto& tag : written_tags) {
if (!filterPseudoTags || !tag.isPseudoTag()) {
writtenTags.insert(tag);
// copy written_tags, after filtering, into given set
void saveTags(std::set<Tag>& filteredTags) const {
for (const auto& tag : written_tags) {
if (!tag.isNonPrimaryTLogType()) {
filteredTags.insert(tag);
}
}
}
@ -1021,7 +1021,7 @@ struct LogPushData : NonCopyable {
}
msg_locations.clear();
logSystem->getPushLocations(prev_tags, msg_locations);
written_tags.insert(written_tags.end(), next_message_tags.begin(), next_message_tags.end());
written_tags.insert(next_message_tags.begin(), next_message_tags.end());
next_message_tags.clear();
}
uint32_t subseq = this->subsequence++;
@ -1100,7 +1100,7 @@ struct LogPushData : NonCopyable {
wr.serializeBytes((uint8_t*)from.getData() + firstOffset, firstLength);
}
}
written_tags.insert(written_tags.end(), next_message_tags.begin(), next_message_tags.end());
written_tags.insert(next_message_tags.begin(), next_message_tags.end());
next_message_tags.clear();
}
@ -1110,7 +1110,7 @@ private:
Reference<ILogSystem> logSystem;
std::vector<Tag> next_message_tags;
std::vector<Tag> prev_tags;
std::vector<Tag> written_tags;
std::set<Tag> written_tags;
std::vector<BinaryWriter> messagesWriter;
std::vector<int> msg_locations;
// Stores message locations that have had span information written to them