blob: 3be7a4a18a753db551c0d5d1c597c0258c6a7f1a (
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 Yahoo. 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
|