1 | /* |
2 | * roster.h |
3 | * |
4 | * Copyright (C) 2017 Aerospike, Inc. |
5 | * |
6 | * Portions may be licensed to Aerospike, Inc. under one or more contributor |
7 | * license agreements. |
8 | * |
9 | * This program is free software: you can redistribute it and/or modify it under |
10 | * the terms of the GNU Affero General Public License as published by the Free |
11 | * Software Foundation, either version 3 of the License, or (at your option) any |
12 | * later version. |
13 | * |
14 | * This program is distributed in the hope that it will be useful, but WITHOUT |
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
16 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
17 | * details. |
18 | * |
19 | * You should have received a copy of the GNU Affero General Public License |
20 | * along with this program. If not, see http://www.gnu.org/licenses/ |
21 | */ |
22 | |
23 | #pragma once |
24 | |
25 | //========================================================== |
26 | // Includes. |
27 | // |
28 | |
29 | #include <stdbool.h> |
30 | |
31 | #include "node.h" |
32 | |
33 | #include "fabric/partition_balance.h" |
34 | |
35 | |
36 | //========================================================== |
37 | // Public API. |
38 | // |
39 | |
40 | void as_roster_init_smd(); |
41 | bool as_roster_set_nodes_cmd(const char* ns_name, const char* nodes); |
42 | |
43 | |
44 | //========================================================== |
45 | // Inlines and macros. |
46 | // |
47 | |
48 | // Format is: <node-id-hex-str>:<rack-id-decimal-str>, |
49 | #define ROSTER_STRING_ELE_LEN ((sizeof(cf_node) * 2) + 1 + MAX_RACK_ID_LEN + 1) |
50 | |
51 | // In string lists, separate node-id and rack-id with this character. |
52 | #define ROSTER_ID_PAIR_SEPARATOR '@' |
53 | |