aboutsummaryrefslogtreecommitdiffstats
path: root/persistence/src/vespa/persistence/spi/read_consistency.h
blob: 74713628f708e260f3d634267413c392ac95da95 (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
30
31
32
33
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <iosfwd>
#include <cstdint>

namespace storage::spi {

enum class ReadConsistency : uint8_t {
    /**
     * A read operation with a strong consistency requirement requires that
     * any ACKed write operations must be visible to the operation.
     *
     * Formally, STRONG implies that read operations are linearizable with
     * regards to their corresponding writes.
     */
    STRONG,
    /**
     * A read operation with a weak consistency requirement implies that
     * visibility of recently ACKed operations is allowed to be on a best-
     * effort basis. This means it's possible to read stale data for operations
     * that have not yet been applied to the visible state.
     *
     * Formally, WEAK implies that read operations are NOT linearizable with
     * regards to their corresponding writes.
     */
    WEAK
};

std::ostream& operator<<(std::ostream&, ReadConsistency);

}