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

#include "operation.h"
#include <vespa/storage/distributor/operation_sequencer.h>

namespace storage::distributor {

/**
 * A sequenced operation is an operation whose concurrency against a specific document ID
 * may be limited by the distributor to avoid race conditions caused by concurrent
 * modifications.
 */
class SequencedOperation : public Operation {
    SequencingHandle _sequencingHandle;
public:
    SequencedOperation() : Operation(), _sequencingHandle() {}

    explicit SequencedOperation(SequencingHandle sequencingHandle)
        : Operation(),
          _sequencingHandle(std::move(sequencingHandle)) {
    }
};

} // storage::distributor