diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2019-08-26 21:04:09 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-08-26 21:04:09 +0000 |
commit | def30acb316289d5cb95ecdf2654c3ca919c6a46 (patch) | |
tree | 3110ea8550bcdd45cea88cb479912e94c48d45b5 /src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp | |
parent | fdc2af124b38652be53ff46ad658e86f7dd1f47a (diff) | |
download | mongo-def30acb316289d5cb95ecdf2654c3ca919c6a46.tar.gz |
SERVER-42354 Remove SortedDataInterface::seek() which accepts a SeekPoint
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp index a0bc61aebcd..a6e0c62d253 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp @@ -44,6 +44,7 @@ #include "mongo/db/json.h" #include "mongo/db/repl/repl_settings.h" #include "mongo/db/service_context.h" +#include "mongo/db/storage/index_entry_comparison.h" #include "mongo/db/storage/storage_options.h" #include "mongo/db/storage/wiredtiger/wiredtiger_customization_hooks.h" #include "mongo/db/storage/wiredtiger/wiredtiger_global_options.h" @@ -830,25 +831,18 @@ public: ? KeyString::Discriminator::kExclusiveBefore : KeyString::Discriminator::kExclusiveAfter; _query.resetToKey(finalKey, _idx.getOrdering(), discriminator); - seek(_query.getValueCopy(), inclusive /* unused by implementation */); + seekForKeyString(_query.getValueCopy()); return curr(parts); } - boost::optional<IndexKeyEntry> seek(const IndexSeekPoint& seekPoint, - RequestedInfo parts) override { - dassert(_opCtx->lockState()->isReadLocked()); - // TODO: don't go to a bson obj then to a KeyString, go straight - BSONObj key = IndexEntryComparison::makeQueryObject(seekPoint, _forward); - - // makeQueryObject handles the discriminator in the real exclusive cases. - const auto discriminator = _forward ? KeyString::Discriminator::kExclusiveBefore - : KeyString::Discriminator::kExclusiveAfter; - _query.resetToKey(key, _idx.getOrdering(), discriminator); - seek(_query.getValueCopy(), true /* unused by implementation */); + boost::optional<IndexKeyEntry> seek(const KeyString::Value& keyString, + RequestedInfo parts = kKeyAndLoc) override { + seekForKeyString(keyString); return curr(parts); } - boost::optional<KeyStringEntry> seek(const KeyString::Value& keyStringValue, bool) override { + boost::optional<KeyStringEntry> seekForKeyString( + const KeyString::Value& keyStringValue) override { dassert(_opCtx->lockState()->isReadLocked()); seekWTCursor(keyStringValue); @@ -899,7 +893,7 @@ public: } boost::optional<KeyStringEntry> seekExact(const KeyString::Value& keyStringValue) override { - auto ksEntry = seek(keyStringValue, true); + auto ksEntry = seekForKeyString(keyStringValue); if (!ksEntry) { return {}; } |