-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProxyConfigBuilder.h
56 lines (45 loc) · 1.18 KB
/
ProxyConfigBuilder.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <memory>
#include <string>
#include <folly/Range.h>
#include <folly/dynamic.h>
#include <folly/json.h>
#include "mcrouter/PoolFactory.h"
#include "mcrouter/options.h"
namespace facebook {
namespace memcache {
namespace mcrouter {
template <class RouterInfo>
class ProxyConfig;
template <class RouterInfo>
class Proxy;
class ConfigApi;
class ProxyConfigBuilder {
public:
ProxyConfigBuilder(
const McrouterOptions& opts,
ConfigApi& configApi,
folly::StringPiece jsonC);
template <class RouterInfo>
std::shared_ptr<ProxyConfig<RouterInfo>> buildConfig(
Proxy<RouterInfo>& proxy) const {
return std::shared_ptr<ProxyConfig<RouterInfo>>(new ProxyConfig<RouterInfo>(
proxy, json_, configMd5Digest_, *poolFactory_));
}
const folly::dynamic& preprocessedConfig() const {
return json_;
}
private:
folly::dynamic json_;
std::unique_ptr<PoolFactory> poolFactory_;
std::string configMd5Digest_;
};
}
}
} // facebook::memcache::mcrouter