diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-08-19 10:07:06 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-08-19 10:07:06 +0000 |
commit | e293065d80c26b2771f7977a5b6bbb5ac9906a0b (patch) | |
tree | 737af04d7b4286cdf468814939af817007df968d /searchcore | |
parent | a520fda96ce01c92f28ea4c6b700a39396544d2e (diff) |
Use xxhash for all BucketId hash sets and maps.
Diffstat (limited to 'searchcore')
3 files changed, 9 insertions, 10 deletions
diff --git a/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.cpp b/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.cpp index 3ddb1afdb35..f91eb135066 100644 --- a/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.cpp +++ b/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.cpp @@ -2,7 +2,6 @@ #include "bucket_db_snapshot.h" #include <vespa/persistence/spi/persistenceprovider.h> -#include <vespa/vespalib/stllike/hash_set.hpp> #include <vespa/vespalib/stllike/hash_map.hpp> #include <cassert> @@ -66,9 +65,4 @@ BucketDbSnapshot::try_get_bucket_info(BucketId bucket_id) const } -namespace vespalib { - -template class hash_map<BucketId, BucketInfo, BucketId::hash>; -template class hash_set<BucketId, BucketId::hash>; - -} +VESPALIB_HASH_MAP_INSTANTIATE_H(document::BucketId, storage::spi::BucketInfo, document::BucketId::xxhash);
\ No newline at end of file diff --git a/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.h b/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.h index d750a73f207..5881267f2e0 100644 --- a/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.h +++ b/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.h @@ -17,11 +17,15 @@ namespace search::bmcluster { */ class BucketDbSnapshot { - using BucketInfoMap = vespalib::hash_map<document::BucketId, storage::spi::BucketInfo, document::BucketId::hash>; + using BucketInfoMap = vespalib::hash_map<document::BucketId, storage::spi::BucketInfo, document::BucketId::xxhash>; BucketInfoMap _buckets; public: - using BucketIdSet = vespalib::hash_set<document::BucketId, document::BucketId::hash>; + using BucketIdSet = vespalib::hash_set<document::BucketId, document::BucketId::xxhash>; BucketDbSnapshot(); + BucketDbSnapshot(const BucketDbSnapshot &) = delete; + BucketDbSnapshot & operator=(const BucketDbSnapshot &) = delete; + BucketDbSnapshot(BucketDbSnapshot &&) noexcept = default; + BucketDbSnapshot & operator=(BucketDbSnapshot &&) noexcept = default; ~BucketDbSnapshot(); void populate(document::BucketSpace bucket_space, storage::spi::PersistenceProvider& provider); uint32_t count_new_documents(const BucketDbSnapshot &old) const; diff --git a/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot_vector.h b/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot_vector.h index 7799ed8fc58..df6183fd6f9 100644 --- a/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot_vector.h +++ b/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot_vector.h @@ -16,8 +16,9 @@ class BucketDbSnapshotVector vespalib::hash_map<document::BucketSpace, std::vector<BucketDbSnapshot>, document::BucketSpace::hash> _snapshots; using BucketIdSet = BucketDbSnapshot::BucketIdSet; public: - BucketDbSnapshotVector(const std::vector<storage::spi::PersistenceProvider *>& providers, const storage::lib::ClusterStateBundle &cluster_state_bundle); + BucketDbSnapshotVector(const BucketDbSnapshotVector &) = delete; + BucketDbSnapshotVector & operator = (const BucketDbSnapshotVector &) = delete; ~BucketDbSnapshotVector(); uint32_t count_moved_documents(const BucketDbSnapshotVector &old) const; uint32_t count_lost_unique_documents(const BucketDbSnapshotVector &old) const; |