-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkvs_proxy.cpp
44 lines (38 loc) · 1.5 KB
/
kvs_proxy.cpp
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
// This file is auto-generated from kvs.idl with jenerator version 0.9.4-42-g70f7539/develop
// *** DO NOT EDIT ***
#include <map>
#include <string>
#include <vector>
#include <utility>
#include <jubatus/core/common/exception.hpp>
#include <jubatus/server/common/logger/logger.hpp>
#include <jubatus/server/framework/aggregators.hpp>
#include <jubatus/server/framework/proxy.hpp>
#include "kvs_types.hpp"
namespace jubatus {
int run_proxy(int argc, char* argv[]) {
try {
jubatus::server::framework::proxy k(
jubatus::server::framework::proxy_argv(argc, argv, "kvs"));
k.register_async_cht<2, bool, std::string>("put",
jubatus::util::lang::function<bool(bool, bool)>(
&jubatus::server::framework::all_and));
k.register_async_cht<2, std::string>("get",
jubatus::util::lang::function<std::string(std::string, std::string)>(
&jubatus::server::framework::pass<std::string>));
k.register_async_cht<2, bool>("del", jubatus::util::lang::function<bool(
bool, bool)>(&jubatus::server::framework::all_and));
k.register_async_broadcast<bool>("clear",
jubatus::util::lang::function<bool(bool, bool)>(
&jubatus::server::framework::all_and));
return k.run();
} catch (const jubatus::core::common::exception::jubatus_exception& e) {
LOG(FATAL) << "exception in proxy main thread: "
<< e.diagnostic_information(true);
return -1;
}
}
} // namespace jubatus
int main(int argc, char* argv[]) {
return jubatus::run_proxy(argc, argv);
}