couchbase 1.2.0.z.beta4 → 1.2.0.z.beta5
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.markdown +9 -0
- data/ext/couchbase_ext/arguments.c +132 -128
- data/ext/couchbase_ext/arithmetic.c +25 -22
- data/ext/couchbase_ext/bucket.c +147 -114
- data/ext/couchbase_ext/couchbase_ext.c +419 -399
- data/ext/couchbase_ext/couchbase_ext.h +195 -189
- data/ext/couchbase_ext/delete.c +22 -19
- data/ext/couchbase_ext/extconf.rb +9 -2
- data/ext/couchbase_ext/get.c +32 -29
- data/ext/couchbase_ext/http.c +73 -59
- data/ext/couchbase_ext/observe.c +30 -27
- data/ext/couchbase_ext/result.c +13 -13
- data/ext/couchbase_ext/stats.c +22 -20
- data/ext/couchbase_ext/store.c +37 -30
- data/ext/couchbase_ext/timer.c +10 -10
- data/ext/couchbase_ext/touch.c +22 -19
- data/ext/couchbase_ext/unlock.c +22 -19
- data/ext/couchbase_ext/utils.c +78 -78
- data/ext/couchbase_ext/version.c +21 -18
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase/view.rb +18 -0
- data/tasks/compile.rake +1 -1
- data/tasks/test.rake +40 -33
- data/test/setup.rb +4 -0
- data/test/test_arithmetic.rb +37 -0
- metadata +6 -26
@@ -51,21 +51,21 @@ extern hrtime_t gethrtime(void);
|
|
51
51
|
#define va_init_list(a,b) va_start(a)
|
52
52
|
#endif
|
53
53
|
|
54
|
-
#define
|
54
|
+
#define cb_debug_object(OBJ) \
|
55
55
|
rb_funcall(rb_stderr, rb_intern("print"), 1, rb_funcall(OBJ, rb_intern("object_id"), 0)); \
|
56
56
|
rb_funcall(rb_stderr, rb_intern("print"), 1, STR_NEW_CSTR(" ")); \
|
57
57
|
rb_funcall(rb_stderr, rb_intern("print"), 1, rb_funcall(OBJ, rb_intern("class"), 0)); \
|
58
58
|
rb_funcall(rb_stderr, rb_intern("print"), 1, STR_NEW_CSTR(" ")); \
|
59
59
|
rb_funcall(rb_stderr, rb_intern("puts"), 1, rb_funcall(OBJ, rb_intern("inspect"), 0));
|
60
60
|
|
61
|
-
#define
|
62
|
-
#define
|
63
|
-
#define
|
64
|
-
#define
|
61
|
+
#define CB_FMT_MASK 0x3
|
62
|
+
#define CB_FMT_DOCUMENT 0x0
|
63
|
+
#define CB_FMT_MARSHAL 0x1
|
64
|
+
#define CB_FMT_PLAIN 0x2
|
65
65
|
|
66
|
-
#define
|
66
|
+
#define CB_PACKET_HEADER_SIZE 24
|
67
67
|
/* Structs */
|
68
|
-
struct
|
68
|
+
struct cb_bucket_st
|
69
69
|
{
|
70
70
|
lcb_t handle;
|
71
71
|
lcb_type_t type;
|
@@ -83,6 +83,8 @@ struct bucket_st
|
|
83
83
|
uint32_t default_flags;
|
84
84
|
time_t default_ttl;
|
85
85
|
time_t default_observe_timeout;
|
86
|
+
lcb_uint64_t default_arith_create; /* should the incr/decr create the key? if non-zero, will use arith_init */
|
87
|
+
lcb_uint64_t default_arith_init; /* default initial value for incr/decr */
|
86
88
|
uint32_t timeout;
|
87
89
|
size_t threshold; /* the number of bytes to trigger event loop, zero if don't care */
|
88
90
|
size_t nbytes; /* the number of bytes scheduled to be sent */
|
@@ -96,10 +98,10 @@ struct bucket_st
|
|
96
98
|
VALUE self; /* the pointer to bucket representation in ruby land */
|
97
99
|
};
|
98
100
|
|
99
|
-
struct
|
100
|
-
struct
|
101
|
+
struct cb_http_request_st;
|
102
|
+
struct cb_context_st
|
101
103
|
{
|
102
|
-
struct
|
104
|
+
struct cb_bucket_st* bucket;
|
103
105
|
int extended;
|
104
106
|
VALUE proc;
|
105
107
|
void *rv;
|
@@ -109,14 +111,15 @@ struct context_st
|
|
109
111
|
VALUE operation;
|
110
112
|
VALUE headers_val;
|
111
113
|
int headers_built;
|
112
|
-
struct
|
114
|
+
struct cb_http_request_st *request;
|
113
115
|
int quiet;
|
114
116
|
int arith; /* incr: +1, decr: -1, other: 0 */
|
117
|
+
int http_cancel_on_error;
|
115
118
|
size_t nqueries;
|
116
119
|
};
|
117
120
|
|
118
|
-
struct
|
119
|
-
struct
|
121
|
+
struct cb_http_request_st {
|
122
|
+
struct cb_bucket_st *bucket;
|
120
123
|
VALUE bucket_obj;
|
121
124
|
VALUE type;
|
122
125
|
int extended;
|
@@ -124,13 +127,13 @@ struct http_request_st {
|
|
124
127
|
int completed;
|
125
128
|
lcb_http_request_t request;
|
126
129
|
lcb_http_cmd_t cmd;
|
127
|
-
struct
|
130
|
+
struct cb_context_st *ctx;
|
128
131
|
VALUE on_body_callback;
|
129
132
|
};
|
130
133
|
|
131
|
-
struct
|
134
|
+
struct cb_timer_st
|
132
135
|
{
|
133
|
-
struct
|
136
|
+
struct cb_bucket_st *bucket;
|
134
137
|
int periodic;
|
135
138
|
uint32_t usec;
|
136
139
|
lcb_timer_t timer;
|
@@ -139,177 +142,179 @@ struct timer_st
|
|
139
142
|
};
|
140
143
|
|
141
144
|
/* Classes */
|
142
|
-
extern VALUE
|
143
|
-
extern VALUE
|
144
|
-
extern VALUE
|
145
|
-
extern VALUE
|
145
|
+
extern VALUE cb_cBucket;
|
146
|
+
extern VALUE cb_cCouchRequest;
|
147
|
+
extern VALUE cb_cResult;
|
148
|
+
extern VALUE cb_cTimer;
|
146
149
|
|
147
150
|
/* Modules */
|
148
|
-
extern VALUE
|
149
|
-
extern VALUE
|
150
|
-
extern VALUE
|
151
|
-
extern VALUE
|
152
|
-
extern VALUE
|
151
|
+
extern VALUE cb_mCouchbase;
|
152
|
+
extern VALUE cb_mError;
|
153
|
+
extern VALUE cb_mMarshal;
|
154
|
+
extern VALUE cb_mMultiJson;
|
155
|
+
extern VALUE cb_mURI;
|
153
156
|
|
154
157
|
/* Symbols */
|
155
|
-
extern ID
|
156
|
-
extern ID
|
157
|
-
extern ID
|
158
|
-
extern ID
|
159
|
-
extern ID
|
160
|
-
extern ID
|
161
|
-
extern ID
|
162
|
-
extern ID
|
163
|
-
extern ID
|
164
|
-
extern ID
|
165
|
-
extern ID
|
166
|
-
extern ID
|
167
|
-
extern ID
|
168
|
-
extern ID
|
169
|
-
extern ID
|
170
|
-
extern ID
|
171
|
-
extern ID
|
172
|
-
extern ID
|
173
|
-
extern ID
|
174
|
-
extern ID
|
175
|
-
extern ID
|
176
|
-
extern ID
|
177
|
-
extern ID
|
178
|
-
extern ID
|
179
|
-
extern ID
|
180
|
-
extern ID
|
181
|
-
extern ID
|
182
|
-
extern ID
|
183
|
-
extern ID
|
184
|
-
extern ID
|
185
|
-
extern ID
|
186
|
-
extern ID
|
187
|
-
extern ID
|
188
|
-
extern ID
|
189
|
-
extern ID
|
190
|
-
extern ID
|
191
|
-
extern ID
|
192
|
-
extern ID
|
193
|
-
extern ID
|
194
|
-
extern ID
|
195
|
-
extern ID
|
196
|
-
extern ID
|
197
|
-
extern ID
|
198
|
-
extern ID
|
199
|
-
extern ID
|
200
|
-
extern ID
|
201
|
-
extern ID
|
202
|
-
extern ID
|
203
|
-
extern ID
|
204
|
-
extern ID
|
205
|
-
extern ID
|
206
|
-
extern ID
|
207
|
-
extern ID
|
208
|
-
extern ID
|
209
|
-
extern ID
|
210
|
-
extern ID
|
211
|
-
extern ID
|
212
|
-
extern ID
|
213
|
-
extern ID
|
214
|
-
extern ID
|
215
|
-
extern ID
|
216
|
-
extern ID
|
217
|
-
extern ID
|
218
|
-
extern ID
|
219
|
-
extern ID
|
220
|
-
extern ID
|
221
|
-
extern ID
|
222
|
-
extern ID
|
223
|
-
extern ID
|
224
|
-
extern ID
|
225
|
-
extern ID
|
226
|
-
extern ID
|
227
|
-
extern ID
|
228
|
-
extern ID
|
229
|
-
extern ID
|
230
|
-
extern ID
|
231
|
-
extern ID
|
232
|
-
extern ID
|
233
|
-
extern ID
|
234
|
-
extern ID
|
235
|
-
extern ID
|
236
|
-
extern ID
|
237
|
-
extern ID
|
238
|
-
extern ID
|
239
|
-
extern ID
|
240
|
-
extern ID
|
241
|
-
extern ID
|
242
|
-
extern ID
|
243
|
-
extern ID
|
244
|
-
extern ID
|
245
|
-
extern ID
|
246
|
-
extern ID
|
247
|
-
extern ID
|
248
|
-
extern ID
|
249
|
-
extern ID
|
250
|
-
extern ID
|
158
|
+
extern ID cb_sym_add;
|
159
|
+
extern ID cb_sym_append;
|
160
|
+
extern ID cb_sym_assemble_hash;
|
161
|
+
extern ID cb_sym_body;
|
162
|
+
extern ID cb_sym_bucket;
|
163
|
+
extern ID cb_sym_cas;
|
164
|
+
extern ID cb_sym_chunked;
|
165
|
+
extern ID cb_sym_cluster;
|
166
|
+
extern ID cb_sym_content_type;
|
167
|
+
extern ID cb_sym_create;
|
168
|
+
extern ID cb_sym_decrement;
|
169
|
+
extern ID cb_sym_default_arithmetic_init;
|
170
|
+
extern ID cb_sym_default_flags;
|
171
|
+
extern ID cb_sym_default_format;
|
172
|
+
extern ID cb_sym_default_observe_timeout;
|
173
|
+
extern ID cb_sym_default_ttl;
|
174
|
+
extern ID cb_sym_delete;
|
175
|
+
extern ID cb_sym_delta;
|
176
|
+
extern ID cb_sym_development;
|
177
|
+
extern ID cb_sym_document;
|
178
|
+
extern ID cb_sym_environment;
|
179
|
+
extern ID cb_sym_extended;
|
180
|
+
extern ID cb_sym_flags;
|
181
|
+
extern ID cb_sym_format;
|
182
|
+
extern ID cb_sym_found;
|
183
|
+
extern ID cb_sym_get;
|
184
|
+
extern ID cb_sym_hostname;
|
185
|
+
extern ID cb_sym_http_request;
|
186
|
+
extern ID cb_sym_increment;
|
187
|
+
extern ID cb_sym_initial;
|
188
|
+
extern ID cb_sym_key_prefix;
|
189
|
+
extern ID cb_sym_lock;
|
190
|
+
extern ID cb_sym_management;
|
191
|
+
extern ID cb_sym_marshal;
|
192
|
+
extern ID cb_sym_method;
|
193
|
+
extern ID cb_sym_node_list;
|
194
|
+
extern ID cb_sym_not_found;
|
195
|
+
extern ID cb_sym_num_replicas;
|
196
|
+
extern ID cb_sym_observe;
|
197
|
+
extern ID cb_sym_password;
|
198
|
+
extern ID cb_sym_periodic;
|
199
|
+
extern ID cb_sym_persisted;
|
200
|
+
extern ID cb_sym_plain;
|
201
|
+
extern ID cb_sym_pool;
|
202
|
+
extern ID cb_sym_port;
|
203
|
+
extern ID cb_sym_post;
|
204
|
+
extern ID cb_sym_prepend;
|
205
|
+
extern ID cb_sym_production;
|
206
|
+
extern ID cb_sym_put;
|
207
|
+
extern ID cb_sym_quiet;
|
208
|
+
extern ID cb_sym_replace;
|
209
|
+
extern ID cb_sym_replica;
|
210
|
+
extern ID cb_sym_send_threshold;
|
211
|
+
extern ID cb_sym_set;
|
212
|
+
extern ID cb_sym_stats;
|
213
|
+
extern ID cb_sym_timeout;
|
214
|
+
extern ID cb_sym_touch;
|
215
|
+
extern ID cb_sym_ttl;
|
216
|
+
extern ID cb_sym_type;
|
217
|
+
extern ID cb_sym_unlock;
|
218
|
+
extern ID cb_sym_username;
|
219
|
+
extern ID cb_sym_version;
|
220
|
+
extern ID cb_sym_view;
|
221
|
+
extern ID cb_id_arity;
|
222
|
+
extern ID cb_id_call;
|
223
|
+
extern ID cb_id_delete;
|
224
|
+
extern ID cb_id_dump;
|
225
|
+
extern ID cb_id_dup;
|
226
|
+
extern ID cb_id_flatten_bang;
|
227
|
+
extern ID cb_id_has_key_p;
|
228
|
+
extern ID cb_id_host;
|
229
|
+
extern ID cb_id_iv_body;
|
230
|
+
extern ID cb_id_iv_cas;
|
231
|
+
extern ID cb_id_iv_completed;
|
232
|
+
extern ID cb_id_iv_error;
|
233
|
+
extern ID cb_id_iv_flags;
|
234
|
+
extern ID cb_id_iv_from_master;
|
235
|
+
extern ID cb_id_iv_headers;
|
236
|
+
extern ID cb_id_iv_inner_exception;
|
237
|
+
extern ID cb_id_iv_key;
|
238
|
+
extern ID cb_id_iv_node;
|
239
|
+
extern ID cb_id_iv_operation;
|
240
|
+
extern ID cb_id_iv_status;
|
241
|
+
extern ID cb_id_iv_time_to_persist;
|
242
|
+
extern ID cb_id_iv_time_to_replicate;
|
243
|
+
extern ID cb_id_iv_value;
|
244
|
+
extern ID cb_id_load;
|
245
|
+
extern ID cb_id_match;
|
246
|
+
extern ID cb_id_observe_and_wait;
|
247
|
+
extern ID cb_id_parse;
|
248
|
+
extern ID cb_id_parse_body_bang;
|
249
|
+
extern ID cb_id_password;
|
250
|
+
extern ID cb_id_path;
|
251
|
+
extern ID cb_id_port;
|
252
|
+
extern ID cb_id_scheme;
|
253
|
+
extern ID cb_id_sprintf;
|
254
|
+
extern ID cb_id_to_s;
|
255
|
+
extern ID cb_id_user;
|
256
|
+
extern ID cb_id_verify_observe_options;
|
251
257
|
|
252
258
|
/* Errors */
|
253
|
-
extern VALUE
|
254
|
-
extern VALUE
|
255
|
-
extern VALUE
|
259
|
+
extern VALUE cb_eBaseError;
|
260
|
+
extern VALUE cb_eValueFormatError;
|
261
|
+
extern VALUE cb_eHTTPError;
|
256
262
|
/* LCB_SUCCESS = 0x00 */
|
257
263
|
/* LCB_AUTH_CONTINUE = 0x01 */
|
258
|
-
extern VALUE
|
259
|
-
extern VALUE
|
260
|
-
extern VALUE
|
261
|
-
extern VALUE
|
262
|
-
extern VALUE
|
263
|
-
extern VALUE
|
264
|
-
extern VALUE
|
265
|
-
extern VALUE
|
266
|
-
extern VALUE
|
267
|
-
extern VALUE
|
268
|
-
extern VALUE
|
269
|
-
extern VALUE
|
270
|
-
extern VALUE
|
271
|
-
extern VALUE
|
272
|
-
extern VALUE
|
273
|
-
extern VALUE
|
274
|
-
extern VALUE
|
275
|
-
extern VALUE
|
276
|
-
extern VALUE
|
277
|
-
extern VALUE
|
278
|
-
extern VALUE
|
279
|
-
extern VALUE
|
280
|
-
extern VALUE
|
281
|
-
extern VALUE
|
282
|
-
extern VALUE
|
283
|
-
extern VALUE
|
284
|
-
extern VALUE
|
264
|
+
extern VALUE cb_eAuthError; /* LCB_AUTH_ERROR = 0x02 */
|
265
|
+
extern VALUE cb_eDeltaBadvalError; /* LCB_DELTA_BADVAL = 0x03 */
|
266
|
+
extern VALUE cb_eTooBigError; /* LCB_E2BIG = 0x04 */
|
267
|
+
extern VALUE cb_eBusyError; /* LCB_EBUSY = 0x05 */
|
268
|
+
extern VALUE cb_eInternalError; /* LCB_EINTERNAL = 0x06 */
|
269
|
+
extern VALUE cb_eInvalidError; /* LCB_EINVAL = 0x07 */
|
270
|
+
extern VALUE cb_eNoMemoryError; /* LCB_ENOMEM = 0x08 */
|
271
|
+
extern VALUE cb_eRangeError; /* LCB_ERANGE = 0x09 */
|
272
|
+
extern VALUE cb_eLibcouchbaseError; /* LCB_ERROR = 0x0a */
|
273
|
+
extern VALUE cb_eTmpFailError; /* LCB_ETMPFAIL = 0x0b */
|
274
|
+
extern VALUE cb_eKeyExistsError; /* LCB_KEY_EEXISTS = 0x0c */
|
275
|
+
extern VALUE cb_eNotFoundError; /* LCB_KEY_ENOENT = 0x0d */
|
276
|
+
extern VALUE cb_eDlopenFailedError; /* LCB_DLOPEN_FAILED = 0x0e */
|
277
|
+
extern VALUE cb_eDlsymFailedError; /* LCB_DLSYM_FAILED = 0x0f */
|
278
|
+
extern VALUE cb_eNetworkError; /* LCB_NETWORK_ERROR = 0x10 */
|
279
|
+
extern VALUE cb_eNotMyVbucketError; /* LCB_NOT_MY_VBUCKET = 0x11 */
|
280
|
+
extern VALUE cb_eNotStoredError; /* LCB_NOT_STORED = 0x12 */
|
281
|
+
extern VALUE cb_eNotSupportedError; /* LCB_NOT_SUPPORTED = 0x13 */
|
282
|
+
extern VALUE cb_eUnknownCommandError; /* LCB_UNKNOWN_COMMAND = 0x14 */
|
283
|
+
extern VALUE cb_eUnknownHostError; /* LCB_UNKNOWN_HOST = 0x15 */
|
284
|
+
extern VALUE cb_eProtocolError; /* LCB_PROTOCOL_ERROR = 0x16 */
|
285
|
+
extern VALUE cb_eTimeoutError; /* LCB_ETIMEDOUT = 0x17 */
|
286
|
+
extern VALUE cb_eConnectError; /* LCB_CONNECT_ERROR = 0x18 */
|
287
|
+
extern VALUE cb_eBucketNotFoundError; /* LCB_BUCKET_ENOENT = 0x19 */
|
288
|
+
extern VALUE cb_eClientNoMemoryError; /* LCB_CLIENT_ENOMEM = 0x1a */
|
289
|
+
extern VALUE cb_eClientTmpFailError; /* LCB_CLIENT_ETMPFAIL = 0x1b */
|
290
|
+
extern VALUE cb_eBadHandleError; /* LCB_EBADHANDLE = 0x1c */
|
285
291
|
|
286
|
-
void
|
292
|
+
void cb_strip_key_prefix(struct cb_bucket_st *bucket, VALUE key);
|
287
293
|
VALUE cb_check_error(lcb_error_t rc, const char *msg, VALUE key);
|
288
294
|
VALUE cb_check_error_with_status(lcb_error_t rc, const char *msg, VALUE key, lcb_http_status_t status);
|
289
|
-
VALUE cb_gc_protect(struct
|
290
|
-
VALUE cb_gc_unprotect(struct
|
295
|
+
VALUE cb_gc_protect(struct cb_bucket_st *bucket, VALUE val);
|
296
|
+
VALUE cb_gc_unprotect(struct cb_bucket_st *bucket, VALUE val);
|
291
297
|
VALUE cb_proc_call(VALUE recv, int argc, ...);
|
292
298
|
int cb_first_value_i(VALUE key, VALUE value, VALUE arg);
|
293
|
-
void cb_build_headers(struct
|
294
|
-
void
|
295
|
-
VALUE
|
296
|
-
VALUE
|
297
|
-
VALUE
|
298
|
-
uint32_t
|
299
|
-
ID
|
300
|
-
|
301
|
-
void storage_callback(lcb_t handle, const void *cookie, lcb_storage_t operation, lcb_error_t error, const lcb_store_resp_t *resp);
|
302
|
-
void get_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_get_resp_t *resp);
|
303
|
-
void touch_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp);
|
304
|
-
void delete_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_remove_resp_t *resp);
|
305
|
-
void stat_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp);
|
306
|
-
void arithmetic_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_arithmetic_resp_t *resp);
|
307
|
-
void version_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_version_resp_t *resp);
|
308
|
-
void http_complete_callback(lcb_http_request_t request, lcb_t handle, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp);
|
309
|
-
void http_data_callback(lcb_http_request_t request, lcb_t handle, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp);
|
310
|
-
void observe_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_observe_resp_t *resp);
|
311
|
-
void unlock_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp);
|
299
|
+
void cb_build_headers(struct cb_context_st *ctx, const char * const *headers);
|
300
|
+
void cb_maybe_do_loop(struct cb_bucket_st *bucket);
|
301
|
+
VALUE cb_unify_key(struct cb_bucket_st *bucket, VALUE key, int apply_prefix);
|
302
|
+
VALUE cb_encode_value(VALUE val, uint32_t flags);
|
303
|
+
VALUE cb_decode_value(VALUE blob, uint32_t flags, VALUE force_format);
|
304
|
+
uint32_t cb_flags_set_format(uint32_t flags, ID format);
|
305
|
+
ID cb_flags_get_format(uint32_t flags);
|
312
306
|
|
307
|
+
void cb_storage_callback(lcb_t handle, const void *cookie, lcb_storage_t operation, lcb_error_t error, const lcb_store_resp_t *resp);
|
308
|
+
void cb_get_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_get_resp_t *resp);
|
309
|
+
void cb_touch_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp);
|
310
|
+
void cb_delete_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_remove_resp_t *resp);
|
311
|
+
void cb_stat_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp);
|
312
|
+
void cb_arithmetic_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_arithmetic_resp_t *resp);
|
313
|
+
void cb_version_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_version_resp_t *resp);
|
314
|
+
void cb_http_complete_callback(lcb_http_request_t request, lcb_t handle, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp);
|
315
|
+
void cb_http_data_callback(lcb_http_request_t request, lcb_t handle, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp);
|
316
|
+
void cb_observe_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_observe_resp_t *resp);
|
317
|
+
void cb_unlock_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp);
|
313
318
|
|
314
319
|
VALUE cb_bucket_alloc(VALUE klass);
|
315
320
|
void cb_bucket_free(void *ptr);
|
@@ -362,6 +367,8 @@ VALUE cb_bucket_environment_get(VALUE self);
|
|
362
367
|
VALUE cb_bucket_num_replicas_get(VALUE self);
|
363
368
|
VALUE cb_bucket_default_observe_timeout_get(VALUE self);
|
364
369
|
VALUE cb_bucket_default_observe_timeout_set(VALUE self, VALUE val);
|
370
|
+
VALUE cb_bucket_default_arithmetic_init_get(VALUE self);
|
371
|
+
VALUE cb_bucket_default_arithmetic_init_set(VALUE self, VALUE val);
|
365
372
|
|
366
373
|
VALUE cb_http_request_alloc(VALUE klass);
|
367
374
|
VALUE cb_http_request_init(int argc, VALUE *argv, VALUE self);
|
@@ -384,21 +391,21 @@ VALUE cb_timer_init(int argc, VALUE *argv, VALUE self);
|
|
384
391
|
|
385
392
|
/* Method arguments */
|
386
393
|
|
387
|
-
enum
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
394
|
+
enum cb_command_t {
|
395
|
+
cb_cmd_touch = 0x01,
|
396
|
+
cb_cmd_remove = 0x02,
|
397
|
+
cb_cmd_store = 0x03,
|
398
|
+
cb_cmd_get = 0x04,
|
399
|
+
cb_cmd_arith = 0x05,
|
400
|
+
cb_cmd_stats = 0x06,
|
401
|
+
cb_cmd_version = 0x08,
|
402
|
+
cb_cmd_observe = 0x09,
|
403
|
+
cb_cmd_unlock = 0x10
|
397
404
|
};
|
398
405
|
|
399
|
-
struct
|
406
|
+
struct cb_params_st
|
400
407
|
{
|
401
|
-
enum
|
408
|
+
enum cb_command_t type;
|
402
409
|
union {
|
403
410
|
struct {
|
404
411
|
/* number of items */
|
@@ -514,16 +521,15 @@ struct params_st
|
|
514
521
|
lcb_cas_t cas;
|
515
522
|
} unlock;
|
516
523
|
} cmd;
|
517
|
-
struct
|
524
|
+
struct cb_bucket_st *bucket;
|
518
525
|
/* helper index for iterators */
|
519
526
|
size_t idx;
|
520
527
|
/* the approximate size of the data to be sent */
|
521
528
|
size_t npayload;
|
522
529
|
};
|
523
530
|
|
524
|
-
void cb_params_destroy(struct
|
525
|
-
void cb_params_build(struct
|
526
|
-
|
531
|
+
void cb_params_destroy(struct cb_params_st *params);
|
532
|
+
void cb_params_build(struct cb_params_st *params, int argc, VALUE argv);
|
527
533
|
|
528
534
|
#endif
|
529
535
|
|