diff options
author | Eric Cox <eric.cox@mongodb.com> | 2020-10-02 18:59:55 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-12-01 21:03:49 +0000 |
commit | 664e5759c78489a88e66e587c34e5f7127c7eebf (patch) | |
tree | 898dde369a563772009f4030d730e0ae18510bec /src/mongo/db/pipeline/document_source_internal_shard_filter_test.cpp | |
parent | a71a2a8bfecf7de0807a28e3eabf9412dddd4258 (diff) | |
download | mongo-664e5759c78489a88e66e587c34e5f7127c7eebf.tar.gz |
SERVER-50712 Handle shard filtering in SBE
Diffstat (limited to 'src/mongo/db/pipeline/document_source_internal_shard_filter_test.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_internal_shard_filter_test.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mongo/db/pipeline/document_source_internal_shard_filter_test.cpp b/src/mongo/db/pipeline/document_source_internal_shard_filter_test.cpp index 8c260690df3..55a01a23a36 100644 --- a/src/mongo/db/pipeline/document_source_internal_shard_filter_test.cpp +++ b/src/mongo/db/pipeline/document_source_internal_shard_filter_test.cpp @@ -50,10 +50,11 @@ using DocumentSourceInternalShardFilterTest = AggregationContextFixture; */ class ShardFiltererBaseForTest : public ShardFilterer { public: - DocumentBelongsResult documentBelongsToMe(const WorkingSetMember& wsm) const override { + std::unique_ptr<ShardFilterer> clone() const { MONGO_UNREACHABLE; } - DocumentBelongsResult documentBelongsToMe(const Document& doc) const override { + + DocumentBelongsResult documentBelongsToMe(const BSONObj& obj) const override { MONGO_UNREACHABLE; } @@ -64,6 +65,10 @@ public: const KeyPattern& getKeyPattern() const override { MONGO_UNREACHABLE; } + + bool keyBelongsToMe(const BSONObj& obj) const override { + MONGO_UNREACHABLE; + } }; /** @@ -115,10 +120,7 @@ class FirstNShardFilterer : public ShardFiltererBaseForTest { public: FirstNShardFilterer(unsigned int n) : _numToFilter(n) {} - DocumentBelongsResult documentBelongsToMe(const WorkingSetMember& wsm) const override { - MONGO_UNREACHABLE; - } - DocumentBelongsResult documentBelongsToMe(const Document& doc) const override { + DocumentBelongsResult documentBelongsToMe(const BSONObj& obj) const override { return i++ >= _numToFilter ? DocumentBelongsResult::kBelongs : DocumentBelongsResult::kDoesNotBelong; } @@ -158,10 +160,7 @@ class ShardFiltererNoShardKey : public ShardFiltererBaseForTest { public: ShardFiltererNoShardKey() : _kp(BSON("b" << 1)) {} - DocumentBelongsResult documentBelongsToMe(const WorkingSetMember& wsm) const override { - MONGO_UNREACHABLE; - } - DocumentBelongsResult documentBelongsToMe(const Document& doc) const override { + DocumentBelongsResult documentBelongsToMe(const BSONObj& obj) const override { return DocumentBelongsResult::kNoShardKey; } |