aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/potential_data_loss_report.h
blob: c232ce2f5ff901cef7b2e68532178d134974fbd9 (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
28
29
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <cstdint>

namespace storage::distributor {

/**
 * Represents the amount of data a distributor reasons _may_ have become unavailable
 * due to all bucket replicas no longer being present.
 */
struct PotentialDataLossReport {
    size_t buckets   = 0;
    size_t documents = 0;

    constexpr PotentialDataLossReport() noexcept = default;

    constexpr PotentialDataLossReport(size_t buckets_, size_t documents_) noexcept
        : buckets(buckets_),
          documents(documents_)
    {}

    void merge(const PotentialDataLossReport& other) noexcept {
        buckets += other.buckets;
        documents += other.documents;
    }
};

}