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

#include <vespa/storage/distributor/maintenance/maintenanceoperation.h>
#include <vespa/storage/distributor/maintenance/maintenancepriority.h>

namespace storage::distributor {

class MaintenancePriorityAndType
{
    MaintenancePriority _priority;
    MaintenanceOperation::Type _type;
public:
    constexpr MaintenancePriorityAndType(MaintenancePriority pri,
                                         MaintenanceOperation::Type type) noexcept
        : _priority(pri),
          _type(type)
    {}

    constexpr MaintenancePriority getPriority() const noexcept {
        return _priority;
    }

    constexpr MaintenanceOperation::Type getType() const noexcept {
        return _type;
    }

    constexpr bool requiresMaintenance() const noexcept {
        return (_priority.getPriority()
                != MaintenancePriority::NO_MAINTENANCE_NEEDED);
    }
};

} // storage::distributor