summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Bosch <geert.bosch@mongodb.com>2019-10-22 19:28:41 +0000
committerevergreen <evergreen@mongodb.com>2019-10-22 19:28:41 +0000
commitf5fbf17f9480a1eec61dee9bd270207ad772189a (patch)
tree1f6e7e1ea4e5ef4ca2d1a0614b8e49dfa65e8a47
parent565a92344456412acffa67879f962247291bee03 (diff)
downloadmongo-f5fbf17f9480a1eec61dee9bd270207ad772189a.tar.gz
SERVER-44100 Use CityHash for validating index consistency
-rw-r--r--src/mongo/db/catalog/index_consistency.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/catalog/index_consistency.cpp b/src/mongo/db/catalog/index_consistency.cpp
index 174c477f5a0..a9999d0b5ba 100644
--- a/src/mongo/db/catalog/index_consistency.cpp
+++ b/src/mongo/db/catalog/index_consistency.cpp
@@ -30,7 +30,6 @@
#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage
#include <algorithm>
-#include <third_party/murmurhash3/MurmurHash3.h>
#include "mongo/platform/basic.h"
@@ -308,9 +307,10 @@ BSONObj IndexConsistency::_generateInfo(const IndexInfo& indexInfo,
uint32_t IndexConsistency::_hashKeyString(const KeyString::Value& ks,
uint32_t indexNameHash) const {
- MurmurHash3_x86_32(
- ks.getTypeBits().getBuffer(), ks.getTypeBits().getSize(), indexNameHash, &indexNameHash);
- MurmurHash3_x86_32(ks.getBuffer(), ks.getSize(), indexNameHash, &indexNameHash);
- return indexNameHash % kNumHashBuckets;
+ using namespace absl::hash_internal;
+ uint64_t hash = indexNameHash;
+ hash = CityHash64WithSeed(ks.getTypeBits().getBuffer(), ks.getTypeBits().getSize(), hash);
+ hash = CityHash64WithSeed(ks.getBuffer(), ks.getSize(), hash);
+ return hash % kNumHashBuckets;
}
} // namespace mongo