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

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

namespace storage::distributor {

class DistributorStripeOperationContext;
class OperationSequencer;

class BlockingOperationStarter : public OperationStarter
{
public:
    BlockingOperationStarter(DistributorStripeOperationContext& ctx,
                             OperationSequencer& operation_sequencer,
                             OperationStarter& starterImpl)
        : _operation_context(ctx),
          _operation_sequencer(operation_sequencer),
          _starterImpl(starterImpl)
    {}
    BlockingOperationStarter(const BlockingOperationStarter&) = delete;
    BlockingOperationStarter& operator=(const BlockingOperationStarter&) = delete;

    bool start(const std::shared_ptr<Operation>& operation, Priority priority) override;
private:
    DistributorStripeOperationContext& _operation_context;
    OperationSequencer&                _operation_sequencer;
    OperationStarter&                  _starterImpl;
};

}