aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/bmcluster/bucket_db_snapshot_vector.h
blob: 9e24fbe28cf30b774c1347ffe0efccb976199218 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "bucket_db_snapshot.h"

namespace storage::lib { class ClusterStateBundle; }

namespace search::bmcluster {

/*
 * Class representing snapshots of bucket db below SPI for multiple nodes and bucket spaces.
 */
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;
};

}