diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-03-22 16:07:55 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-03-23 11:38:59 -0400 |
commit | 9316aca8fb95265cd6e3b2343b2cfab2ad90e7c8 (patch) | |
tree | 362206347f23d4782b2fab165eb6a13c7d3b4556 /src/mongo/db/index/btree_key_generator.h | |
parent | 54cb8dac783c78709342da942f1a94d4a900dcff (diff) | |
download | mongo-9316aca8fb95265cd6e3b2343b2cfab2ad90e7c8.tar.gz |
SERVER-23092 Update BtreeKeyGeneratorV1 to be collation-aware
Diffstat (limited to 'src/mongo/db/index/btree_key_generator.h')
-rw-r--r-- | src/mongo/db/index/btree_key_generator.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/index/btree_key_generator.h b/src/mongo/db/index/btree_key_generator.h index 85ada2c2c1a..7ddbe8a0732 100644 --- a/src/mongo/db/index/btree_key_generator.h +++ b/src/mongo/db/index/btree_key_generator.h @@ -36,6 +36,8 @@ namespace mongo { +class CollatorInterface; + /** * Internal class used by BtreeAccessMethod to generate keys for indexed documents. * This class is meant to be kept under the index access layer. @@ -61,7 +63,6 @@ protected: BSONSizeTracker _sizeTracker; private: - // We have V0 and V1. Sigh. virtual void getKeysImpl(std::vector<const char*> fieldNames, std::vector<BSONElement> fixed, const BSONObj& obj, @@ -98,7 +99,8 @@ class BtreeKeyGeneratorV1 : public BtreeKeyGenerator { public: BtreeKeyGeneratorV1(std::vector<const char*> fieldNames, std::vector<BSONElement> fixed, - bool isSparse); + bool isSparse, + CollatorInterface* collator); virtual ~BtreeKeyGeneratorV1() {} @@ -245,6 +247,10 @@ private: // A vector with size equal to the number of elements in the index key pattern. Each element in // the vector is the number of path components in the indexed field. std::vector<size_t> _pathLengths; + + // Null if this key generator orders strings according to the simple binary compare. If + // non-null, represents the collator used to generate index keys for indexed strings. + CollatorInterface* _collator; }; } // namespace mongo |