summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-04-10 09:49:07 +0200
committerHenning Baldersheim <balder@oath.com>2018-04-10 09:49:07 +0200
commit276ae5df423d10714d4a4dba9659438077c09dd1 (patch)
tree526ea721b560c130a91519ba19a6b0d034ed40f7 /storage
parentaf4a0dd794dbbf5ee9bdedf7bdbd00c73b8c4713 (diff)
Do not pregenerate a summary string from message that is 'never' needed.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp15
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h16
2 files changed, 17 insertions, 14 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
index f88570164d5..4b41ab6efff 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp
@@ -371,7 +371,7 @@ FileStorHandlerImpl::Stripe::lock(const document::Bucket &bucket)
guard.wait(100);
}
- auto locker = std::make_shared<BucketLock>(guard, *this, bucket, 255, "External lock");
+ auto locker = std::make_shared<BucketLock>(guard, *this, bucket, 255, api::MessageType::INTERNAL_ID, 0);
guard.broadcast();
return locker;
@@ -984,7 +984,8 @@ FileStorHandlerImpl::Stripe::getMessage(vespalib::MonitorGuard & guard, Priority
idx.erase(iter); // iter not used after this point.
if (!messageTimedOutInQueue(*msg, waitTime)) {
- auto locker = std::make_unique<BucketLock>(guard, *this, bucket, msg->getPriority(), msg->getSummary());;
+ auto locker = std::make_unique<BucketLock>(guard, *this, bucket, msg->getPriority(),
+ msg->getType().getId(), msg->getMsgId());
guard.unlock();
return FileStorHandler::LockedMessage(std::move(locker), std::move(msg));
} else {
@@ -1106,7 +1107,7 @@ FileStorHandlerImpl::getQueueSize(uint16_t disk) const
FileStorHandlerImpl::BucketLock::BucketLock(const vespalib::MonitorGuard & guard, Stripe& stripe,
const document::Bucket &bucket, uint8_t priority,
- const vespalib::stringref & statusString)
+ api::MessageType::Id msgType, api::StorageMessage::Id msgId)
: _stripe(stripe),
_bucket(bucket)
{
@@ -1114,7 +1115,7 @@ FileStorHandlerImpl::BucketLock::BucketLock(const vespalib::MonitorGuard & guard
if (_bucket.getBucketId().getRawId() != 0) {
// Lock the bucket and wait until it is not the current operation for
// the disk itself.
- _stripe.lock(guard, _bucket, Stripe::LockEntry(priority, statusString));
+ _stripe.lock(guard, _bucket, Stripe::LockEntry(priority, msgType, msgId));
LOG(debug, "Locked bucket %s with priority %u",
bucket.getBucketId().toString().c_str(), priority);
@@ -1179,9 +1180,9 @@ FileStorHandlerImpl::Stripe::dumpActiveHtml(std::ostream & os) const
{
uint32_t now = time(nullptr);
vespalib::MonitorGuard guard(_lock);
- for (const auto & entry : _lockedBuckets) {
- os << entry.second.statusString << " (" << entry.first.getBucketId()
- << ") Running for " << (now - entry.second.timestamp) << " secs<br/>\n";
+ for (const auto & e : _lockedBuckets) {
+ os << api::MessageType::get(e.second.msgType).getName() << ":" << e.second.msgId << " (" << e.first.getBucketId()
+ << ") Running for " << (now - e.second.timestamp) << " secs<br/>\n";
}
}
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h
index 4d601ebfe6a..63c957207a6 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h
+++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.h
@@ -77,14 +77,16 @@ public:
class Stripe {
public:
struct LockEntry {
- uint32_t timestamp;
- uint8_t priority;
- vespalib::string statusString;
+ uint32_t timestamp;
+ uint8_t priority;
+ api::MessageType::Id msgType;
+ api::StorageMessage::Id msgId;
- LockEntry() : timestamp(0), priority(0), statusString() { }
- LockEntry(uint8_t priority_, vespalib::stringref status)
- : timestamp(time(nullptr)), priority(priority_), statusString(status)
+ LockEntry() : timestamp(0), priority(0), msgType(), msgId(0) { }
+
+ LockEntry(uint8_t priority_, api::MessageType::Id msgType_, api::StorageMessage::Id msgId_)
+ : timestamp(time(nullptr)), priority(priority_), msgType(msgType_), msgId(msgId_)
{ }
};
Stripe(const FileStorHandlerImpl & owner, MessageSender & messageSender);
@@ -201,7 +203,7 @@ public:
class BucketLock : public FileStorHandler::BucketLockInterface {
public:
BucketLock(const vespalib::MonitorGuard & guard, Stripe& disk, const document::Bucket &bucket,
- uint8_t priority, const vespalib::stringref & statusString);
+ uint8_t priority, api::MessageType::Id msgType, api::StorageMessage::Id);
~BucketLock();
const document::Bucket &getBucket() const override { return _bucket; }