-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.h
More file actions
35 lines (28 loc) · 661 Bytes
/
node.h
File metadata and controls
35 lines (28 loc) · 661 Bytes
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
/*
* node.h
*
* Created on: 2017Äê6ÔÂ2ÈÕ
* Author: zjbpoping
*/
#ifndef NODE_H_
#define NODE_H_
#include <string>
namespace ps{
struct Node{
static const int EmptyID = 0;
Node() : id(EmptyID), port(EmptyID), is_recovery(false) {}
/** \brief node roles */
enum Role { SCHEDULER, SERVER, WORKER };
/** \brief the role of this node */
Role role;
/** \brief node id */
int id;
/** \brief hostname or ip */
std::string hostname;
/** \brief the port this node is binding */
int port;
/** \brief whether this node is created by failover */
bool is_recovery;
};
}
#endif /* NODE_H_ */