couchbase 1.2.0.beta-x86-mingw32 → 1.2.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/Makefile +3 -0
- data/README.markdown +15 -4
- data/RELEASE_NOTES.markdown +513 -0
- data/couchbase.gemspec +0 -1
- data/ext/couchbase_ext/arguments.c +161 -244
- data/ext/couchbase_ext/arithmetic.c +29 -37
- data/ext/couchbase_ext/bucket.c +252 -219
- data/ext/couchbase_ext/couchbase_ext.c +540 -417
- data/ext/couchbase_ext/couchbase_ext.h +218 -191
- data/ext/couchbase_ext/delete.c +30 -27
- data/ext/couchbase_ext/extconf.rb +15 -3
- data/ext/couchbase_ext/get.c +45 -37
- data/ext/couchbase_ext/http.c +95 -74
- data/ext/couchbase_ext/multithread_plugin.c +1201 -0
- data/ext/couchbase_ext/observe.c +42 -37
- data/ext/couchbase_ext/result.c +17 -20
- data/ext/couchbase_ext/stats.c +30 -28
- data/ext/couchbase_ext/store.c +46 -39
- data/ext/couchbase_ext/timer.c +11 -11
- data/ext/couchbase_ext/touch.c +30 -27
- data/ext/couchbase_ext/unlock.c +30 -27
- data/ext/couchbase_ext/utils.c +166 -89
- data/ext/couchbase_ext/version.c +29 -26
- data/lib/action_dispatch/middleware/session/couchbase_store.rb +2 -2
- data/lib/active_support/cache/couchbase_store.rb +6 -6
- data/lib/couchbase.rb +1 -0
- data/lib/couchbase/bucket.rb +6 -11
- data/lib/couchbase/cluster.rb +105 -0
- data/lib/couchbase/utils.rb +8 -5
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase/view.rb +51 -5
- data/lib/couchbase/view_row.rb +1 -1
- data/lib/ext/multi_json_fix.rb +13 -9
- data/lib/rack/session/couchbase.rb +11 -7
- data/tasks/compile.rake +1 -1
- data/tasks/test.rake +40 -34
- data/tasks/util.rake +1 -1
- data/test/setup.rb +9 -2
- data/test/test_arithmetic.rb +37 -0
- data/test/test_async.rb +22 -18
- data/test/test_unlock.rb +0 -1
- data/test/test_utils.rb +32 -0
- metadata +13 -23
- data/HISTORY.markdown +0 -215
@@ -23,6 +23,9 @@
|
|
23
23
|
#endif
|
24
24
|
|
25
25
|
#include "couchbase_config.h"
|
26
|
+
#ifdef HAVE_STDINT_H
|
27
|
+
#include <stdint.h>
|
28
|
+
#endif
|
26
29
|
#ifndef HAVE_GETHRTIME
|
27
30
|
typedef uint64_t hrtime_t;
|
28
31
|
extern hrtime_t gethrtime(void);
|
@@ -48,54 +51,60 @@ extern hrtime_t gethrtime(void);
|
|
48
51
|
#define va_init_list(a,b) va_start(a)
|
49
52
|
#endif
|
50
53
|
|
51
|
-
#
|
54
|
+
#ifndef HAVE_RB_HASH_LOOKUP2
|
55
|
+
VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
|
56
|
+
#endif
|
57
|
+
|
58
|
+
#define cb_debug_object(OBJ) \
|
52
59
|
rb_funcall(rb_stderr, rb_intern("print"), 1, rb_funcall(OBJ, rb_intern("object_id"), 0)); \
|
53
60
|
rb_funcall(rb_stderr, rb_intern("print"), 1, STR_NEW_CSTR(" ")); \
|
54
61
|
rb_funcall(rb_stderr, rb_intern("print"), 1, rb_funcall(OBJ, rb_intern("class"), 0)); \
|
55
62
|
rb_funcall(rb_stderr, rb_intern("print"), 1, STR_NEW_CSTR(" ")); \
|
56
63
|
rb_funcall(rb_stderr, rb_intern("puts"), 1, rb_funcall(OBJ, rb_intern("inspect"), 0));
|
57
64
|
|
58
|
-
#define
|
59
|
-
#define
|
60
|
-
#define
|
61
|
-
#define
|
65
|
+
#define CB_FMT_MASK 0x3
|
66
|
+
#define CB_FMT_DOCUMENT 0x0
|
67
|
+
#define CB_FMT_MARSHAL 0x1
|
68
|
+
#define CB_FMT_PLAIN 0x2
|
62
69
|
|
63
|
-
#define
|
70
|
+
#define CB_PACKET_HEADER_SIZE 24
|
64
71
|
/* Structs */
|
65
|
-
struct
|
72
|
+
struct cb_bucket_st
|
66
73
|
{
|
67
74
|
lcb_t handle;
|
75
|
+
lcb_type_t type;
|
68
76
|
struct lcb_io_opt_st *io;
|
69
77
|
uint16_t port;
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
78
|
+
VALUE authority;
|
79
|
+
VALUE hostname;
|
80
|
+
VALUE pool;
|
81
|
+
VALUE bucket;
|
82
|
+
VALUE username;
|
83
|
+
VALUE password;
|
76
84
|
int async;
|
77
85
|
int quiet;
|
78
86
|
VALUE default_format; /* should update +default_flags+ on change */
|
79
87
|
uint32_t default_flags;
|
80
88
|
time_t default_ttl;
|
81
89
|
time_t default_observe_timeout;
|
90
|
+
lcb_uint64_t default_arith_create; /* should the incr/decr create the key? if non-zero, will use arith_init */
|
91
|
+
lcb_uint64_t default_arith_init; /* default initial value for incr/decr */
|
82
92
|
uint32_t timeout;
|
83
93
|
size_t threshold; /* the number of bytes to trigger event loop, zero if don't care */
|
84
94
|
size_t nbytes; /* the number of bytes scheduled to be sent */
|
85
95
|
VALUE exception; /* error delivered by error_callback */
|
86
96
|
VALUE on_error_proc; /* is using to deliver errors in async mode */
|
87
97
|
VALUE environment; /* sym_development or sym_production */
|
88
|
-
char *key_prefix;
|
89
98
|
VALUE key_prefix_val;
|
90
|
-
|
99
|
+
VALUE node_list;
|
91
100
|
VALUE object_space;
|
92
101
|
VALUE self; /* the pointer to bucket representation in ruby land */
|
93
102
|
};
|
94
103
|
|
95
|
-
struct
|
96
|
-
struct
|
104
|
+
struct cb_http_request_st;
|
105
|
+
struct cb_context_st
|
97
106
|
{
|
98
|
-
struct
|
107
|
+
struct cb_bucket_st* bucket;
|
99
108
|
int extended;
|
100
109
|
VALUE proc;
|
101
110
|
void *rv;
|
@@ -105,14 +114,15 @@ struct context_st
|
|
105
114
|
VALUE operation;
|
106
115
|
VALUE headers_val;
|
107
116
|
int headers_built;
|
108
|
-
struct
|
117
|
+
struct cb_http_request_st *request;
|
109
118
|
int quiet;
|
110
119
|
int arith; /* incr: +1, decr: -1, other: 0 */
|
120
|
+
int http_cancel_on_error;
|
111
121
|
size_t nqueries;
|
112
122
|
};
|
113
123
|
|
114
|
-
struct
|
115
|
-
struct
|
124
|
+
struct cb_http_request_st {
|
125
|
+
struct cb_bucket_st *bucket;
|
116
126
|
VALUE bucket_obj;
|
117
127
|
VALUE type;
|
118
128
|
int extended;
|
@@ -120,13 +130,13 @@ struct http_request_st {
|
|
120
130
|
int completed;
|
121
131
|
lcb_http_request_t request;
|
122
132
|
lcb_http_cmd_t cmd;
|
123
|
-
struct
|
133
|
+
struct cb_context_st *ctx;
|
124
134
|
VALUE on_body_callback;
|
125
135
|
};
|
126
136
|
|
127
|
-
struct
|
137
|
+
struct cb_timer_st
|
128
138
|
{
|
129
|
-
struct
|
139
|
+
struct cb_bucket_st *bucket;
|
130
140
|
int periodic;
|
131
141
|
uint32_t usec;
|
132
142
|
lcb_timer_t timer;
|
@@ -135,171 +145,185 @@ struct timer_st
|
|
135
145
|
};
|
136
146
|
|
137
147
|
/* Classes */
|
138
|
-
extern VALUE
|
139
|
-
extern VALUE
|
140
|
-
extern VALUE
|
141
|
-
extern VALUE
|
148
|
+
extern VALUE cb_cBucket;
|
149
|
+
extern VALUE cb_cCouchRequest;
|
150
|
+
extern VALUE cb_cResult;
|
151
|
+
extern VALUE cb_cTimer;
|
142
152
|
|
143
153
|
/* Modules */
|
144
|
-
extern VALUE
|
145
|
-
extern VALUE
|
146
|
-
extern VALUE
|
147
|
-
extern VALUE
|
148
|
-
extern VALUE
|
154
|
+
extern VALUE cb_mCouchbase;
|
155
|
+
extern VALUE cb_mError;
|
156
|
+
extern VALUE cb_mMarshal;
|
157
|
+
extern VALUE cb_mMultiJson;
|
158
|
+
extern VALUE cb_mURI;
|
149
159
|
|
150
160
|
/* Symbols */
|
151
|
-
extern ID
|
152
|
-
extern ID
|
153
|
-
extern ID
|
154
|
-
extern ID
|
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
|
161
|
+
extern ID cb_sym_add;
|
162
|
+
extern ID cb_sym_append;
|
163
|
+
extern ID cb_sym_assemble_hash;
|
164
|
+
extern ID cb_sym_body;
|
165
|
+
extern ID cb_sym_bucket;
|
166
|
+
extern ID cb_sym_cas;
|
167
|
+
extern ID cb_sym_chunked;
|
168
|
+
extern ID cb_sym_cluster;
|
169
|
+
extern ID cb_sym_content_type;
|
170
|
+
extern ID cb_sym_create;
|
171
|
+
extern ID cb_sym_decrement;
|
172
|
+
extern ID cb_sym_default_arithmetic_init;
|
173
|
+
extern ID cb_sym_default_flags;
|
174
|
+
extern ID cb_sym_default_format;
|
175
|
+
extern ID cb_sym_default_observe_timeout;
|
176
|
+
extern ID cb_sym_default_ttl;
|
177
|
+
extern ID cb_sym_delete;
|
178
|
+
extern ID cb_sym_delta;
|
179
|
+
extern ID cb_sym_development;
|
180
|
+
extern ID cb_sym_document;
|
181
|
+
extern ID cb_sym_environment;
|
182
|
+
extern ID cb_sym_extended;
|
183
|
+
extern ID cb_sym_flags;
|
184
|
+
extern ID cb_sym_format;
|
185
|
+
extern ID cb_sym_found;
|
186
|
+
extern ID cb_sym_get;
|
187
|
+
extern ID cb_sym_hostname;
|
188
|
+
extern ID cb_sym_http_request;
|
189
|
+
extern ID cb_sym_increment;
|
190
|
+
extern ID cb_sym_initial;
|
191
|
+
extern ID cb_sym_key_prefix;
|
192
|
+
extern ID cb_sym_lock;
|
193
|
+
extern ID cb_sym_management;
|
194
|
+
extern ID cb_sym_marshal;
|
195
|
+
extern ID cb_sym_method;
|
196
|
+
extern ID cb_sym_node_list;
|
197
|
+
extern ID cb_sym_not_found;
|
198
|
+
extern ID cb_sym_num_replicas;
|
199
|
+
extern ID cb_sym_observe;
|
200
|
+
extern ID cb_sym_password;
|
201
|
+
extern ID cb_sym_periodic;
|
202
|
+
extern ID cb_sym_persisted;
|
203
|
+
extern ID cb_sym_plain;
|
204
|
+
extern ID cb_sym_pool;
|
205
|
+
extern ID cb_sym_port;
|
206
|
+
extern ID cb_sym_post;
|
207
|
+
extern ID cb_sym_prepend;
|
208
|
+
extern ID cb_sym_production;
|
209
|
+
extern ID cb_sym_put;
|
210
|
+
extern ID cb_sym_quiet;
|
211
|
+
extern ID cb_sym_replace;
|
212
|
+
extern ID cb_sym_replica;
|
213
|
+
extern ID cb_sym_send_threshold;
|
214
|
+
extern ID cb_sym_set;
|
215
|
+
extern ID cb_sym_stats;
|
216
|
+
extern ID cb_sym_timeout;
|
217
|
+
extern ID cb_sym_touch;
|
218
|
+
extern ID cb_sym_ttl;
|
219
|
+
extern ID cb_sym_type;
|
220
|
+
extern ID cb_sym_unlock;
|
221
|
+
extern ID cb_sym_username;
|
222
|
+
extern ID cb_sym_version;
|
223
|
+
extern ID cb_sym_view;
|
224
|
+
extern ID cb_id_arity;
|
225
|
+
extern ID cb_id_call;
|
226
|
+
extern ID cb_id_delete;
|
227
|
+
extern ID cb_id_dump;
|
228
|
+
extern ID cb_id_dup;
|
229
|
+
extern ID cb_id_flatten_bang;
|
230
|
+
extern ID cb_id_has_key_p;
|
231
|
+
extern ID cb_id_host;
|
232
|
+
extern ID cb_id_iv_body;
|
233
|
+
extern ID cb_id_iv_cas;
|
234
|
+
extern ID cb_id_iv_completed;
|
235
|
+
extern ID cb_id_iv_error;
|
236
|
+
extern ID cb_id_iv_flags;
|
237
|
+
extern ID cb_id_iv_from_master;
|
238
|
+
extern ID cb_id_iv_headers;
|
239
|
+
extern ID cb_id_iv_inner_exception;
|
240
|
+
extern ID cb_id_iv_key;
|
241
|
+
extern ID cb_id_iv_node;
|
242
|
+
extern ID cb_id_iv_operation;
|
243
|
+
extern ID cb_id_iv_status;
|
244
|
+
extern ID cb_id_iv_time_to_persist;
|
245
|
+
extern ID cb_id_iv_time_to_replicate;
|
246
|
+
extern ID cb_id_iv_value;
|
247
|
+
extern ID cb_id_load;
|
248
|
+
extern ID cb_id_match;
|
249
|
+
extern ID cb_id_observe_and_wait;
|
250
|
+
extern ID cb_id_parse;
|
251
|
+
extern ID cb_id_parse_body_bang;
|
252
|
+
extern ID cb_id_password;
|
253
|
+
extern ID cb_id_path;
|
254
|
+
extern ID cb_id_port;
|
255
|
+
extern ID cb_id_scheme;
|
256
|
+
extern ID cb_id_sprintf;
|
257
|
+
extern ID cb_id_to_s;
|
258
|
+
extern ID cb_id_user;
|
259
|
+
extern ID cb_id_verify_observe_options;
|
244
260
|
|
245
261
|
/* Errors */
|
246
|
-
extern VALUE
|
247
|
-
extern VALUE
|
262
|
+
extern VALUE cb_eBaseError;
|
263
|
+
extern VALUE cb_eValueFormatError;
|
264
|
+
extern VALUE cb_eHTTPError;
|
248
265
|
/* LCB_SUCCESS = 0x00 */
|
249
266
|
/* LCB_AUTH_CONTINUE = 0x01 */
|
250
|
-
extern VALUE
|
251
|
-
extern VALUE
|
252
|
-
extern VALUE
|
253
|
-
extern VALUE
|
254
|
-
extern VALUE
|
255
|
-
extern VALUE
|
256
|
-
extern VALUE
|
257
|
-
extern VALUE
|
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
|
267
|
+
extern VALUE cb_eAuthError; /* LCB_AUTH_ERROR = 0x02 */
|
268
|
+
extern VALUE cb_eDeltaBadvalError; /* LCB_DELTA_BADVAL = 0x03 */
|
269
|
+
extern VALUE cb_eTooBigError; /* LCB_E2BIG = 0x04 */
|
270
|
+
extern VALUE cb_eBusyError; /* LCB_EBUSY = 0x05 */
|
271
|
+
extern VALUE cb_eInternalError; /* LCB_EINTERNAL = 0x06 */
|
272
|
+
extern VALUE cb_eInvalidError; /* LCB_EINVAL = 0x07 */
|
273
|
+
extern VALUE cb_eNoMemoryError; /* LCB_ENOMEM = 0x08 */
|
274
|
+
extern VALUE cb_eRangeError; /* LCB_ERANGE = 0x09 */
|
275
|
+
extern VALUE cb_eLibcouchbaseError; /* LCB_ERROR = 0x0a */
|
276
|
+
extern VALUE cb_eTmpFailError; /* LCB_ETMPFAIL = 0x0b */
|
277
|
+
extern VALUE cb_eKeyExistsError; /* LCB_KEY_EEXISTS = 0x0c */
|
278
|
+
extern VALUE cb_eNotFoundError; /* LCB_KEY_ENOENT = 0x0d */
|
279
|
+
extern VALUE cb_eDlopenFailedError; /* LCB_DLOPEN_FAILED = 0x0e */
|
280
|
+
extern VALUE cb_eDlsymFailedError; /* LCB_DLSYM_FAILED = 0x0f */
|
281
|
+
extern VALUE cb_eNetworkError; /* LCB_NETWORK_ERROR = 0x10 */
|
282
|
+
extern VALUE cb_eNotMyVbucketError; /* LCB_NOT_MY_VBUCKET = 0x11 */
|
283
|
+
extern VALUE cb_eNotStoredError; /* LCB_NOT_STORED = 0x12 */
|
284
|
+
extern VALUE cb_eNotSupportedError; /* LCB_NOT_SUPPORTED = 0x13 */
|
285
|
+
extern VALUE cb_eUnknownCommandError; /* LCB_UNKNOWN_COMMAND = 0x14 */
|
286
|
+
extern VALUE cb_eUnknownHostError; /* LCB_UNKNOWN_HOST = 0x15 */
|
287
|
+
extern VALUE cb_eProtocolError; /* LCB_PROTOCOL_ERROR = 0x16 */
|
288
|
+
extern VALUE cb_eTimeoutError; /* LCB_ETIMEDOUT = 0x17 */
|
289
|
+
extern VALUE cb_eConnectError; /* LCB_CONNECT_ERROR = 0x18 */
|
290
|
+
extern VALUE cb_eBucketNotFoundError; /* LCB_BUCKET_ENOENT = 0x19 */
|
291
|
+
extern VALUE cb_eClientNoMemoryError; /* LCB_CLIENT_ENOMEM = 0x1a */
|
292
|
+
extern VALUE cb_eClientTmpFailError; /* LCB_CLIENT_ETMPFAIL = 0x1b */
|
293
|
+
extern VALUE cb_eBadHandleError; /* LCB_EBADHANDLE = 0x1c */
|
294
|
+
|
295
|
+
/* Default Strings */
|
296
|
+
extern VALUE cb_vStrDefault;
|
297
|
+
extern VALUE cb_vStrEmpty;
|
275
298
|
|
276
|
-
void
|
299
|
+
void cb_strip_key_prefix(struct cb_bucket_st *bucket, VALUE key);
|
277
300
|
VALUE cb_check_error(lcb_error_t rc, const char *msg, VALUE key);
|
278
301
|
VALUE cb_check_error_with_status(lcb_error_t rc, const char *msg, VALUE key, lcb_http_status_t status);
|
279
|
-
VALUE cb_gc_protect(struct
|
280
|
-
VALUE cb_gc_unprotect(struct
|
281
|
-
VALUE cb_proc_call(VALUE recv, int argc, ...);
|
302
|
+
VALUE cb_gc_protect(struct cb_bucket_st *bucket, VALUE val);
|
303
|
+
VALUE cb_gc_unprotect(struct cb_bucket_st *bucket, VALUE val);
|
304
|
+
VALUE cb_proc_call(struct cb_bucket_st *bucket, VALUE recv, int argc, ...);
|
282
305
|
int cb_first_value_i(VALUE key, VALUE value, VALUE arg);
|
283
|
-
void cb_build_headers(struct
|
284
|
-
void
|
285
|
-
VALUE
|
286
|
-
VALUE
|
287
|
-
VALUE
|
288
|
-
uint32_t
|
289
|
-
ID
|
306
|
+
void cb_build_headers(struct cb_context_st *ctx, const char * const *headers);
|
307
|
+
void cb_maybe_do_loop(struct cb_bucket_st *bucket);
|
308
|
+
VALUE cb_unify_key(struct cb_bucket_st *bucket, VALUE key, int apply_prefix);
|
309
|
+
VALUE cb_encode_value(VALUE val, uint32_t flags);
|
310
|
+
VALUE cb_decode_value(VALUE blob, uint32_t flags, VALUE force_format);
|
311
|
+
uint32_t cb_flags_set_format(uint32_t flags, ID format);
|
312
|
+
ID cb_flags_get_format(uint32_t flags);
|
313
|
+
void cb_async_error_notify(struct cb_bucket_st *bucket, VALUE exc);
|
290
314
|
|
291
|
-
void storage_callback(lcb_t handle, const void *cookie, lcb_storage_t operation, lcb_error_t error, const lcb_store_resp_t *resp);
|
292
|
-
void get_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_get_resp_t *resp);
|
293
|
-
void touch_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp);
|
294
|
-
void delete_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_remove_resp_t *resp);
|
295
|
-
void stat_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp);
|
296
|
-
void arithmetic_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_arithmetic_resp_t *resp);
|
297
|
-
void version_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_version_resp_t *resp);
|
298
|
-
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);
|
299
|
-
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);
|
300
|
-
void observe_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_observe_resp_t *resp);
|
301
|
-
void unlock_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp);
|
302
315
|
|
316
|
+
void cb_storage_callback(lcb_t handle, const void *cookie, lcb_storage_t operation, lcb_error_t error, const lcb_store_resp_t *resp);
|
317
|
+
void cb_get_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_get_resp_t *resp);
|
318
|
+
void cb_touch_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp);
|
319
|
+
void cb_delete_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_remove_resp_t *resp);
|
320
|
+
void cb_stat_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp);
|
321
|
+
void cb_arithmetic_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_arithmetic_resp_t *resp);
|
322
|
+
void cb_version_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_version_resp_t *resp);
|
323
|
+
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);
|
324
|
+
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);
|
325
|
+
void cb_observe_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_observe_resp_t *resp);
|
326
|
+
void cb_unlock_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp);
|
303
327
|
|
304
328
|
VALUE cb_bucket_alloc(VALUE klass);
|
305
329
|
void cb_bucket_free(void *ptr);
|
@@ -352,6 +376,8 @@ VALUE cb_bucket_environment_get(VALUE self);
|
|
352
376
|
VALUE cb_bucket_num_replicas_get(VALUE self);
|
353
377
|
VALUE cb_bucket_default_observe_timeout_get(VALUE self);
|
354
378
|
VALUE cb_bucket_default_observe_timeout_set(VALUE self, VALUE val);
|
379
|
+
VALUE cb_bucket_default_arithmetic_init_get(VALUE self);
|
380
|
+
VALUE cb_bucket_default_arithmetic_init_set(VALUE self, VALUE val);
|
355
381
|
|
356
382
|
VALUE cb_http_request_alloc(VALUE klass);
|
357
383
|
VALUE cb_http_request_init(int argc, VALUE *argv, VALUE self);
|
@@ -374,21 +400,21 @@ VALUE cb_timer_init(int argc, VALUE *argv, VALUE self);
|
|
374
400
|
|
375
401
|
/* Method arguments */
|
376
402
|
|
377
|
-
enum
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
403
|
+
enum cb_command_t {
|
404
|
+
cb_cmd_touch = 0x01,
|
405
|
+
cb_cmd_remove = 0x02,
|
406
|
+
cb_cmd_store = 0x03,
|
407
|
+
cb_cmd_get = 0x04,
|
408
|
+
cb_cmd_arith = 0x05,
|
409
|
+
cb_cmd_stats = 0x06,
|
410
|
+
cb_cmd_version = 0x08,
|
411
|
+
cb_cmd_observe = 0x09,
|
412
|
+
cb_cmd_unlock = 0x10
|
387
413
|
};
|
388
414
|
|
389
|
-
struct
|
415
|
+
struct cb_params_st
|
390
416
|
{
|
391
|
-
enum
|
417
|
+
enum cb_command_t type;
|
392
418
|
union {
|
393
419
|
struct {
|
394
420
|
/* number of items */
|
@@ -504,16 +530,17 @@ struct params_st
|
|
504
530
|
lcb_cas_t cas;
|
505
531
|
} unlock;
|
506
532
|
} cmd;
|
507
|
-
struct
|
533
|
+
struct cb_bucket_st *bucket;
|
508
534
|
/* helper index for iterators */
|
509
535
|
size_t idx;
|
510
536
|
/* the approximate size of the data to be sent */
|
511
537
|
size_t npayload;
|
512
538
|
};
|
513
539
|
|
514
|
-
void cb_params_destroy(struct
|
515
|
-
void cb_params_build(struct
|
516
|
-
|
540
|
+
void cb_params_destroy(struct cb_params_st *params);
|
541
|
+
void cb_params_build(struct cb_params_st *params, int argc, VALUE argv);
|
517
542
|
|
543
|
+
LIBCOUCHBASE_API
|
544
|
+
lcb_error_t cb_create_ruby_mt_io_opts(int version, lcb_io_opt_t *io, void *arg);
|
518
545
|
#endif
|
519
546
|
|