aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/bmcluster/storage_reply_error_checker.h
blob: 64d94696feb84478b8708655c6448fe654198125 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <atomic>

namespace storage::api { class StorageMessage; }

namespace search::bmcluster {

/*
 * Class tracking errors in storage replies.
 */
class StorageReplyErrorChecker {
protected:
    std::atomic<uint32_t> _errors;
public:
    StorageReplyErrorChecker();
    ~StorageReplyErrorChecker();
    void check_error(const storage::api::StorageMessage &msg);
    uint32_t get_error_count() const { return _errors; }
};

}