diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-10-25 10:12:05 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-10-25 12:06:17 +0000 |
commit | 2cb690d6cbe868251fa8da15be65edfcfe737527 (patch) | |
tree | 2fc1e7ae8798a77fa9bb189e7e58fa9449f22b16 /storage | |
parent | c7fff4e03569a23a7306c03dd4cd7473291efe05 (diff) |
Use document::Bucket when mapping operations to disk.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp | 34 | ||||
-rw-r--r-- | storage/src/vespa/storage/persistence/filestorage/filestormanager.h | 2 |
2 files changed, 18 insertions, 18 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp b/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp index 909c5c467cd..641ce266781 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp @@ -183,12 +183,12 @@ FileStorManager::replyWithBucketNotFound(api::StorageMessage& msg, StorBucketDatabase::WrappedEntry FileStorManager::mapOperationToDisk(api::StorageMessage& msg, - const document::BucketId& bucket) + const document::Bucket& bucket) { StorBucketDatabase::WrappedEntry entry(_component.getBucketDatabase().get( - bucket, "FileStorManager::mapOperationToDisk")); + bucket.getBucketId(), "FileStorManager::mapOperationToDisk")); if (!entry.exist()) { - replyWithBucketNotFound(msg, bucket); + replyWithBucketNotFound(msg, bucket.getBucketId()); } return entry; } @@ -400,7 +400,7 @@ FileStorManager::onBatchPutRemove(const std::shared_ptr<api::BatchPutRemoveComma bool FileStorManager::onRemoveLocation(const std::shared_ptr<api::RemoveLocationCommand>& cmd) { - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -410,7 +410,7 @@ FileStorManager::onRemoveLocation(const std::shared_ptr<api::RemoveLocationComma bool FileStorManager::onStatBucket(const std::shared_ptr<api::StatBucketCommand>& cmd) { - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -663,7 +663,7 @@ FileStorManager::validateDiffReplyBucket(const StorBucketDatabase::WrappedEntry& bool FileStorManager::onGetBucketDiffReply(const shared_ptr<api::GetBucketDiffReply>& reply) { - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*reply, reply->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*reply, reply->getBucket())); if (validateDiffReplyBucket(entry, reply->getBucket())) { handlePersistenceMessage(reply, entry->disk); } @@ -673,7 +673,7 @@ FileStorManager::onGetBucketDiffReply(const shared_ptr<api::GetBucketDiffReply>& bool FileStorManager::onApplyBucketDiff(const shared_ptr<api::ApplyBucketDiffCommand>& cmd) { - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (validateApplyDiffCommandBucket(*cmd, entry)) { handlePersistenceMessage(cmd, entry->disk); } @@ -684,7 +684,7 @@ bool FileStorManager::onApplyBucketDiffReply(const shared_ptr<api::ApplyBucketDiffReply>& reply) { StorBucketDatabase::WrappedEntry entry(mapOperationToDisk( - *reply, reply->getBucketId())); + *reply, reply->getBucket())); if (validateDiffReplyBucket(entry, reply->getBucket())) { handlePersistenceMessage(reply, entry->disk); } @@ -708,7 +708,7 @@ FileStorManager::onJoinBuckets(const std::shared_ptr<api::JoinBucketsCommand>& c bool FileStorManager::onSplitBucket(const std::shared_ptr<api::SplitBucketCommand>& cmd) { - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -719,7 +719,7 @@ bool FileStorManager::onSetBucketState( const std::shared_ptr<api::SetBucketStateCommand>& cmd) { - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -733,7 +733,7 @@ FileStorManager::onInternal(const shared_ptr<api::InternalCommand>& msg) case GetIterCommand::ID: { shared_ptr<GetIterCommand> cmd(std::static_pointer_cast<GetIterCommand>(msg)); - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -742,7 +742,7 @@ FileStorManager::onInternal(const shared_ptr<api::InternalCommand>& msg) case CreateIteratorCommand::ID: { shared_ptr<CreateIteratorCommand> cmd(std::static_pointer_cast<CreateIteratorCommand>(msg)); - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -765,7 +765,7 @@ FileStorManager::onInternal(const shared_ptr<api::InternalCommand>& msg) case ReadBucketInfo::ID: { shared_ptr<ReadBucketInfo> cmd(std::static_pointer_cast<ReadBucketInfo>(msg)); - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -774,7 +774,7 @@ FileStorManager::onInternal(const shared_ptr<api::InternalCommand>& msg) case InternalBucketJoinCommand::ID: { shared_ptr<InternalBucketJoinCommand> cmd(std::static_pointer_cast<InternalBucketJoinCommand>(msg)); - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -783,7 +783,7 @@ FileStorManager::onInternal(const shared_ptr<api::InternalCommand>& msg) case RepairBucketCommand::ID: { shared_ptr<RepairBucketCommand> cmd(std::static_pointer_cast<RepairBucketCommand>(msg)); - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -792,7 +792,7 @@ FileStorManager::onInternal(const shared_ptr<api::InternalCommand>& msg) case BucketDiskMoveCommand::ID: { shared_ptr<BucketDiskMoveCommand> cmd(std::static_pointer_cast<BucketDiskMoveCommand>(msg)); - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } @@ -801,7 +801,7 @@ FileStorManager::onInternal(const shared_ptr<api::InternalCommand>& msg) case RecheckBucketInfoCommand::ID: { shared_ptr<RecheckBucketInfoCommand> cmd(std::static_pointer_cast<RecheckBucketInfoCommand>(msg)); - StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucketId())); + StorBucketDatabase::WrappedEntry entry(mapOperationToDisk(*cmd, cmd->getBucket())); if (entry.exist()) { handlePersistenceMessage(cmd, entry->disk); } diff --git a/storage/src/vespa/storage/persistence/filestorage/filestormanager.h b/storage/src/vespa/storage/persistence/filestorage/filestormanager.h index 89d657a4f5c..1f4186bf625 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestormanager.h +++ b/storage/src/vespa/storage/persistence/filestorage/filestormanager.h @@ -142,7 +142,7 @@ private: bool validateApplyDiffCommandBucket(api::StorageMessage& msg, const StorBucketDatabase::WrappedEntry&); bool validateDiffReplyBucket(const StorBucketDatabase::WrappedEntry&, const document::Bucket&); - StorBucketDatabase::WrappedEntry mapOperationToDisk(api::StorageMessage&, const document::BucketId&); + StorBucketDatabase::WrappedEntry mapOperationToDisk(api::StorageMessage&, const document::Bucket&); StorBucketDatabase::WrappedEntry mapOperationToBucketAndDisk(api::BucketCommand&, const document::DocumentId*); bool handlePersistenceMessage(const std::shared_ptr<api::StorageMessage>&, uint16_t disk); |