diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-04-24 17:44:20 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-04-26 09:44:01 -0400 |
commit | 381a35be63129419516c77825c2a27e7fc447e63 (patch) | |
tree | 90285bbc743edac9f5354bd308cc65498cde8d15 /src/mongo/db/exec/text.cpp | |
parent | bced3d215a395fa2872b9931d971fef7138d3e94 (diff) | |
download | mongo-381a35be63129419516c77825c2a27e7fc447e63.tar.gz |
SERVER-13632 Get rid of DiskLoc::obj (Part 1)
DiskLoc::obj references the durability subsystem through thread local
variables. With this change the accesses become explicit through the
collection.
Diffstat (limited to 'src/mongo/db/exec/text.cpp')
-rw-r--r-- | src/mongo/db/exec/text.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mongo/db/exec/text.cpp b/src/mongo/db/exec/text.cpp index 7c075587909..4bf3c7ca4bb 100644 --- a/src/mongo/db/exec/text.cpp +++ b/src/mongo/db/exec/text.cpp @@ -246,7 +246,7 @@ namespace mongo { // Filter for phrases and negated terms if (_params.query.hasNonTermPieces()) { - if (!_ftsMatcher.matchesNonTerm(loc.obj())) { + if (!_ftsMatcher.matchesNonTerm(_params.index->getCollection()->docFor(loc))) { return PlanStage::NEED_TIME; } } @@ -254,7 +254,7 @@ namespace mongo { *out = _ws->allocate(); WorkingSetMember* member = _ws->get(*out); member->loc = loc; - member->obj = member->loc.obj(); + member->obj = _params.index->getCollection()->docFor(member->loc); member->state = WorkingSetMember::LOC_AND_UNOWNED_OBJ; member->addComputed(new TextScoreComputedData(score)); return PlanStage::ADVANCED; @@ -265,15 +265,17 @@ namespace mongo { TextMatchableDocument(const BSONObj& keyPattern, const BSONObj& key, DiskLoc loc, + const Collection* collection, bool *fetched) - : _keyPattern(keyPattern), + : _collection(collection), + _keyPattern(keyPattern), _key(key), _loc(loc), _fetched(fetched) { } BSONObj toBSON() const { *_fetched = true; - return _loc.obj(); + return _collection->docFor(_loc); } virtual ElementIterator* allocateIterator(const ElementPath* path) const { @@ -298,7 +300,7 @@ namespace mongo { // All else fails, fetch. *_fetched = true; - return new BSONElementIterator(path, _loc.obj()); + return new BSONElementIterator(path, _collection->docFor(_loc)); } virtual void releaseIterator( ElementIterator* iterator ) const { @@ -306,6 +308,7 @@ namespace mongo { } private: + const Collection* _collection; BSONObj _keyPattern; BSONObj _key; DiskLoc _loc; @@ -338,7 +341,11 @@ namespace mongo { if (_filter) { // We have not seen this document before and need to apply a filter. bool fetched = false; - TextMatchableDocument tdoc(_params.index->keyPattern(), key, loc, &fetched); + TextMatchableDocument tdoc(_params.index->keyPattern(), + key, + loc, + _params.index->getCollection(), + &fetched); if (!_filter->matches(&tdoc)) { // We had to fetch but we're not going to return it. |