diff options
author | Geir Storli <geirst@yahooinc.com> | 2021-10-23 14:10:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-23 14:10:49 +0200 |
commit | 9a62da93ddd9017eea713791d92bef8cdaa9633e (patch) | |
tree | 6d1cddd74a0f116a514ef33cf4b4cb9c151bf9e3 | |
parent | 5d17da853b36dd4d2798195de709438725e6351c (diff) | |
parent | 110ac6e0af3a53892bbf7861ffc16da6712e128e (diff) |
Merge pull request #19708 from vespa-engine/toregge/fix-node-list-printing
Fix node list printing for storage messages used by merging.
-rw-r--r-- | storageapi/src/vespa/storageapi/message/bucket.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/storageapi/src/vespa/storageapi/message/bucket.cpp b/storageapi/src/vespa/storageapi/message/bucket.cpp index 867cfccfaf9..360db5ea3d7 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.cpp +++ b/storageapi/src/vespa/storageapi/message/bucket.cpp @@ -156,7 +156,7 @@ MergeBucketReply::print(std::ostream& out, bool verbose, { out << "MergeBucketReply(" << getBucketId() << ", to time " << _maxTimestamp << ", cluster state version: " - << _clusterStateVersion << ", nodes: "; + << _clusterStateVersion << ", nodes: ["; for (uint32_t i=0; i<_nodes.size(); ++i) { if (i != 0) out << ", "; out << _nodes[i]; @@ -220,15 +220,16 @@ GetBucketDiffCommand::print(std::ostream& out, bool verbose, const std::string& indent) const { out << "GetBucketDiffCommand(" << getBucketId() << ", to time " - << _maxTimestamp << ", nodes: "; + << _maxTimestamp << ", nodes: ["; for (uint32_t i=0; i<_nodes.size(); ++i) { if (i != 0) out << ", "; out << _nodes[i]; } + if (_diff.empty()) { - out << ", no entries"; + out << "], no entries"; } else if (verbose) { - out << ","; + out << "],"; for (uint32_t i=0; i<_diff.size(); ++i) { out << "\n" << indent << " "; _diff[i].print(out, verbose, indent + " "); @@ -258,15 +259,15 @@ GetBucketDiffReply::print(std::ostream& out, bool verbose, const std::string& indent) const { out << "GetBucketDiffReply(" << getBucketId() << ", to time " - << _maxTimestamp << ", nodes: "; + << _maxTimestamp << ", nodes: ["; for (uint32_t i=0; i<_nodes.size(); ++i) { if (i != 0) out << ", "; out << _nodes[i]; } if (_diff.empty()) { - out << ", no entries"; + out << "], no entries"; } else if (verbose) { - out << ","; + out << "],"; for (uint32_t i=0; i<_diff.size(); ++i) { out << "\n" << indent << " "; _diff[i].print(out, verbose, indent + " "); @@ -363,12 +364,12 @@ ApplyBucketDiffCommand::print(std::ostream& out, bool verbose, totalSize += it->_bodyBlob.size(); if (it->filled()) ++filled; } - out << "ApplyBucketDiffCommand(" << getBucketId() << ", nodes: "; + out << "ApplyBucketDiffCommand(" << getBucketId() << ", nodes: ["; for (uint32_t i=0; i<_nodes.size(); ++i) { if (i != 0) out << ", "; out << _nodes[i]; } - out << _diff.size() << " entries of " << totalSize << " bytes, " + out << "], " << _diff.size() << " entries of " << totalSize << " bytes, " << (100.0 * filled / _diff.size()) << " \% filled)"; if (_diff.empty()) { out << ", no entries"; @@ -408,12 +409,12 @@ ApplyBucketDiffReply::print(std::ostream& out, bool verbose, totalSize += entry._bodyBlob.size(); if (entry.filled()) ++filled; } - out << "ApplyBucketDiffReply(" << getBucketId() << ", nodes: "; + out << "ApplyBucketDiffReply(" << getBucketId() << ", nodes: ["; for (uint32_t i=0; i<_nodes.size(); ++i) { if (i != 0) out << ", "; out << _nodes[i]; } - out << _diff.size() << " entries of " << totalSize << " bytes, " + out << "], " << _diff.size() << " entries of " << totalSize << " bytes, " << (100.0 * filled / _diff.size()) << " \% filled)"; if (_diff.empty()) { out << ", no entries"; |