diff options
Diffstat (limited to 'src/mongo/db/index/hash_access_method.cpp')
-rw-r--r-- | src/mongo/db/index/hash_access_method.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/mongo/db/index/hash_access_method.cpp b/src/mongo/db/index/hash_access_method.cpp index 47504706590..8262c9019ab 100644 --- a/src/mongo/db/index/hash_access_method.cpp +++ b/src/mongo/db/index/hash_access_method.cpp @@ -33,26 +33,25 @@ namespace mongo { - HashAccessMethod::HashAccessMethod(IndexCatalogEntry* btreeState, SortedDataInterface* btree) - : IndexAccessMethod(btreeState, btree) { - - const IndexDescriptor* descriptor = btreeState->descriptor(); - - // We can change these if the single-field limitation is lifted later. - uassert(16763, "Currently only single field hashed index supported.", - 1 == descriptor->getNumFields()); - - uassert(16764, "Currently hashed indexes cannot guarantee uniqueness. Use a regular index.", - !descriptor->unique()); - - ExpressionParams::parseHashParams(descriptor->infoObj(), - &_seed, - &_hashVersion, - &_hashedField); - } - - void HashAccessMethod::getKeys(const BSONObj& obj, BSONObjSet* keys) const { - ExpressionKeysPrivate::getHashKeys(obj, _hashedField, _seed, _hashVersion, _descriptor->isSparse(), keys); - } +HashAccessMethod::HashAccessMethod(IndexCatalogEntry* btreeState, SortedDataInterface* btree) + : IndexAccessMethod(btreeState, btree) { + const IndexDescriptor* descriptor = btreeState->descriptor(); + + // We can change these if the single-field limitation is lifted later. + uassert(16763, + "Currently only single field hashed index supported.", + 1 == descriptor->getNumFields()); + + uassert(16764, + "Currently hashed indexes cannot guarantee uniqueness. Use a regular index.", + !descriptor->unique()); + + ExpressionParams::parseHashParams(descriptor->infoObj(), &_seed, &_hashVersion, &_hashedField); +} + +void HashAccessMethod::getKeys(const BSONObj& obj, BSONObjSet* keys) const { + ExpressionKeysPrivate::getHashKeys( + obj, _hashedField, _seed, _hashVersion, _descriptor->isSparse(), keys); +} } // namespace mongo |