Unify syntax
@@ -393,6 +393,7 @@ FileStorHandlerImpl::Stripe::lock(const document::Bucket &bucket, api::LockingRe
}
namespace {
+
struct MultiLockGuard {
using monitor_guard = FileStorHandlerImpl::monitor_guard;
@@ -410,10 +411,9 @@ namespace {
}
}
};
-}
-namespace {
- document::DocumentId getDocId(const api::StorageMessage& msg) {
+document::DocumentId
+getDocId(const api::StorageMessage& msg) {
switch (msg.getType().getId()) {
case api::MessageType::GET_ID:
return static_cast<const api::GetCommand&>(msg).getDocumentId();
@@ -431,7 +431,8 @@ namespace {
LOG_ABORT("should not be reached");
}
}
- uint32_t findCommonBits(document::BucketId a, document::BucketId b) {
+uint32_t
+findCommonBits(document::BucketId a, document::BucketId b) {
if (a.getUsedBits() > b.getUsedBits()) {
a.setUsedBits(b.getUsedBits());
} else {
@@ -444,6 +445,7 @@ namespace {
}
return (a == b ? 1 : 0);
}
+
}
int
@@ -993,7 +995,8 @@ FileStorHandlerImpl::Stripe::hasActive(monitor_guard &, const AbortBucketOperati
return false;
}
-void FileStorHandlerImpl::Stripe::abort(std::vector<std::shared_ptr<api::StorageReply>> & aborted,
+void
+FileStorHandlerImpl::Stripe::abort(std::vector<std::shared_ptr<api::StorageReply>> & aborted,
const AbortBucketOperationsCommand& cmd)
{
std::lock_guard lockGuard(*_lock);
@@ -1008,7 +1011,8 @@ void FileStorHandlerImpl::Stripe::abort(std::vector<std::shared_ptr<api::Storage
}
}
-bool FileStorHandlerImpl::Stripe::schedule(MessageEntry messageEntry)
+bool
+FileStorHandlerImpl::Stripe::schedule(MessageEntry messageEntry)
{
{
std::lock_guard guard(*_lock);
@@ -1045,7 +1049,8 @@ FileStorHandlerImpl::Stripe::flush()
namespace {
-bool message_type_is_merge_related(api::MessageType::Id msg_type_id) {
+bool
+message_type_is_merge_related(api::MessageType::Id msg_type_id) {
switch (msg_type_id) {
case api::MessageType::MERGEBUCKET_ID:
case api::MessageType::MERGEBUCKET_REPLY_ID:
@@ -1060,9 +1065,11 @@ bool message_type_is_merge_related(api::MessageType::Id msg_type_id) {
}
-void FileStorHandlerImpl::Stripe::release(const document::Bucket & bucket,
+void
+FileStorHandlerImpl::Stripe::release(const document::Bucket & bucket,
api::LockingRequirements reqOfReleasedLock,
- api::StorageMessage::Id lockMsgId) {
+ api::StorageMessage::Id lockMsgId)
+{
std::unique_lock guard(*_lock);
auto iter = _lockedBuckets.find(bucket);
assert(iter != _lockedBuckets.end());
@@ -1090,7 +1097,8 @@ void FileStorHandlerImpl::Stripe::release(const document::Bucket & bucket,
_cond->notify_all();
}
-void FileStorHandlerImpl::Stripe::lock(const monitor_guard &, const document::Bucket & bucket,
+void
+FileStorHandlerImpl::Stripe::lock(const monitor_guard &, const document::Bucket & bucket,
api::LockingRequirements lockReq, const LockEntry & lockEntry) {
auto& entry = _lockedBuckets[bucket];
assert(!entry._exclusiveLock);
