From e293065d80c26b2771f7977a5b6bbb5ac9906a0b Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 19 Aug 2022 10:07:06 +0000 Subject: Use xxhash for all BucketId hash sets and maps. --- searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.cpp | 8 +------- searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot.h | 8 ++++++-- .../src/vespa/searchcore/bmcluster/bucket_db_snapshot_vector.h | 3 ++- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'searchcore') 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 -#include #include #include @@ -66,9 +65,4 @@ BucketDbSnapshot::try_get_bucket_info(BucketId bucket_id) const } -namespace vespalib { - -template class hash_map; -template class hash_set; - -} +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; + using BucketInfoMap = vespalib::hash_map; BucketInfoMap _buckets; public: - using BucketIdSet = vespalib::hash_set; + using BucketIdSet = vespalib::hash_set; 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::hash> _snapshots; using BucketIdSet = BucketDbSnapshot::BucketIdSet; public: - BucketDbSnapshotVector(const std::vector& 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; -- cgit v1.2.3