aboutsummaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/http/host_manager.h
blob: fdbb740566af48b46b92b9a97639fc59d9aadf95 (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
35
36
37
#pragma once

#include "fwd.h"

#include <util/generic/string.h>
#include <util/generic/hash.h>
#include <util/system/spinlock.h>


namespace NYT::NPrivate {

////////////////////////////////////////////////////////////////////////////////

class THostManager
{
public:
    static THostManager& Get();

    TString GetProxyForHeavyRequest(const TClientContext& context);

    // For testing purposes only.
    void Reset();

private:
    class TClusterHostList;

private:
    TAdaptiveLock Lock_;
    THashMap<TString, TClusterHostList> ClusterHosts_;

private:
    static TClusterHostList GetHosts(const TClientContext& context);
};

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT::NPrivate