summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-03-08 12:17:48 +0100
committerGitHub <noreply@github.com>2018-03-08 12:17:48 +0100
commit1f6f506795c4f05364327ca6a8d1c370ccbbd1e7 (patch)
tree0ec71b88e42e73c4e6a62a78afeb0336211da839
parent8fb908c726e287a9c9ef44748d38c925991d640c (diff)
parentf8ef471309f9c3c39c46bf4aaeadeab48fbfeab6 (diff)
Merge pull request #5240 from vespa-engine/toregge/report-delayed-bucket-requests
Report delayed bucket requests.
-rw-r--r--storage/src/vespa/storage/distributor/bucketdbupdater.cpp31
-rw-r--r--storage/src/vespa/storage/distributor/bucketdbupdater.h6
2 files changed, 28 insertions, 9 deletions
diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
index 84332851340..39e21772547 100644
--- a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
+++ b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
@@ -540,6 +540,21 @@ const vespalib::string BUCKETDB_UPDATER = "Bucket Database Updater";
}
+void
+BucketDBUpdater::BucketRequest::print_xml_tag(vespalib::xml::XmlOutputStream &xos, const vespalib::xml::XmlAttribute &timestampAttribute) const
+{
+ using namespace vespalib::xml;
+ xos << XmlTag("storagenode")
+ << XmlAttribute("index", targetNode);
+ xos << XmlAttribute("bucketspace", bucket.getBucketSpace().getId(), XmlAttribute::HEX);
+ if (bucket.getBucketId().getRawId() == 0) {
+ xos << XmlAttribute("bucket", ALL);
+ } else {
+ xos << XmlAttribute("bucket", bucket.getBucketId().getId(), XmlAttribute::HEX);
+ }
+ xos << timestampAttribute << XmlEndTag();
+}
+
bool
BucketDBUpdater::reportStatus(std::ostream& out,
const framework::HttpUrlPath& path) const
@@ -581,15 +596,13 @@ BucketDBUpdater::reportXmlStatus(vespalib::xml::XmlOutputStream& xos,
<< XmlTag("single_bucket_requests");
for (const auto & entry : _sentMessages)
{
- xos << XmlTag("storagenode")
- << XmlAttribute("index", entry.second.targetNode);
- if (entry.second.bucket.getBucketId().getRawId() == 0) {
- xos << XmlAttribute("bucket", ALL);
- } else {
- xos << XmlAttribute("bucket", entry.second.bucket.getBucketId().getId(), XmlAttribute::HEX);
- }
- xos << XmlAttribute("sendtimestamp", entry.second.timestamp)
- << XmlEndTag();
+ entry.second.print_xml_tag(xos, XmlAttribute("sendtimestamp", entry.second.timestamp));
+ }
+ xos << XmlEndTag()
+ << XmlTag("delayed_single_bucket_requests");
+ for (const auto & entry : _delayedRequests)
+ {
+ entry.second.print_xml_tag(xos, XmlAttribute("resendtimestamp", entry.first.getTime()));
}
xos << XmlEndTag() << XmlEndTag();
return "";
diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.h b/storage/src/vespa/storage/distributor/bucketdbupdater.h
index a85ee6fe4f7..89c5000b542 100644
--- a/storage/src/vespa/storage/distributor/bucketdbupdater.h
+++ b/storage/src/vespa/storage/distributor/bucketdbupdater.h
@@ -17,6 +17,11 @@
#include <vespa/storageapi/messageapi/messagehandler.h>
#include <list>
+namespace vespalib::xml {
+class XmlOutputStream;
+class XmlAttribute;
+}
+
namespace storage::distributor {
class Distributor;
@@ -89,6 +94,7 @@ private:
timestamp(currentTime),
_mergeReplyGuard(guard) {};
+ void print_xml_tag(vespalib::xml::XmlOutputStream &xos, const vespalib::xml::XmlAttribute &timestampAttribute) const;
uint16_t targetNode;
document::Bucket bucket;
uint64_t timestamp;