-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkvs_client.hpp
48 lines (38 loc) · 1.16 KB
/
kvs_client.hpp
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
// This file is auto-generated from kvs.idl with jenerator version 0.9.4-42-g70f7539/develop
// *** DO NOT EDIT ***
#ifndef KVS_CLIENT_HPP_
#define KVS_CLIENT_HPP_
#include <map>
#include <string>
#include <vector>
#include <jubatus/client/common/client.hpp>
#include <jubatus/client/common/datum.hpp>
#include "kvs_types.hpp"
namespace jubatus {
namespace client {
class kvs : public jubatus::client::common::client {
public:
kvs(const std::string& host, uint64_t port, const std::string& name,
unsigned int timeout_sec)
: client(host, port, name, timeout_sec) {
}
bool put(const std::string& key, const std::string& value) {
msgpack::rpc::future f = c_.call("put", name_, key, value);
return f.get<bool>();
}
std::string get(const std::string& key) {
msgpack::rpc::future f = c_.call("get", name_, key);
return f.get<std::string>();
}
bool del(const std::string& key) {
msgpack::rpc::future f = c_.call("del", name_, key);
return f.get<bool>();
}
bool clear() {
msgpack::rpc::future f = c_.call("clear", name_);
return f.get<bool>();
}
};
} // namespace client
} // namespace jubatus
#endif // KVS_CLIENT_HPP_