-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscovery.h
36 lines (27 loc) · 917 Bytes
/
discovery.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
#ifndef DISCOVERY_H_
#define DISCOVERY_H_
#include <string>
#include <libmemcached/memcached.h>
#include <vector>
#include <cstdint>
namespace slope {
namespace discovery {
class DiscoverySerivce {
public:
virtual void register_node(const std::string& my_id, const std::string& info) = 0;
virtual std::string wait_for(const std::string& other_id) = 0;
virtual std::vector<std::pair<std::string, std::string>> wait_for_peers() = 0;
virtual ~DiscoverySerivce() = default;
};
} // namespace discovery
} // namespace slope
struct QpInfo {
uint16_t lid;
uint32_t qp_num;
};
struct QpInfo make_qp_info(uint16_t lid, uint32_t qp_num);
struct QpInfo exchange_qp_info(memcached_st *memc, const char *adv_key,
const char *target_key, struct QpInfo local);
struct QpInfo exchange_qp_info(struct QpInfo local);
static const int QpInfoAdvTimeout = 1;
#endif // DISCOVERY_H_