forked from basho/riak_core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathriak_core_handoff.hrl
52 lines (46 loc) · 1.88 KB
/
riak_core_handoff.hrl
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
-ifdef(namespaced_types).
-type riak_core_handoff_dict() :: dict:dict().
-else.
-type riak_core_handoff_dict() :: dict().
-endif.
-define(PT_MSG_INIT, 0).
-define(PT_MSG_OBJ, 1).
-define(PT_MSG_OLDSYNC, 2).
-define(PT_MSG_SYNC, 3).
-define(PT_MSG_CONFIGURE, 4).
-define(PT_MSG_BATCH, 5).
-record(ho_stats,
{
interval_end :: erlang:timestamp(),
last_update :: erlang:timestamp(),
objs=0 :: non_neg_integer(),
bytes=0 :: non_neg_integer()
}).
-type ho_stats() :: #ho_stats{}.
-type ho_type() :: ownership | hinted | repair | resize.
-type predicate() :: fun((any()) -> boolean()).
-type index() :: chash:index_as_int().
-type mod_src_tgt() :: {module(), index(), index()} | {undefined, undefined, undefined}.
-type mod_partition() :: {module(), index()}.
-record(handoff_status,
{ mod_src_tgt :: mod_src_tgt(),
src_node :: node(),
target_node :: node(),
direction :: inbound | outbound,
transport_pid :: pid(),
transport_mon :: reference(),
timestamp :: tuple(),
status :: any(),
stats :: riak_core_handoff_dict(),
vnode_pid :: pid() | undefined,
vnode_mon :: reference(),
type :: ho_type(),
req_origin :: node(),
filter_mod_fun :: {module(), atom()},
size :: {function(), dynamic} | {non_neg_integer(), bytes | objects}
}).
-type handoff_status() :: #handoff_status{}.
-type known_handoff() :: {{module(), index()},
{ho_type()|'delete',
'inbound'|'outbound'|'local',
node()|'$resize'|'$delete'}}.