zookeeper 0.9.3-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/CHANGELOG +119 -0
- data/Gemfile +17 -0
- data/LICENSE +23 -0
- data/Manifest +29 -0
- data/README.markdown +59 -0
- data/Rakefile +139 -0
- data/examples/cloud_config.rb +125 -0
- data/ext/.gitignore +6 -0
- data/ext/Rakefile +51 -0
- data/ext/c_zookeeper.rb +212 -0
- data/ext/dbg.h +53 -0
- data/ext/depend +5 -0
- data/ext/extconf.rb +85 -0
- data/ext/generate_gvl_code.rb +316 -0
- data/ext/zkc-3.3.5.tar.gz +0 -0
- data/ext/zkrb_wrapper.c +731 -0
- data/ext/zkrb_wrapper.h +330 -0
- data/ext/zkrb_wrapper_compat.c +15 -0
- data/ext/zkrb_wrapper_compat.h +11 -0
- data/ext/zookeeper_base.rb +211 -0
- data/ext/zookeeper_c.c +725 -0
- data/ext/zookeeper_lib.c +677 -0
- data/ext/zookeeper_lib.h +172 -0
- data/java/zookeeper_base.rb +477 -0
- data/lib/zookeeper.rb +297 -0
- data/lib/zookeeper/acls.rb +40 -0
- data/lib/zookeeper/callbacks.rb +91 -0
- data/lib/zookeeper/common.rb +174 -0
- data/lib/zookeeper/common/queue_with_pipe.rb +78 -0
- data/lib/zookeeper/constants.rb +57 -0
- data/lib/zookeeper/em_client.rb +55 -0
- data/lib/zookeeper/exceptions.rb +100 -0
- data/lib/zookeeper/stat.rb +21 -0
- data/lib/zookeeper/version.rb +6 -0
- data/notes.txt +14 -0
- data/spec/c_zookeeper_spec.rb +50 -0
- data/spec/chrooted_connection_spec.rb +81 -0
- data/spec/default_watcher_spec.rb +41 -0
- data/spec/em_spec.rb +51 -0
- data/spec/log4j.properties +17 -0
- data/spec/shared/all_success_return_values.rb +10 -0
- data/spec/shared/connection_examples.rb +1018 -0
- data/spec/spec_helper.rb +119 -0
- data/spec/support/progress_formatter.rb +15 -0
- data/spec/zookeeper_spec.rb +24 -0
- data/test/test_basic.rb +37 -0
- data/test/test_callback1.rb +36 -0
- data/test/test_close.rb +16 -0
- data/test/test_esoteric.rb +7 -0
- data/test/test_watcher1.rb +56 -0
- data/test/test_watcher2.rb +52 -0
- metadata +181 -0
Binary file
|
data/ext/zkrb_wrapper.c
ADDED
@@ -0,0 +1,731 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Autogenerated boilerplate wrappers around zoo_* function calls necessary for using
|
4
|
+
rb_thread_blocking_region to release the GIL when calling native code.
|
5
|
+
|
6
|
+
generated by ext/generate_gvl_code.rb
|
7
|
+
|
8
|
+
*/
|
9
|
+
|
10
|
+
#include "ruby.h"
|
11
|
+
#include "zkrb_wrapper.h"
|
12
|
+
#include <errno.h>
|
13
|
+
#include <stdio.h>
|
14
|
+
#include <stdlib.h>
|
15
|
+
|
16
|
+
static VALUE zkrb_gvl_zoo_recv_timeout(void *data) {
|
17
|
+
zkrb_zoo_recv_timeout_args_t *a = (zkrb_zoo_recv_timeout_args_t *)data;
|
18
|
+
a->rc = zoo_recv_timeout(a->zh);
|
19
|
+
return Qnil;
|
20
|
+
}
|
21
|
+
|
22
|
+
// wrapper that calls zoo_recv_timeout via zkrb_gvl_zoo_recv_timeout inside rb_thread_blocking_region
|
23
|
+
int zkrb_call_zoo_recv_timeout(zhandle_t *zh) {
|
24
|
+
zkrb_zoo_recv_timeout_args_t args = {
|
25
|
+
.rc = ZKRB_FAIL,
|
26
|
+
.zh = zh
|
27
|
+
};
|
28
|
+
|
29
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_recv_timeout, (void *)&args);
|
30
|
+
|
31
|
+
return args.rc;
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
static VALUE zkrb_gvl_zoo_state(void *data) {
|
36
|
+
zkrb_zoo_state_args_t *a = (zkrb_zoo_state_args_t *)data;
|
37
|
+
a->rc = zoo_state(a->zh);
|
38
|
+
return Qnil;
|
39
|
+
}
|
40
|
+
|
41
|
+
// wrapper that calls zoo_state via zkrb_gvl_zoo_state inside rb_thread_blocking_region
|
42
|
+
int zkrb_call_zoo_state(zhandle_t *zh) {
|
43
|
+
zkrb_zoo_state_args_t args = {
|
44
|
+
.rc = ZKRB_FAIL,
|
45
|
+
.zh = zh
|
46
|
+
};
|
47
|
+
|
48
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_state, (void *)&args);
|
49
|
+
|
50
|
+
return args.rc;
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
static VALUE zkrb_gvl_zoo_acreate(void *data) {
|
55
|
+
zkrb_zoo_acreate_args_t *a = (zkrb_zoo_acreate_args_t *)data;
|
56
|
+
a->rc = zoo_acreate(a->zh, a->path, a->value, a->valuelen, a->acl, a->flags, a->completion, a->data);
|
57
|
+
return Qnil;
|
58
|
+
}
|
59
|
+
|
60
|
+
// wrapper that calls zoo_acreate via zkrb_gvl_zoo_acreate inside rb_thread_blocking_region
|
61
|
+
int zkrb_call_zoo_acreate(zhandle_t *zh, const char *path, const char *value, int valuelen, const struct ACL_vector *acl, int flags, string_completion_t completion, const void *data) {
|
62
|
+
zkrb_zoo_acreate_args_t args = {
|
63
|
+
.rc = ZKRB_FAIL,
|
64
|
+
.zh = zh,
|
65
|
+
.path = path,
|
66
|
+
.value = value,
|
67
|
+
.valuelen = valuelen,
|
68
|
+
.acl = acl,
|
69
|
+
.flags = flags,
|
70
|
+
.completion = completion,
|
71
|
+
.data = data
|
72
|
+
};
|
73
|
+
|
74
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_acreate, (void *)&args);
|
75
|
+
|
76
|
+
return args.rc;
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
static VALUE zkrb_gvl_zoo_adelete(void *data) {
|
81
|
+
zkrb_zoo_adelete_args_t *a = (zkrb_zoo_adelete_args_t *)data;
|
82
|
+
a->rc = zoo_adelete(a->zh, a->path, a->version, a->completion, a->data);
|
83
|
+
return Qnil;
|
84
|
+
}
|
85
|
+
|
86
|
+
// wrapper that calls zoo_adelete via zkrb_gvl_zoo_adelete inside rb_thread_blocking_region
|
87
|
+
int zkrb_call_zoo_adelete(zhandle_t *zh, const char *path, int version, void_completion_t completion, const void *data) {
|
88
|
+
zkrb_zoo_adelete_args_t args = {
|
89
|
+
.rc = ZKRB_FAIL,
|
90
|
+
.zh = zh,
|
91
|
+
.path = path,
|
92
|
+
.version = version,
|
93
|
+
.completion = completion,
|
94
|
+
.data = data
|
95
|
+
};
|
96
|
+
|
97
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_adelete, (void *)&args);
|
98
|
+
|
99
|
+
return args.rc;
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
static VALUE zkrb_gvl_zoo_aexists(void *data) {
|
104
|
+
zkrb_zoo_aexists_args_t *a = (zkrb_zoo_aexists_args_t *)data;
|
105
|
+
a->rc = zoo_aexists(a->zh, a->path, a->watch, a->completion, a->data);
|
106
|
+
return Qnil;
|
107
|
+
}
|
108
|
+
|
109
|
+
// wrapper that calls zoo_aexists via zkrb_gvl_zoo_aexists inside rb_thread_blocking_region
|
110
|
+
int zkrb_call_zoo_aexists(zhandle_t *zh, const char *path, int watch, stat_completion_t completion, const void *data) {
|
111
|
+
zkrb_zoo_aexists_args_t args = {
|
112
|
+
.rc = ZKRB_FAIL,
|
113
|
+
.zh = zh,
|
114
|
+
.path = path,
|
115
|
+
.watch = watch,
|
116
|
+
.completion = completion,
|
117
|
+
.data = data
|
118
|
+
};
|
119
|
+
|
120
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_aexists, (void *)&args);
|
121
|
+
|
122
|
+
return args.rc;
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
static VALUE zkrb_gvl_zoo_awexists(void *data) {
|
127
|
+
zkrb_zoo_awexists_args_t *a = (zkrb_zoo_awexists_args_t *)data;
|
128
|
+
a->rc = zoo_awexists(a->zh, a->path, a->watcher, a->watcherCtx, a->completion, a->data);
|
129
|
+
return Qnil;
|
130
|
+
}
|
131
|
+
|
132
|
+
// wrapper that calls zoo_awexists via zkrb_gvl_zoo_awexists inside rb_thread_blocking_region
|
133
|
+
int zkrb_call_zoo_awexists(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, stat_completion_t completion, const void *data) {
|
134
|
+
zkrb_zoo_awexists_args_t args = {
|
135
|
+
.rc = ZKRB_FAIL,
|
136
|
+
.zh = zh,
|
137
|
+
.path = path,
|
138
|
+
.watcher = watcher,
|
139
|
+
.watcherCtx = watcherCtx,
|
140
|
+
.completion = completion,
|
141
|
+
.data = data
|
142
|
+
};
|
143
|
+
|
144
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_awexists, (void *)&args);
|
145
|
+
|
146
|
+
return args.rc;
|
147
|
+
}
|
148
|
+
|
149
|
+
|
150
|
+
static VALUE zkrb_gvl_zoo_aget(void *data) {
|
151
|
+
zkrb_zoo_aget_args_t *a = (zkrb_zoo_aget_args_t *)data;
|
152
|
+
a->rc = zoo_aget(a->zh, a->path, a->watch, a->completion, a->data);
|
153
|
+
return Qnil;
|
154
|
+
}
|
155
|
+
|
156
|
+
// wrapper that calls zoo_aget via zkrb_gvl_zoo_aget inside rb_thread_blocking_region
|
157
|
+
int zkrb_call_zoo_aget(zhandle_t *zh, const char *path, int watch, data_completion_t completion, const void *data) {
|
158
|
+
zkrb_zoo_aget_args_t args = {
|
159
|
+
.rc = ZKRB_FAIL,
|
160
|
+
.zh = zh,
|
161
|
+
.path = path,
|
162
|
+
.watch = watch,
|
163
|
+
.completion = completion,
|
164
|
+
.data = data
|
165
|
+
};
|
166
|
+
|
167
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_aget, (void *)&args);
|
168
|
+
|
169
|
+
return args.rc;
|
170
|
+
}
|
171
|
+
|
172
|
+
|
173
|
+
static VALUE zkrb_gvl_zoo_awget(void *data) {
|
174
|
+
zkrb_zoo_awget_args_t *a = (zkrb_zoo_awget_args_t *)data;
|
175
|
+
a->rc = zoo_awget(a->zh, a->path, a->watcher, a->watcherCtx, a->completion, a->data);
|
176
|
+
return Qnil;
|
177
|
+
}
|
178
|
+
|
179
|
+
// wrapper that calls zoo_awget via zkrb_gvl_zoo_awget inside rb_thread_blocking_region
|
180
|
+
int zkrb_call_zoo_awget(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, data_completion_t completion, const void *data) {
|
181
|
+
zkrb_zoo_awget_args_t args = {
|
182
|
+
.rc = ZKRB_FAIL,
|
183
|
+
.zh = zh,
|
184
|
+
.path = path,
|
185
|
+
.watcher = watcher,
|
186
|
+
.watcherCtx = watcherCtx,
|
187
|
+
.completion = completion,
|
188
|
+
.data = data
|
189
|
+
};
|
190
|
+
|
191
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_awget, (void *)&args);
|
192
|
+
|
193
|
+
return args.rc;
|
194
|
+
}
|
195
|
+
|
196
|
+
|
197
|
+
static VALUE zkrb_gvl_zoo_aset(void *data) {
|
198
|
+
zkrb_zoo_aset_args_t *a = (zkrb_zoo_aset_args_t *)data;
|
199
|
+
a->rc = zoo_aset(a->zh, a->path, a->buffer, a->buflen, a->version, a->completion, a->data);
|
200
|
+
return Qnil;
|
201
|
+
}
|
202
|
+
|
203
|
+
// wrapper that calls zoo_aset via zkrb_gvl_zoo_aset inside rb_thread_blocking_region
|
204
|
+
int zkrb_call_zoo_aset(zhandle_t *zh, const char *path, const char *buffer, int buflen, int version, stat_completion_t completion, const void *data) {
|
205
|
+
zkrb_zoo_aset_args_t args = {
|
206
|
+
.rc = ZKRB_FAIL,
|
207
|
+
.zh = zh,
|
208
|
+
.path = path,
|
209
|
+
.buffer = buffer,
|
210
|
+
.buflen = buflen,
|
211
|
+
.version = version,
|
212
|
+
.completion = completion,
|
213
|
+
.data = data
|
214
|
+
};
|
215
|
+
|
216
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_aset, (void *)&args);
|
217
|
+
|
218
|
+
return args.rc;
|
219
|
+
}
|
220
|
+
|
221
|
+
|
222
|
+
static VALUE zkrb_gvl_zoo_aget_children(void *data) {
|
223
|
+
zkrb_zoo_aget_children_args_t *a = (zkrb_zoo_aget_children_args_t *)data;
|
224
|
+
a->rc = zoo_aget_children(a->zh, a->path, a->watch, a->completion, a->data);
|
225
|
+
return Qnil;
|
226
|
+
}
|
227
|
+
|
228
|
+
// wrapper that calls zoo_aget_children via zkrb_gvl_zoo_aget_children inside rb_thread_blocking_region
|
229
|
+
int zkrb_call_zoo_aget_children(zhandle_t *zh, const char *path, int watch, strings_completion_t completion, const void *data) {
|
230
|
+
zkrb_zoo_aget_children_args_t args = {
|
231
|
+
.rc = ZKRB_FAIL,
|
232
|
+
.zh = zh,
|
233
|
+
.path = path,
|
234
|
+
.watch = watch,
|
235
|
+
.completion = completion,
|
236
|
+
.data = data
|
237
|
+
};
|
238
|
+
|
239
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_aget_children, (void *)&args);
|
240
|
+
|
241
|
+
return args.rc;
|
242
|
+
}
|
243
|
+
|
244
|
+
|
245
|
+
static VALUE zkrb_gvl_zoo_awget_children(void *data) {
|
246
|
+
zkrb_zoo_awget_children_args_t *a = (zkrb_zoo_awget_children_args_t *)data;
|
247
|
+
a->rc = zoo_awget_children(a->zh, a->path, a->watcher, a->watcherCtx, a->completion, a->data);
|
248
|
+
return Qnil;
|
249
|
+
}
|
250
|
+
|
251
|
+
// wrapper that calls zoo_awget_children via zkrb_gvl_zoo_awget_children inside rb_thread_blocking_region
|
252
|
+
int zkrb_call_zoo_awget_children(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, strings_completion_t completion, const void *data) {
|
253
|
+
zkrb_zoo_awget_children_args_t args = {
|
254
|
+
.rc = ZKRB_FAIL,
|
255
|
+
.zh = zh,
|
256
|
+
.path = path,
|
257
|
+
.watcher = watcher,
|
258
|
+
.watcherCtx = watcherCtx,
|
259
|
+
.completion = completion,
|
260
|
+
.data = data
|
261
|
+
};
|
262
|
+
|
263
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_awget_children, (void *)&args);
|
264
|
+
|
265
|
+
return args.rc;
|
266
|
+
}
|
267
|
+
|
268
|
+
|
269
|
+
static VALUE zkrb_gvl_zoo_aget_children2(void *data) {
|
270
|
+
zkrb_zoo_aget_children2_args_t *a = (zkrb_zoo_aget_children2_args_t *)data;
|
271
|
+
a->rc = zoo_aget_children2(a->zh, a->path, a->watch, a->completion, a->data);
|
272
|
+
return Qnil;
|
273
|
+
}
|
274
|
+
|
275
|
+
// wrapper that calls zoo_aget_children2 via zkrb_gvl_zoo_aget_children2 inside rb_thread_blocking_region
|
276
|
+
int zkrb_call_zoo_aget_children2(zhandle_t *zh, const char *path, int watch, strings_stat_completion_t completion, const void *data) {
|
277
|
+
zkrb_zoo_aget_children2_args_t args = {
|
278
|
+
.rc = ZKRB_FAIL,
|
279
|
+
.zh = zh,
|
280
|
+
.path = path,
|
281
|
+
.watch = watch,
|
282
|
+
.completion = completion,
|
283
|
+
.data = data
|
284
|
+
};
|
285
|
+
|
286
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_aget_children2, (void *)&args);
|
287
|
+
|
288
|
+
return args.rc;
|
289
|
+
}
|
290
|
+
|
291
|
+
|
292
|
+
static VALUE zkrb_gvl_zoo_awget_children2(void *data) {
|
293
|
+
zkrb_zoo_awget_children2_args_t *a = (zkrb_zoo_awget_children2_args_t *)data;
|
294
|
+
a->rc = zoo_awget_children2(a->zh, a->path, a->watcher, a->watcherCtx, a->completion, a->data);
|
295
|
+
return Qnil;
|
296
|
+
}
|
297
|
+
|
298
|
+
// wrapper that calls zoo_awget_children2 via zkrb_gvl_zoo_awget_children2 inside rb_thread_blocking_region
|
299
|
+
int zkrb_call_zoo_awget_children2(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, strings_stat_completion_t completion, const void *data) {
|
300
|
+
zkrb_zoo_awget_children2_args_t args = {
|
301
|
+
.rc = ZKRB_FAIL,
|
302
|
+
.zh = zh,
|
303
|
+
.path = path,
|
304
|
+
.watcher = watcher,
|
305
|
+
.watcherCtx = watcherCtx,
|
306
|
+
.completion = completion,
|
307
|
+
.data = data
|
308
|
+
};
|
309
|
+
|
310
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_awget_children2, (void *)&args);
|
311
|
+
|
312
|
+
return args.rc;
|
313
|
+
}
|
314
|
+
|
315
|
+
|
316
|
+
static VALUE zkrb_gvl_zoo_async(void *data) {
|
317
|
+
zkrb_zoo_async_args_t *a = (zkrb_zoo_async_args_t *)data;
|
318
|
+
a->rc = zoo_async(a->zh, a->path, a->completion, a->data);
|
319
|
+
return Qnil;
|
320
|
+
}
|
321
|
+
|
322
|
+
// wrapper that calls zoo_async via zkrb_gvl_zoo_async inside rb_thread_blocking_region
|
323
|
+
int zkrb_call_zoo_async(zhandle_t *zh, const char *path, string_completion_t completion, const void *data) {
|
324
|
+
zkrb_zoo_async_args_t args = {
|
325
|
+
.rc = ZKRB_FAIL,
|
326
|
+
.zh = zh,
|
327
|
+
.path = path,
|
328
|
+
.completion = completion,
|
329
|
+
.data = data
|
330
|
+
};
|
331
|
+
|
332
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_async, (void *)&args);
|
333
|
+
|
334
|
+
return args.rc;
|
335
|
+
}
|
336
|
+
|
337
|
+
|
338
|
+
static VALUE zkrb_gvl_zoo_aget_acl(void *data) {
|
339
|
+
zkrb_zoo_aget_acl_args_t *a = (zkrb_zoo_aget_acl_args_t *)data;
|
340
|
+
a->rc = zoo_aget_acl(a->zh, a->path, a->completion, a->data);
|
341
|
+
return Qnil;
|
342
|
+
}
|
343
|
+
|
344
|
+
// wrapper that calls zoo_aget_acl via zkrb_gvl_zoo_aget_acl inside rb_thread_blocking_region
|
345
|
+
int zkrb_call_zoo_aget_acl(zhandle_t *zh, const char *path, acl_completion_t completion, const void *data) {
|
346
|
+
zkrb_zoo_aget_acl_args_t args = {
|
347
|
+
.rc = ZKRB_FAIL,
|
348
|
+
.zh = zh,
|
349
|
+
.path = path,
|
350
|
+
.completion = completion,
|
351
|
+
.data = data
|
352
|
+
};
|
353
|
+
|
354
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_aget_acl, (void *)&args);
|
355
|
+
|
356
|
+
return args.rc;
|
357
|
+
}
|
358
|
+
|
359
|
+
|
360
|
+
static VALUE zkrb_gvl_zoo_aset_acl(void *data) {
|
361
|
+
zkrb_zoo_aset_acl_args_t *a = (zkrb_zoo_aset_acl_args_t *)data;
|
362
|
+
a->rc = zoo_aset_acl(a->zh, a->path, a->version, a->acl, a->completion, a->data);
|
363
|
+
return Qnil;
|
364
|
+
}
|
365
|
+
|
366
|
+
// wrapper that calls zoo_aset_acl via zkrb_gvl_zoo_aset_acl inside rb_thread_blocking_region
|
367
|
+
int zkrb_call_zoo_aset_acl(zhandle_t *zh, const char *path, int version, struct ACL_vector *acl, void_completion_t completion, const void *data) {
|
368
|
+
zkrb_zoo_aset_acl_args_t args = {
|
369
|
+
.rc = ZKRB_FAIL,
|
370
|
+
.zh = zh,
|
371
|
+
.path = path,
|
372
|
+
.version = version,
|
373
|
+
.acl = acl,
|
374
|
+
.completion = completion,
|
375
|
+
.data = data
|
376
|
+
};
|
377
|
+
|
378
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_aset_acl, (void *)&args);
|
379
|
+
|
380
|
+
return args.rc;
|
381
|
+
}
|
382
|
+
|
383
|
+
|
384
|
+
static VALUE zkrb_gvl_zoo_add_auth(void *data) {
|
385
|
+
zkrb_zoo_add_auth_args_t *a = (zkrb_zoo_add_auth_args_t *)data;
|
386
|
+
a->rc = zoo_add_auth(a->zh, a->scheme, a->cert, a->certLen, a->completion, a->data);
|
387
|
+
return Qnil;
|
388
|
+
}
|
389
|
+
|
390
|
+
// wrapper that calls zoo_add_auth via zkrb_gvl_zoo_add_auth inside rb_thread_blocking_region
|
391
|
+
int zkrb_call_zoo_add_auth(zhandle_t *zh, const char* scheme, const char* cert, int certLen, void_completion_t completion, const void *data) {
|
392
|
+
zkrb_zoo_add_auth_args_t args = {
|
393
|
+
.rc = ZKRB_FAIL,
|
394
|
+
.zh = zh,
|
395
|
+
.scheme = scheme,
|
396
|
+
.cert = cert,
|
397
|
+
.certLen = certLen,
|
398
|
+
.completion = completion,
|
399
|
+
.data = data
|
400
|
+
};
|
401
|
+
|
402
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_add_auth, (void *)&args);
|
403
|
+
|
404
|
+
return args.rc;
|
405
|
+
}
|
406
|
+
|
407
|
+
|
408
|
+
static VALUE zkrb_gvl_zoo_create(void *data) {
|
409
|
+
zkrb_zoo_create_args_t *a = (zkrb_zoo_create_args_t *)data;
|
410
|
+
a->rc = zoo_create(a->zh, a->path, a->value, a->valuelen, a->acl, a->flags, a->path_buffer, a->path_buffer_len);
|
411
|
+
return Qnil;
|
412
|
+
}
|
413
|
+
|
414
|
+
// wrapper that calls zoo_create via zkrb_gvl_zoo_create inside rb_thread_blocking_region
|
415
|
+
int zkrb_call_zoo_create(zhandle_t *zh, const char *path, const char *value, int valuelen, const struct ACL_vector *acl, int flags, char *path_buffer, int path_buffer_len) {
|
416
|
+
zkrb_zoo_create_args_t args = {
|
417
|
+
.rc = ZKRB_FAIL,
|
418
|
+
.zh = zh,
|
419
|
+
.path = path,
|
420
|
+
.value = value,
|
421
|
+
.valuelen = valuelen,
|
422
|
+
.acl = acl,
|
423
|
+
.flags = flags,
|
424
|
+
.path_buffer = path_buffer,
|
425
|
+
.path_buffer_len = path_buffer_len
|
426
|
+
};
|
427
|
+
|
428
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_create, (void *)&args);
|
429
|
+
|
430
|
+
return args.rc;
|
431
|
+
}
|
432
|
+
|
433
|
+
|
434
|
+
static VALUE zkrb_gvl_zoo_delete(void *data) {
|
435
|
+
zkrb_zoo_delete_args_t *a = (zkrb_zoo_delete_args_t *)data;
|
436
|
+
a->rc = zoo_delete(a->zh, a->path, a->version);
|
437
|
+
return Qnil;
|
438
|
+
}
|
439
|
+
|
440
|
+
// wrapper that calls zoo_delete via zkrb_gvl_zoo_delete inside rb_thread_blocking_region
|
441
|
+
int zkrb_call_zoo_delete(zhandle_t *zh, const char *path, int version) {
|
442
|
+
zkrb_zoo_delete_args_t args = {
|
443
|
+
.rc = ZKRB_FAIL,
|
444
|
+
.zh = zh,
|
445
|
+
.path = path,
|
446
|
+
.version = version
|
447
|
+
};
|
448
|
+
|
449
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_delete, (void *)&args);
|
450
|
+
|
451
|
+
return args.rc;
|
452
|
+
}
|
453
|
+
|
454
|
+
|
455
|
+
static VALUE zkrb_gvl_zoo_exists(void *data) {
|
456
|
+
zkrb_zoo_exists_args_t *a = (zkrb_zoo_exists_args_t *)data;
|
457
|
+
a->rc = zoo_exists(a->zh, a->path, a->watch, a->stat);
|
458
|
+
return Qnil;
|
459
|
+
}
|
460
|
+
|
461
|
+
// wrapper that calls zoo_exists via zkrb_gvl_zoo_exists inside rb_thread_blocking_region
|
462
|
+
int zkrb_call_zoo_exists(zhandle_t *zh, const char *path, int watch, struct Stat *stat) {
|
463
|
+
zkrb_zoo_exists_args_t args = {
|
464
|
+
.rc = ZKRB_FAIL,
|
465
|
+
.zh = zh,
|
466
|
+
.path = path,
|
467
|
+
.watch = watch,
|
468
|
+
.stat = stat
|
469
|
+
};
|
470
|
+
|
471
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_exists, (void *)&args);
|
472
|
+
|
473
|
+
return args.rc;
|
474
|
+
}
|
475
|
+
|
476
|
+
|
477
|
+
static VALUE zkrb_gvl_zoo_wexists(void *data) {
|
478
|
+
zkrb_zoo_wexists_args_t *a = (zkrb_zoo_wexists_args_t *)data;
|
479
|
+
a->rc = zoo_wexists(a->zh, a->path, a->watcher, a->watcherCtx, a->stat);
|
480
|
+
return Qnil;
|
481
|
+
}
|
482
|
+
|
483
|
+
// wrapper that calls zoo_wexists via zkrb_gvl_zoo_wexists inside rb_thread_blocking_region
|
484
|
+
int zkrb_call_zoo_wexists(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct Stat *stat) {
|
485
|
+
zkrb_zoo_wexists_args_t args = {
|
486
|
+
.rc = ZKRB_FAIL,
|
487
|
+
.zh = zh,
|
488
|
+
.path = path,
|
489
|
+
.watcher = watcher,
|
490
|
+
.watcherCtx = watcherCtx,
|
491
|
+
.stat = stat
|
492
|
+
};
|
493
|
+
|
494
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_wexists, (void *)&args);
|
495
|
+
|
496
|
+
return args.rc;
|
497
|
+
}
|
498
|
+
|
499
|
+
|
500
|
+
static VALUE zkrb_gvl_zoo_get(void *data) {
|
501
|
+
zkrb_zoo_get_args_t *a = (zkrb_zoo_get_args_t *)data;
|
502
|
+
a->rc = zoo_get(a->zh, a->path, a->watch, a->buffer, a->buffer_len, a->stat);
|
503
|
+
return Qnil;
|
504
|
+
}
|
505
|
+
|
506
|
+
// wrapper that calls zoo_get via zkrb_gvl_zoo_get inside rb_thread_blocking_region
|
507
|
+
int zkrb_call_zoo_get(zhandle_t *zh, const char *path, int watch, char *buffer, int* buffer_len, struct Stat *stat) {
|
508
|
+
zkrb_zoo_get_args_t args = {
|
509
|
+
.rc = ZKRB_FAIL,
|
510
|
+
.zh = zh,
|
511
|
+
.path = path,
|
512
|
+
.watch = watch,
|
513
|
+
.buffer = buffer,
|
514
|
+
.buffer_len = buffer_len,
|
515
|
+
.stat = stat
|
516
|
+
};
|
517
|
+
|
518
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_get, (void *)&args);
|
519
|
+
|
520
|
+
return args.rc;
|
521
|
+
}
|
522
|
+
|
523
|
+
|
524
|
+
static VALUE zkrb_gvl_zoo_wget(void *data) {
|
525
|
+
zkrb_zoo_wget_args_t *a = (zkrb_zoo_wget_args_t *)data;
|
526
|
+
a->rc = zoo_wget(a->zh, a->path, a->watcher, a->watcherCtx, a->buffer, a->buffer_len, a->stat);
|
527
|
+
return Qnil;
|
528
|
+
}
|
529
|
+
|
530
|
+
// wrapper that calls zoo_wget via zkrb_gvl_zoo_wget inside rb_thread_blocking_region
|
531
|
+
int zkrb_call_zoo_wget(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, char *buffer, int* buffer_len, struct Stat *stat) {
|
532
|
+
zkrb_zoo_wget_args_t args = {
|
533
|
+
.rc = ZKRB_FAIL,
|
534
|
+
.zh = zh,
|
535
|
+
.path = path,
|
536
|
+
.watcher = watcher,
|
537
|
+
.watcherCtx = watcherCtx,
|
538
|
+
.buffer = buffer,
|
539
|
+
.buffer_len = buffer_len,
|
540
|
+
.stat = stat
|
541
|
+
};
|
542
|
+
|
543
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_wget, (void *)&args);
|
544
|
+
|
545
|
+
return args.rc;
|
546
|
+
}
|
547
|
+
|
548
|
+
|
549
|
+
static VALUE zkrb_gvl_zoo_set(void *data) {
|
550
|
+
zkrb_zoo_set_args_t *a = (zkrb_zoo_set_args_t *)data;
|
551
|
+
a->rc = zoo_set(a->zh, a->path, a->buffer, a->buflen, a->version);
|
552
|
+
return Qnil;
|
553
|
+
}
|
554
|
+
|
555
|
+
// wrapper that calls zoo_set via zkrb_gvl_zoo_set inside rb_thread_blocking_region
|
556
|
+
int zkrb_call_zoo_set(zhandle_t *zh, const char *path, const char *buffer, int buflen, int version) {
|
557
|
+
zkrb_zoo_set_args_t args = {
|
558
|
+
.rc = ZKRB_FAIL,
|
559
|
+
.zh = zh,
|
560
|
+
.path = path,
|
561
|
+
.buffer = buffer,
|
562
|
+
.buflen = buflen,
|
563
|
+
.version = version
|
564
|
+
};
|
565
|
+
|
566
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_set, (void *)&args);
|
567
|
+
|
568
|
+
return args.rc;
|
569
|
+
}
|
570
|
+
|
571
|
+
|
572
|
+
static VALUE zkrb_gvl_zoo_set2(void *data) {
|
573
|
+
zkrb_zoo_set2_args_t *a = (zkrb_zoo_set2_args_t *)data;
|
574
|
+
a->rc = zoo_set2(a->zh, a->path, a->buffer, a->buflen, a->version, a->stat);
|
575
|
+
return Qnil;
|
576
|
+
}
|
577
|
+
|
578
|
+
// wrapper that calls zoo_set2 via zkrb_gvl_zoo_set2 inside rb_thread_blocking_region
|
579
|
+
int zkrb_call_zoo_set2(zhandle_t *zh, const char *path, const char *buffer, int buflen, int version, struct Stat *stat) {
|
580
|
+
zkrb_zoo_set2_args_t args = {
|
581
|
+
.rc = ZKRB_FAIL,
|
582
|
+
.zh = zh,
|
583
|
+
.path = path,
|
584
|
+
.buffer = buffer,
|
585
|
+
.buflen = buflen,
|
586
|
+
.version = version,
|
587
|
+
.stat = stat
|
588
|
+
};
|
589
|
+
|
590
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_set2, (void *)&args);
|
591
|
+
|
592
|
+
return args.rc;
|
593
|
+
}
|
594
|
+
|
595
|
+
|
596
|
+
static VALUE zkrb_gvl_zoo_get_children(void *data) {
|
597
|
+
zkrb_zoo_get_children_args_t *a = (zkrb_zoo_get_children_args_t *)data;
|
598
|
+
a->rc = zoo_get_children(a->zh, a->path, a->watch, a->strings);
|
599
|
+
return Qnil;
|
600
|
+
}
|
601
|
+
|
602
|
+
// wrapper that calls zoo_get_children via zkrb_gvl_zoo_get_children inside rb_thread_blocking_region
|
603
|
+
int zkrb_call_zoo_get_children(zhandle_t *zh, const char *path, int watch, struct String_vector *strings) {
|
604
|
+
zkrb_zoo_get_children_args_t args = {
|
605
|
+
.rc = ZKRB_FAIL,
|
606
|
+
.zh = zh,
|
607
|
+
.path = path,
|
608
|
+
.watch = watch,
|
609
|
+
.strings = strings
|
610
|
+
};
|
611
|
+
|
612
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_get_children, (void *)&args);
|
613
|
+
|
614
|
+
return args.rc;
|
615
|
+
}
|
616
|
+
|
617
|
+
|
618
|
+
static VALUE zkrb_gvl_zoo_wget_children(void *data) {
|
619
|
+
zkrb_zoo_wget_children_args_t *a = (zkrb_zoo_wget_children_args_t *)data;
|
620
|
+
a->rc = zoo_wget_children(a->zh, a->path, a->watcher, a->watcherCtx, a->strings);
|
621
|
+
return Qnil;
|
622
|
+
}
|
623
|
+
|
624
|
+
// wrapper that calls zoo_wget_children via zkrb_gvl_zoo_wget_children inside rb_thread_blocking_region
|
625
|
+
int zkrb_call_zoo_wget_children(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct String_vector *strings) {
|
626
|
+
zkrb_zoo_wget_children_args_t args = {
|
627
|
+
.rc = ZKRB_FAIL,
|
628
|
+
.zh = zh,
|
629
|
+
.path = path,
|
630
|
+
.watcher = watcher,
|
631
|
+
.watcherCtx = watcherCtx,
|
632
|
+
.strings = strings
|
633
|
+
};
|
634
|
+
|
635
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_wget_children, (void *)&args);
|
636
|
+
|
637
|
+
return args.rc;
|
638
|
+
}
|
639
|
+
|
640
|
+
|
641
|
+
static VALUE zkrb_gvl_zoo_get_children2(void *data) {
|
642
|
+
zkrb_zoo_get_children2_args_t *a = (zkrb_zoo_get_children2_args_t *)data;
|
643
|
+
a->rc = zoo_get_children2(a->zh, a->path, a->watch, a->strings, a->stat);
|
644
|
+
return Qnil;
|
645
|
+
}
|
646
|
+
|
647
|
+
// wrapper that calls zoo_get_children2 via zkrb_gvl_zoo_get_children2 inside rb_thread_blocking_region
|
648
|
+
int zkrb_call_zoo_get_children2(zhandle_t *zh, const char *path, int watch, struct String_vector *strings, struct Stat *stat) {
|
649
|
+
zkrb_zoo_get_children2_args_t args = {
|
650
|
+
.rc = ZKRB_FAIL,
|
651
|
+
.zh = zh,
|
652
|
+
.path = path,
|
653
|
+
.watch = watch,
|
654
|
+
.strings = strings,
|
655
|
+
.stat = stat
|
656
|
+
};
|
657
|
+
|
658
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_get_children2, (void *)&args);
|
659
|
+
|
660
|
+
return args.rc;
|
661
|
+
}
|
662
|
+
|
663
|
+
|
664
|
+
static VALUE zkrb_gvl_zoo_wget_children2(void *data) {
|
665
|
+
zkrb_zoo_wget_children2_args_t *a = (zkrb_zoo_wget_children2_args_t *)data;
|
666
|
+
a->rc = zoo_wget_children2(a->zh, a->path, a->watcher, a->watcherCtx, a->strings, a->stat);
|
667
|
+
return Qnil;
|
668
|
+
}
|
669
|
+
|
670
|
+
// wrapper that calls zoo_wget_children2 via zkrb_gvl_zoo_wget_children2 inside rb_thread_blocking_region
|
671
|
+
int zkrb_call_zoo_wget_children2(zhandle_t *zh, const char *path, watcher_fn watcher, void* watcherCtx, struct String_vector *strings, struct Stat *stat) {
|
672
|
+
zkrb_zoo_wget_children2_args_t args = {
|
673
|
+
.rc = ZKRB_FAIL,
|
674
|
+
.zh = zh,
|
675
|
+
.path = path,
|
676
|
+
.watcher = watcher,
|
677
|
+
.watcherCtx = watcherCtx,
|
678
|
+
.strings = strings,
|
679
|
+
.stat = stat
|
680
|
+
};
|
681
|
+
|
682
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_wget_children2, (void *)&args);
|
683
|
+
|
684
|
+
return args.rc;
|
685
|
+
}
|
686
|
+
|
687
|
+
|
688
|
+
static VALUE zkrb_gvl_zoo_get_acl(void *data) {
|
689
|
+
zkrb_zoo_get_acl_args_t *a = (zkrb_zoo_get_acl_args_t *)data;
|
690
|
+
a->rc = zoo_get_acl(a->zh, a->path, a->acl, a->stat);
|
691
|
+
return Qnil;
|
692
|
+
}
|
693
|
+
|
694
|
+
// wrapper that calls zoo_get_acl via zkrb_gvl_zoo_get_acl inside rb_thread_blocking_region
|
695
|
+
int zkrb_call_zoo_get_acl(zhandle_t *zh, const char *path, struct ACL_vector *acl, struct Stat *stat) {
|
696
|
+
zkrb_zoo_get_acl_args_t args = {
|
697
|
+
.rc = ZKRB_FAIL,
|
698
|
+
.zh = zh,
|
699
|
+
.path = path,
|
700
|
+
.acl = acl,
|
701
|
+
.stat = stat
|
702
|
+
};
|
703
|
+
|
704
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_get_acl, (void *)&args);
|
705
|
+
|
706
|
+
return args.rc;
|
707
|
+
}
|
708
|
+
|
709
|
+
|
710
|
+
static VALUE zkrb_gvl_zoo_set_acl(void *data) {
|
711
|
+
zkrb_zoo_set_acl_args_t *a = (zkrb_zoo_set_acl_args_t *)data;
|
712
|
+
a->rc = zoo_set_acl(a->zh, a->path, a->version, a->acl);
|
713
|
+
return Qnil;
|
714
|
+
}
|
715
|
+
|
716
|
+
// wrapper that calls zoo_set_acl via zkrb_gvl_zoo_set_acl inside rb_thread_blocking_region
|
717
|
+
int zkrb_call_zoo_set_acl(zhandle_t *zh, const char *path, int version, const struct ACL_vector *acl) {
|
718
|
+
zkrb_zoo_set_acl_args_t args = {
|
719
|
+
.rc = ZKRB_FAIL,
|
720
|
+
.zh = zh,
|
721
|
+
.path = path,
|
722
|
+
.version = version,
|
723
|
+
.acl = acl
|
724
|
+
};
|
725
|
+
|
726
|
+
zkrb_thread_blocking_region(zkrb_gvl_zoo_set_acl, (void *)&args);
|
727
|
+
|
728
|
+
return args.rc;
|
729
|
+
}
|
730
|
+
|
731
|
+
|