blob: a5a7e70db72b33c36e5e5c8c5860ad5864a9b738 (
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 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
* A cache for an ideal nodes implementation. Making it cheap for localized
* access, regardless of real implementation.
*/
#pragma once
#include "idealnodecalculator.h"
namespace storage {
namespace lib {
class IdealNodeCalculatorImpl : public IdealNodeCalculatorConfigurable {
std::vector<const char*> _upStates;
const Distribution* _distribution;
const ClusterState* _clusterState;
public:
IdealNodeCalculatorImpl();
~IdealNodeCalculatorImpl();
void setDistribution(const Distribution& d) override;
void setClusterState(const ClusterState& cs) override;
IdealNodeList getIdealNodes(const NodeType& nodeType,
const document::BucketId& bucket,
UpStates upStates) const override;
private:
void initUpStateMapping();
};
} // lib
} // storage
|