Skip to content
This repository was archived by the owner on May 27, 2022. It is now read-only.

Commit 8361d03

Browse files
authored
Merge pull request #3 from AntidoteDB/dc_management
Dc management
2 parents a20119a + 32a16ab commit 8361d03

File tree

6 files changed

+2248
-812
lines changed

6 files changed

+2248
-812
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: erlang
2+
otp_release:
3+
- 19.3
4+
- 20.3
5+
- 21.0
6+
script:
7+
- make test
8+
- make dialyzer
9+
sudo: required
10+
dist: trusty

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ compile:
1010
$(REBAR) compile
1111

1212
clean:
13-
rm -rf ebin/* test/*.beam logs log
13+
rm -rf ebin/* test/*.beam logs log _build/gpb
1414
$(REBAR) clean
1515

1616
test:
@@ -25,7 +25,7 @@ shell:
2525

2626
_build/gpb:
2727
mkdir -p _build/
28-
(cd _build/ && git clone https://github.com/tomas-abrahamsson/gpb && cd gpb && git checkout 4.1.8)
28+
(cd _build/ && git clone https://github.com/tomas-abrahamsson/gpb && cd gpb && git checkout 4.4.0)
2929

3030
_build/gpb/bin/protoc-erl: _build/gpb
3131
(cd _build/gpb && make)

include/antidote_pb.hrl

Lines changed: 98 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,121 @@
11
%% -*- coding: utf-8 -*-
22
%% Automatically generated, do not edit
3-
%% Generated by gpb_compile version 4.1.8
3+
%% Generated by gpb_compile version 4.4.0
44

55
-ifndef(antidote_pb).
66
-define(antidote_pb, true).
77

8-
-define(antidote_pb_gpb_version, "4.1.8").
8+
-define(antidote_pb_gpb_version, "4.4.0").
99

1010
-ifndef('APBERRORRESP_PB_H').
1111
-define('APBERRORRESP_PB_H', true).
1212
-record('ApbErrorResp',
13-
{errmsg, % = 1, bytes
14-
errcode % = 2, uint32
13+
{errmsg :: iodata(), % = 1
14+
errcode :: non_neg_integer() % = 2, 32 bits
1515
}).
1616
-endif.
1717

1818
-ifndef('APBCOUNTERUPDATE_PB_H').
1919
-define('APBCOUNTERUPDATE_PB_H', true).
2020
-record('ApbCounterUpdate',
21-
{inc % = 1, sint64 (optional)
21+
{inc :: integer() | undefined % = 1, 32 bits
2222
}).
2323
-endif.
2424

2525
-ifndef('APBGETCOUNTERRESP_PB_H').
2626
-define('APBGETCOUNTERRESP_PB_H', true).
2727
-record('ApbGetCounterResp',
28-
{value % = 1, sint32
28+
{value :: integer() % = 1, 32 bits
2929
}).
3030
-endif.
3131

3232
-ifndef('APBSETUPDATE_PB_H').
3333
-define('APBSETUPDATE_PB_H', true).
3434
-record('ApbSetUpdate',
35-
{optype, % = 1, {enum,'ApbSetUpdate.SetOpType'}
36-
adds = [], % = 2, [bytes]
37-
rems = [] % = 3, [bytes]
35+
{optype :: 'ADD' | 'REMOVE' | integer(), % = 1, enum ApbSetUpdate.SetOpType
36+
adds = [] :: [iodata()] | undefined, % = 2
37+
rems = [] :: [iodata()] | undefined % = 3
3838
}).
3939
-endif.
4040

4141
-ifndef('APBGETSETRESP_PB_H').
4242
-define('APBGETSETRESP_PB_H', true).
4343
-record('ApbGetSetResp',
44-
{value = [] % = 1, [bytes]
44+
{value = [] :: [iodata()] | undefined % = 1
4545
}).
4646
-endif.
4747

4848
-ifndef('APBREGUPDATE_PB_H').
4949
-define('APBREGUPDATE_PB_H', true).
5050
-record('ApbRegUpdate',
51-
{value % = 1, bytes
51+
{value :: iodata() % = 1
5252
}).
5353
-endif.
5454

5555
-ifndef('APBGETREGRESP_PB_H').
5656
-define('APBGETREGRESP_PB_H', true).
5757
-record('ApbGetRegResp',
58-
{value % = 1, bytes
58+
{value :: iodata() % = 1
5959
}).
6060
-endif.
6161

6262
-ifndef('APBGETMVREGRESP_PB_H').
6363
-define('APBGETMVREGRESP_PB_H', true).
6464
-record('ApbGetMVRegResp',
65-
{values = [] % = 1, [bytes]
65+
{values = [] :: [iodata()] | undefined % = 1
6666
}).
6767
-endif.
6868

6969
-ifndef('APBMAPKEY_PB_H').
7070
-define('APBMAPKEY_PB_H', true).
7171
-record('ApbMapKey',
72-
{key, % = 1, bytes
73-
type % = 2, {enum,'CRDT_type'}
72+
{key :: iodata(), % = 1
73+
type :: 'COUNTER' | 'ORSET' | 'LWWREG' | 'MVREG' | 'GMAP' | 'RWSET' | 'RRMAP' | 'FATCOUNTER' | 'FLAG_EW' | 'FLAG_DW' | integer() % = 2, enum CRDT_type
7474
}).
7575
-endif.
7676

7777
-ifndef('APBMAPUPDATE_PB_H').
7878
-define('APBMAPUPDATE_PB_H', true).
7979
-record('ApbMapUpdate',
80-
{updates = [], % = 1, [{msg,'ApbMapNestedUpdate'}]
81-
removedKeys = [] % = 2, [{msg,'ApbMapKey'}]
80+
{updates = [] :: [antidote_pb:'ApbMapNestedUpdate'()] | undefined, % = 1
81+
removedKeys = [] :: [antidote_pb:'ApbMapKey'()] | undefined % = 2
8282
}).
8383
-endif.
8484

8585
-ifndef('APBMAPNESTEDUPDATE_PB_H').
8686
-define('APBMAPNESTEDUPDATE_PB_H', true).
8787
-record('ApbMapNestedUpdate',
88-
{key, % = 1, {msg,'ApbMapKey'}
89-
update % = 2, {msg,'ApbUpdateOperation'}
88+
{key :: antidote_pb:'ApbMapKey'(), % = 1
89+
update :: antidote_pb:'ApbUpdateOperation'() % = 2
9090
}).
9191
-endif.
9292

9393
-ifndef('APBGETMAPRESP_PB_H').
9494
-define('APBGETMAPRESP_PB_H', true).
9595
-record('ApbGetMapResp',
96-
{entries = [] % = 1, [{msg,'ApbMapEntry'}]
96+
{entries = [] :: [antidote_pb:'ApbMapEntry'()] | undefined % = 1
9797
}).
9898
-endif.
9999

100100
-ifndef('APBMAPENTRY_PB_H').
101101
-define('APBMAPENTRY_PB_H', true).
102102
-record('ApbMapEntry',
103-
{key, % = 1, {msg,'ApbMapKey'}
104-
value % = 2, {msg,'ApbReadObjectResp'}
103+
{key :: antidote_pb:'ApbMapKey'(), % = 1
104+
value :: antidote_pb:'ApbReadObjectResp'() % = 2
105105
}).
106106
-endif.
107107

108108
-ifndef('APBFLAGUPDATE_PB_H').
109109
-define('APBFLAGUPDATE_PB_H', true).
110110
-record('ApbFlagUpdate',
111-
{value % = 1, bool
111+
{value :: boolean() | 0 | 1 % = 1
112112
}).
113113
-endif.
114114

115115
-ifndef('APBGETFLAGRESP_PB_H').
116116
-define('APBGETFLAGRESP_PB_H', true).
117117
-record('ApbGetFlagResp',
118-
{value % = 1, bool
118+
{value :: boolean() | 0 | 1 % = 1
119119
}).
120120
-endif.
121121

@@ -129,146 +129,176 @@
129129
-ifndef('APBOPERATIONRESP_PB_H').
130130
-define('APBOPERATIONRESP_PB_H', true).
131131
-record('ApbOperationResp',
132-
{success, % = 1, bool
133-
errorcode % = 2, uint32 (optional)
132+
{success :: boolean() | 0 | 1, % = 1
133+
errorcode :: non_neg_integer() | undefined % = 2, 32 bits
134134
}).
135135
-endif.
136136

137137
-ifndef('APBTXNPROPERTIES_PB_H').
138138
-define('APBTXNPROPERTIES_PB_H', true).
139139
-record('ApbTxnProperties',
140-
{read_write, % = 1, uint32 (optional)
141-
red_blue % = 2, uint32 (optional)
140+
{read_write :: non_neg_integer() | undefined, % = 1, 32 bits
141+
red_blue :: non_neg_integer() | undefined % = 2, 32 bits
142142
}).
143143
-endif.
144144

145145
-ifndef('APBBOUNDOBJECT_PB_H').
146146
-define('APBBOUNDOBJECT_PB_H', true).
147147
-record('ApbBoundObject',
148-
{key, % = 1, bytes
149-
type, % = 2, {enum,'CRDT_type'}
150-
bucket % = 3, bytes
148+
{key :: iodata(), % = 1
149+
type :: 'COUNTER' | 'ORSET' | 'LWWREG' | 'MVREG' | 'GMAP' | 'RWSET' | 'RRMAP' | 'FATCOUNTER' | 'FLAG_EW' | 'FLAG_DW' | integer(), % = 2, enum CRDT_type
150+
bucket :: iodata() % = 3
151151
}).
152152
-endif.
153153

154154
-ifndef('APBREADOBJECTS_PB_H').
155155
-define('APBREADOBJECTS_PB_H', true).
156156
-record('ApbReadObjects',
157-
{boundobjects = [], % = 1, [{msg,'ApbBoundObject'}]
158-
transaction_descriptor % = 2, bytes
157+
{boundobjects = [] :: [antidote_pb:'ApbBoundObject'()] | undefined, % = 1
158+
transaction_descriptor :: iodata() % = 2
159159
}).
160160
-endif.
161161

162162
-ifndef('APBUPDATEOP_PB_H').
163163
-define('APBUPDATEOP_PB_H', true).
164164
-record('ApbUpdateOp',
165-
{boundobject, % = 1, {msg,'ApbBoundObject'}
166-
operation % = 2, {msg,'ApbUpdateOperation'}
165+
{boundobject :: antidote_pb:'ApbBoundObject'(), % = 1
166+
operation :: antidote_pb:'ApbUpdateOperation'() % = 2
167167
}).
168168
-endif.
169169

170170
-ifndef('APBUPDATEOPERATION_PB_H').
171171
-define('APBUPDATEOPERATION_PB_H', true).
172172
-record('ApbUpdateOperation',
173-
{counterop, % = 1, {msg,'ApbCounterUpdate'} (optional)
174-
setop, % = 2, {msg,'ApbSetUpdate'} (optional)
175-
regop, % = 3, {msg,'ApbRegUpdate'} (optional)
176-
mapop, % = 5, {msg,'ApbMapUpdate'} (optional)
177-
resetop, % = 6, {msg,'ApbCrdtReset'} (optional)
178-
flagop % = 7, {msg,'ApbFlagUpdate'} (optional)
173+
{counterop :: antidote_pb:'ApbCounterUpdate'() | undefined, % = 1
174+
setop :: antidote_pb:'ApbSetUpdate'() | undefined, % = 2
175+
regop :: antidote_pb:'ApbRegUpdate'() | undefined, % = 3
176+
mapop :: antidote_pb:'ApbMapUpdate'() | undefined, % = 5
177+
resetop :: antidote_pb:'ApbCrdtReset'() | undefined, % = 6
178+
flagop :: antidote_pb:'ApbFlagUpdate'() | undefined % = 7
179179
}).
180180
-endif.
181181

182182
-ifndef('APBUPDATEOBJECTS_PB_H').
183183
-define('APBUPDATEOBJECTS_PB_H', true).
184184
-record('ApbUpdateObjects',
185-
{updates = [], % = 1, [{msg,'ApbUpdateOp'}]
186-
transaction_descriptor % = 2, bytes
185+
{updates = [] :: [antidote_pb:'ApbUpdateOp'()] | undefined, % = 1
186+
transaction_descriptor :: iodata() % = 2
187187
}).
188188
-endif.
189189

190190
-ifndef('APBSTARTTRANSACTION_PB_H').
191191
-define('APBSTARTTRANSACTION_PB_H', true).
192192
-record('ApbStartTransaction',
193-
{timestamp, % = 1, bytes (optional)
194-
properties % = 2, {msg,'ApbTxnProperties'} (optional)
193+
{timestamp :: iodata() | undefined, % = 1
194+
properties :: antidote_pb:'ApbTxnProperties'() | undefined % = 2
195195
}).
196196
-endif.
197197

198198
-ifndef('APBABORTTRANSACTION_PB_H').
199199
-define('APBABORTTRANSACTION_PB_H', true).
200200
-record('ApbAbortTransaction',
201-
{transaction_descriptor % = 1, bytes
201+
{transaction_descriptor :: iodata() % = 1
202202
}).
203203
-endif.
204204

205205
-ifndef('APBCOMMITTRANSACTION_PB_H').
206206
-define('APBCOMMITTRANSACTION_PB_H', true).
207207
-record('ApbCommitTransaction',
208-
{transaction_descriptor % = 1, bytes
208+
{transaction_descriptor :: iodata() % = 1
209209
}).
210210
-endif.
211211

212212
-ifndef('APBSTATICUPDATEOBJECTS_PB_H').
213213
-define('APBSTATICUPDATEOBJECTS_PB_H', true).
214214
-record('ApbStaticUpdateObjects',
215-
{transaction, % = 1, {msg,'ApbStartTransaction'}
216-
updates = [] % = 2, [{msg,'ApbUpdateOp'}]
215+
{transaction :: antidote_pb:'ApbStartTransaction'(), % = 1
216+
updates = [] :: [antidote_pb:'ApbUpdateOp'()] | undefined % = 2
217217
}).
218218
-endif.
219219

220220
-ifndef('APBSTATICREADOBJECTS_PB_H').
221221
-define('APBSTATICREADOBJECTS_PB_H', true).
222222
-record('ApbStaticReadObjects',
223-
{transaction, % = 1, {msg,'ApbStartTransaction'}
224-
objects = [] % = 2, [{msg,'ApbBoundObject'}]
223+
{transaction :: antidote_pb:'ApbStartTransaction'(), % = 1
224+
objects = [] :: [antidote_pb:'ApbBoundObject'()] | undefined % = 2
225225
}).
226226
-endif.
227227

228228
-ifndef('APBSTARTTRANSACTIONRESP_PB_H').
229229
-define('APBSTARTTRANSACTIONRESP_PB_H', true).
230230
-record('ApbStartTransactionResp',
231-
{success, % = 1, bool
232-
transaction_descriptor, % = 2, bytes (optional)
233-
errorcode % = 3, uint32 (optional)
231+
{success :: boolean() | 0 | 1, % = 1
232+
transaction_descriptor :: iodata() | undefined, % = 2
233+
errorcode :: non_neg_integer() | undefined % = 3, 32 bits
234234
}).
235235
-endif.
236236

237237
-ifndef('APBREADOBJECTRESP_PB_H').
238238
-define('APBREADOBJECTRESP_PB_H', true).
239239
-record('ApbReadObjectResp',
240-
{counter, % = 1, {msg,'ApbGetCounterResp'} (optional)
241-
set, % = 2, {msg,'ApbGetSetResp'} (optional)
242-
reg, % = 3, {msg,'ApbGetRegResp'} (optional)
243-
mvreg, % = 4, {msg,'ApbGetMVRegResp'} (optional)
244-
map, % = 6, {msg,'ApbGetMapResp'} (optional)
245-
flag % = 7, {msg,'ApbGetFlagResp'} (optional)
240+
{counter :: antidote_pb:'ApbGetCounterResp'() | undefined, % = 1
241+
set :: antidote_pb:'ApbGetSetResp'() | undefined, % = 2
242+
reg :: antidote_pb:'ApbGetRegResp'() | undefined, % = 3
243+
mvreg :: antidote_pb:'ApbGetMVRegResp'() | undefined, % = 4
244+
map :: antidote_pb:'ApbGetMapResp'() | undefined, % = 6
245+
flag :: antidote_pb:'ApbGetFlagResp'() | undefined % = 7
246246
}).
247247
-endif.
248248

249249
-ifndef('APBREADOBJECTSRESP_PB_H').
250250
-define('APBREADOBJECTSRESP_PB_H', true).
251251
-record('ApbReadObjectsResp',
252-
{success, % = 1, bool
253-
objects = [], % = 2, [{msg,'ApbReadObjectResp'}]
254-
errorcode % = 3, uint32 (optional)
252+
{success :: boolean() | 0 | 1, % = 1
253+
objects = [] :: [antidote_pb:'ApbReadObjectResp'()] | undefined, % = 2
254+
errorcode :: non_neg_integer() | undefined % = 3, 32 bits
255255
}).
256256
-endif.
257257

258258
-ifndef('APBCOMMITRESP_PB_H').
259259
-define('APBCOMMITRESP_PB_H', true).
260260
-record('ApbCommitResp',
261-
{success, % = 1, bool
262-
commit_time, % = 2, bytes (optional)
263-
errorcode % = 3, uint32 (optional)
261+
{success :: boolean() | 0 | 1, % = 1
262+
commit_time :: iodata() | undefined, % = 2
263+
errorcode :: non_neg_integer() | undefined % = 3, 32 bits
264264
}).
265265
-endif.
266266

267267
-ifndef('APBSTATICREADOBJECTSRESP_PB_H').
268268
-define('APBSTATICREADOBJECTSRESP_PB_H', true).
269269
-record('ApbStaticReadObjectsResp',
270-
{objects, % = 1, {msg,'ApbReadObjectsResp'}
271-
committime % = 2, {msg,'ApbCommitResp'}
270+
{objects :: antidote_pb:'ApbReadObjectsResp'(), % = 1
271+
committime :: antidote_pb:'ApbCommitResp'() % = 2
272+
}).
273+
-endif.
274+
275+
-ifndef('APBCREATEDC_PB_H').
276+
-define('APBCREATEDC_PB_H', true).
277+
-record('ApbCreateDC',
278+
{nodes = [] :: [iodata()] | undefined % = 1
279+
}).
280+
-endif.
281+
282+
-ifndef('APBGETCONNECTIONDESCRIPTOR_PB_H').
283+
-define('APBGETCONNECTIONDESCRIPTOR_PB_H', true).
284+
-record('ApbGetConnectionDescriptor',
285+
{
286+
}).
287+
-endif.
288+
289+
-ifndef('APBGETCONNECTIONDESCRIPTORRESP_PB_H').
290+
-define('APBGETCONNECTIONDESCRIPTORRESP_PB_H', true).
291+
-record('ApbGetConnectionDescriptorResp',
292+
{success :: boolean() | 0 | 1, % = 1
293+
descriptor :: iodata() | undefined, % = 2
294+
errorcode :: non_neg_integer() | undefined % = 3, 32 bits
295+
}).
296+
-endif.
297+
298+
-ifndef('APBCONNECTTODCS_PB_H').
299+
-define('APBCONNECTTODCS_PB_H', true).
300+
-record('ApbConnectToDCs',
301+
{descriptors = [] :: [iodata()] | undefined % = 1
272302
}).
273303
-endif.
274304

0 commit comments

Comments
 (0)