summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/shard_filterer_impl.h
diff options
context:
space:
mode:
authorEric Cox <eric.cox@mongodb.com>2020-10-02 18:59:55 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-01 21:03:49 +0000
commit664e5759c78489a88e66e587c34e5f7127c7eebf (patch)
tree898dde369a563772009f4030d730e0ae18510bec /src/mongo/db/exec/shard_filterer_impl.h
parenta71a2a8bfecf7de0807a28e3eabf9412dddd4258 (diff)
downloadmongo-664e5759c78489a88e66e587c34e5f7127c7eebf.tar.gz
SERVER-50712 Handle shard filtering in SBE
Diffstat (limited to 'src/mongo/db/exec/shard_filterer_impl.h')
-rw-r--r--src/mongo/db/exec/shard_filterer_impl.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mongo/db/exec/shard_filterer_impl.h b/src/mongo/db/exec/shard_filterer_impl.h
index c0ae10529d1..c0b4ef3e0ca 100644
--- a/src/mongo/db/exec/shard_filterer_impl.h
+++ b/src/mongo/db/exec/shard_filterer_impl.h
@@ -39,20 +39,24 @@ class ShardFiltererImpl : public ShardFilterer {
public:
ShardFiltererImpl(ScopedCollectionFilter collectionFilter);
- DocumentBelongsResult documentBelongsToMe(const WorkingSetMember& wsm) const override;
- DocumentBelongsResult documentBelongsToMe(const Document& doc) const override;
+ std::unique_ptr<ShardFilterer> clone() const override;
+
+ DocumentBelongsResult documentBelongsToMe(const BSONObj& doc) const override;
+ DocumentBelongsResult documentBelongsToMe(const WorkingSetMember& wsm) const;
+
+ bool keyBelongsToMe(const BSONObj& shardKey) const override {
+ return _collectionFilter.keyBelongsToMe(shardKey);
+ };
bool isCollectionSharded() const override {
return _collectionFilter.isSharded();
}
- const KeyPattern& getKeyPattern() const override {
- invariant(_keyPattern);
- return _keyPattern->getKeyPattern();
- }
+ const KeyPattern& getKeyPattern() const override;
private:
- DocumentBelongsResult _shardKeyBelongsToMe(BSONObj shardKey) const;
+ DocumentBelongsResult keyBelongsToMeHelper(const BSONObj& doc) const;
+
ScopedCollectionFilter _collectionFilter;
boost::optional<ShardKeyPattern> _keyPattern;
};