libcouchbase 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/libcouchbase/.gitignore +2 -0
- data/ext/libcouchbase/CMakeLists.txt +5 -7
- data/ext/libcouchbase/README.markdown +2 -2
- data/ext/libcouchbase/RELEASE_NOTES.markdown +49 -0
- data/ext/libcouchbase/cmake/Modules/ConfigureDtrace.cmake +11 -0
- data/ext/libcouchbase/cmake/Modules/GenerateConfigDotH.cmake +2 -0
- data/ext/libcouchbase/cmake/Modules/GetLibcouchbaseFlags.cmake +2 -1
- data/ext/libcouchbase/cmake/Modules/GetVersionInfo.cmake +3 -3
- data/ext/libcouchbase/cmake/config-cmake.h.in +2 -0
- data/ext/libcouchbase/cmake/defs.mk.in +0 -2
- data/ext/libcouchbase/cmake/source_files.cmake +34 -14
- data/ext/libcouchbase/configure.pl +1 -1
- data/ext/libcouchbase/contrib/genhash/genhash.h +6 -0
- data/ext/libcouchbase/include/libcouchbase/auth.h +10 -0
- data/ext/libcouchbase/include/libcouchbase/couchbase.h +10 -0
- data/ext/libcouchbase/include/libcouchbase/error.h +7 -0
- data/ext/libcouchbase/include/libcouchbase/n1ql.h +13 -1
- data/ext/libcouchbase/include/libcouchbase/plugins/io/bsdio-inl.c +1 -1
- data/ext/libcouchbase/include/libcouchbase/subdoc.h +9 -0
- data/ext/libcouchbase/include/libcouchbase/views.h +7 -1
- data/ext/libcouchbase/include/libcouchbase/visibility.h +1 -0
- data/ext/libcouchbase/include/memcached/protocol_binary.h +21 -1132
- data/ext/libcouchbase/packaging/parse-git-describe.pl +1 -1
- data/ext/libcouchbase/plugins/io/libev/libev_io_opts.h +3 -2
- data/ext/libcouchbase/src/README.md +0 -2
- data/ext/libcouchbase/src/auth-priv.h +1 -0
- data/ext/libcouchbase/src/auth.cc +10 -0
- data/ext/libcouchbase/src/bootstrap.cc +216 -0
- data/ext/libcouchbase/src/bootstrap.h +50 -39
- data/ext/libcouchbase/src/bucketconfig/bc_cccp.cc +455 -0
- data/ext/libcouchbase/src/bucketconfig/bc_file.cc +281 -0
- data/ext/libcouchbase/src/bucketconfig/bc_http.cc +528 -0
- data/ext/libcouchbase/src/bucketconfig/bc_http.h +50 -25
- data/ext/libcouchbase/src/bucketconfig/bc_mcraw.cc +115 -0
- data/ext/libcouchbase/src/bucketconfig/clconfig.h +407 -386
- data/ext/libcouchbase/src/bucketconfig/confmon.cc +378 -0
- data/ext/libcouchbase/src/cbft.cc +22 -27
- data/ext/libcouchbase/src/cntl.cc +24 -24
- data/ext/libcouchbase/src/connspec.cc +30 -1
- data/ext/libcouchbase/src/connspec.h +17 -0
- data/ext/libcouchbase/src/dns-srv.cc +143 -0
- data/ext/libcouchbase/src/{dump.c → dump.cc} +8 -11
- data/ext/libcouchbase/src/getconfig.cc +73 -0
- data/ext/libcouchbase/src/handler.cc +84 -85
- data/ext/libcouchbase/src/hostlist.cc +0 -1
- data/ext/libcouchbase/src/hostlist.h +6 -1
- data/ext/libcouchbase/src/http/http-priv.h +125 -112
- data/ext/libcouchbase/src/http/http.cc +9 -29
- data/ext/libcouchbase/src/http/http.h +1 -34
- data/ext/libcouchbase/src/http/http_io.cc +22 -26
- data/ext/libcouchbase/src/instance.cc +102 -28
- data/ext/libcouchbase/src/internal.h +47 -29
- data/ext/libcouchbase/src/jsparse/parser.cc +146 -202
- data/ext/libcouchbase/src/jsparse/parser.h +91 -98
- data/ext/libcouchbase/src/lcbht/lcbht.cc +177 -0
- data/ext/libcouchbase/src/lcbht/lcbht.h +174 -163
- data/ext/libcouchbase/src/lcbio/connect.cc +562 -0
- data/ext/libcouchbase/src/lcbio/connect.h +9 -2
- data/ext/libcouchbase/src/lcbio/ctx.c +1 -1
- data/ext/libcouchbase/src/lcbio/iotable.h +61 -16
- data/ext/libcouchbase/src/lcbio/ioutils.h +1 -1
- data/ext/libcouchbase/src/lcbio/manager.c +2 -2
- data/ext/libcouchbase/src/lcbio/timer-cxx.h +87 -0
- data/ext/libcouchbase/src/mc/mcreq.h +9 -2
- data/ext/libcouchbase/src/mcserver/mcserver.cc +723 -0
- data/ext/libcouchbase/src/mcserver/mcserver.h +160 -70
- data/ext/libcouchbase/src/mcserver/negotiate.cc +118 -152
- data/ext/libcouchbase/src/mcserver/negotiate.h +85 -74
- data/ext/libcouchbase/src/mctx-helper.h +51 -0
- data/ext/libcouchbase/src/n1ql/ixmgmt.cc +1 -2
- data/ext/libcouchbase/src/n1ql/n1ql.cc +56 -32
- data/ext/libcouchbase/src/{newconfig.c → newconfig.cc} +42 -70
- data/ext/libcouchbase/src/nodeinfo.cc +4 -8
- data/ext/libcouchbase/src/operations/{cbflush.c → cbflush.cc} +7 -15
- data/ext/libcouchbase/src/operations/{counter.c → counter.cc} +0 -0
- data/ext/libcouchbase/src/operations/{durability-cas.c → durability-cas.cc} +92 -76
- data/ext/libcouchbase/src/operations/{durability-seqno.c → durability-seqno.cc} +55 -49
- data/ext/libcouchbase/src/operations/durability.cc +643 -0
- data/ext/libcouchbase/src/operations/durability_internal.h +212 -124
- data/ext/libcouchbase/src/operations/{get.c → get.cc} +24 -26
- data/ext/libcouchbase/src/operations/{observe-seqno.c → observe-seqno.cc} +5 -8
- data/ext/libcouchbase/src/operations/{observe.c → observe.cc} +69 -94
- data/ext/libcouchbase/src/operations/{pktfwd.c → pktfwd.cc} +0 -0
- data/ext/libcouchbase/src/operations/{remove.c → remove.cc} +0 -0
- data/ext/libcouchbase/src/operations/{stats.c → stats.cc} +66 -78
- data/ext/libcouchbase/src/operations/{store.c → store.cc} +27 -32
- data/ext/libcouchbase/src/operations/subdoc.cc +38 -18
- data/ext/libcouchbase/src/operations/{touch.c → touch.cc} +0 -0
- data/ext/libcouchbase/src/packetutils.h +200 -137
- data/ext/libcouchbase/src/probes.d +1 -1
- data/ext/libcouchbase/src/{retrychk.c → retrychk.cc} +3 -4
- data/ext/libcouchbase/src/retryq.cc +394 -0
- data/ext/libcouchbase/src/retryq.h +116 -104
- data/ext/libcouchbase/src/settings.h +2 -1
- data/ext/libcouchbase/src/ssl/ssl_c.c +1 -0
- data/ext/libcouchbase/src/ssl/ssl_e.c +0 -1
- data/ext/libcouchbase/src/trace.h +8 -8
- data/ext/libcouchbase/src/vbucket/vbucket.c +0 -1
- data/ext/libcouchbase/src/views/{docreq.c → docreq.cc} +48 -54
- data/ext/libcouchbase/src/views/docreq.h +24 -30
- data/ext/libcouchbase/src/views/viewreq.cc +318 -0
- data/ext/libcouchbase/src/views/viewreq.h +43 -13
- data/ext/libcouchbase/src/{wait.c → wait.cc} +12 -17
- data/ext/libcouchbase/tests/basic/t_connstr.cc +89 -50
- data/ext/libcouchbase/tests/basic/t_jsparse.cc +27 -78
- data/ext/libcouchbase/tests/basic/t_packet.cc +35 -42
- data/ext/libcouchbase/tests/htparse/t_basic.cc +58 -78
- data/ext/libcouchbase/tests/iotests/t_confmon.cc +94 -111
- data/ext/libcouchbase/tests/iotests/t_sched.cc +1 -2
- data/ext/libcouchbase/tests/mc/t_alloc.cc +9 -9
- data/ext/libcouchbase/tools/cbc-pillowfight.cc +1 -1
- data/lib/libcouchbase/version.rb +1 -1
- metadata +36 -39
- data/ext/libcouchbase/include/memcached/vbucket.h +0 -42
- data/ext/libcouchbase/src/bootstrap.c +0 -269
- data/ext/libcouchbase/src/bucketconfig/bc_cccp.c +0 -495
- data/ext/libcouchbase/src/bucketconfig/bc_file.c +0 -347
- data/ext/libcouchbase/src/bucketconfig/bc_http.c +0 -630
- data/ext/libcouchbase/src/bucketconfig/bc_mcraw.c +0 -150
- data/ext/libcouchbase/src/bucketconfig/confmon.c +0 -474
- data/ext/libcouchbase/src/getconfig.c +0 -100
- data/ext/libcouchbase/src/lcbht/lcbht.c +0 -282
- data/ext/libcouchbase/src/lcbio/connect.c +0 -557
- data/ext/libcouchbase/src/mcserver/mcserver.c +0 -784
- data/ext/libcouchbase/src/operations/durability.c +0 -668
- data/ext/libcouchbase/src/packetutils.c +0 -60
- data/ext/libcouchbase/src/retryq.c +0 -424
- data/ext/libcouchbase/src/simplestring.c +0 -211
- data/ext/libcouchbase/src/simplestring.h +0 -228
- data/ext/libcouchbase/src/ssobuf.h +0 -82
- data/ext/libcouchbase/src/views/viewreq.c +0 -358
- data/ext/libcouchbase/tests/basic/t_string.cc +0 -112
|
@@ -33,8 +33,14 @@ extern "C" {
|
|
|
33
33
|
* @addtogroup lcb-view-api
|
|
34
34
|
* @{
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
#ifdef __cplusplus
|
|
37
|
+
namespace lcb { namespace views { struct ViewRequest; } }
|
|
38
|
+
typedef lcb::views::ViewRequest* lcb_VIEWHANDLE;
|
|
39
|
+
#else
|
|
37
40
|
typedef struct lcbview_REQUEST_st *lcb_VIEWHANDLE;
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
typedef struct lcb_RESPVIEW_st lcb_RESPVIEWQUERY;
|
|
38
44
|
|
|
39
45
|
/**
|
|
40
46
|
* Callback function invoked for each row returned from the view
|
|
@@ -33,6 +33,12 @@
|
|
|
33
33
|
* Author: Trond Norbye <trond.norbye@sun.com>
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* THIS IS A SLIMMED DOWN VERSION FOR LIBCOUCHBASE!
|
|
38
|
+
* It only contains constants used by the library. The header in the
|
|
39
|
+
* memcached source code contains all of the commands actually used.
|
|
40
|
+
*/
|
|
41
|
+
|
|
36
42
|
#ifndef PROTOCOL_BINARY_H
|
|
37
43
|
#define PROTOCOL_BINARY_H
|
|
38
44
|
|
|
@@ -41,7 +47,6 @@
|
|
|
41
47
|
#else
|
|
42
48
|
# include <stdint.h>
|
|
43
49
|
#endif
|
|
44
|
-
#include <memcached/vbucket.h>
|
|
45
50
|
|
|
46
51
|
/**
|
|
47
52
|
* \addtogroup Protocol
|
|
@@ -94,10 +99,7 @@ extern "C"
|
|
|
94
99
|
PROTOCOL_BINARY_RESPONSE_DELTA_BADVAL = 0x06,
|
|
95
100
|
/** The server is not responsible for the requested vbucket */
|
|
96
101
|
PROTOCOL_BINARY_RESPONSE_NOT_MY_VBUCKET = 0x07,
|
|
97
|
-
|
|
98
|
-
PROTOCOL_BINARY_RESPONSE_NO_BUCKET = 0x08,
|
|
99
|
-
/** The authentication context is stale. You should reauthenticate*/
|
|
100
|
-
PROTOCOL_BINARY_RESPONSE_AUTH_STALE = 0x1f,
|
|
102
|
+
|
|
101
103
|
/** Authentication failure (invalid user/password combination,
|
|
102
104
|
* OR an internal error in the authentication library. Could
|
|
103
105
|
* be a misconfigured SASL configuration. See server logs for
|
|
@@ -108,16 +110,10 @@ extern "C"
|
|
|
108
110
|
/** The requested value is outside the legal range
|
|
109
111
|
* (similar to EINVAL, but more specific) */
|
|
110
112
|
PROTOCOL_BINARY_RESPONSE_ERANGE = 0x22,
|
|
111
|
-
|
|
112
|
-
* (_currently_ only used by DCP for agreeing on selecting a
|
|
113
|
-
* starting point) */
|
|
114
|
-
PROTOCOL_BINARY_RESPONSE_ROLLBACK = 0x23,
|
|
113
|
+
|
|
115
114
|
/** No access (could be opcode, value, bucket etc) */
|
|
116
115
|
PROTOCOL_BINARY_RESPONSE_EACCESS = 0x24,
|
|
117
|
-
|
|
118
|
-
* node, and the Cluster manager has not yet granted all
|
|
119
|
-
* users access to the cluster. */
|
|
120
|
-
PROTOCOL_BINARY_RESPONSE_NOT_INITIALIZED = 0x25,
|
|
116
|
+
|
|
121
117
|
/** The server have no idea what this command is for */
|
|
122
118
|
PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND = 0x81,
|
|
123
119
|
/** Not enough memory */
|
|
@@ -211,210 +207,30 @@ extern "C"
|
|
|
211
207
|
PROTOCOL_BINARY_CMD_DELETE = 0x04,
|
|
212
208
|
PROTOCOL_BINARY_CMD_INCREMENT = 0x05,
|
|
213
209
|
PROTOCOL_BINARY_CMD_DECREMENT = 0x06,
|
|
214
|
-
PROTOCOL_BINARY_CMD_QUIT = 0x07,
|
|
215
210
|
PROTOCOL_BINARY_CMD_FLUSH = 0x08,
|
|
216
|
-
PROTOCOL_BINARY_CMD_GETQ = 0x09
|
|
217
|
-
PROTOCOL_BINARY_CMD_NOOP = 0x0a,
|
|
211
|
+
PROTOCOL_BINARY_CMD_GETQ = 0x09 /* Used in tests */,
|
|
218
212
|
PROTOCOL_BINARY_CMD_VERSION = 0x0b,
|
|
219
|
-
PROTOCOL_BINARY_CMD_GETK = 0x0c,
|
|
220
|
-
PROTOCOL_BINARY_CMD_GETKQ = 0x0d,
|
|
221
213
|
PROTOCOL_BINARY_CMD_APPEND = 0x0e,
|
|
222
214
|
PROTOCOL_BINARY_CMD_PREPEND = 0x0f,
|
|
223
215
|
PROTOCOL_BINARY_CMD_STAT = 0x10,
|
|
224
|
-
PROTOCOL_BINARY_CMD_SETQ = 0x11,
|
|
225
|
-
PROTOCOL_BINARY_CMD_ADDQ = 0x12,
|
|
226
|
-
PROTOCOL_BINARY_CMD_REPLACEQ = 0x13,
|
|
227
|
-
PROTOCOL_BINARY_CMD_DELETEQ = 0x14,
|
|
228
|
-
PROTOCOL_BINARY_CMD_INCREMENTQ = 0x15,
|
|
229
|
-
PROTOCOL_BINARY_CMD_DECREMENTQ = 0x16,
|
|
230
|
-
PROTOCOL_BINARY_CMD_QUITQ = 0x17,
|
|
231
|
-
PROTOCOL_BINARY_CMD_FLUSHQ = 0x18,
|
|
232
|
-
PROTOCOL_BINARY_CMD_APPENDQ = 0x19,
|
|
233
|
-
PROTOCOL_BINARY_CMD_PREPENDQ = 0x1a,
|
|
234
216
|
PROTOCOL_BINARY_CMD_VERBOSITY = 0x1b,
|
|
235
217
|
PROTOCOL_BINARY_CMD_TOUCH = 0x1c,
|
|
236
218
|
PROTOCOL_BINARY_CMD_GAT = 0x1d,
|
|
237
|
-
PROTOCOL_BINARY_CMD_GATQ = 0x1e,
|
|
238
219
|
PROTOCOL_BINARY_CMD_HELLO = 0x1f,
|
|
239
220
|
|
|
240
221
|
PROTOCOL_BINARY_CMD_SASL_LIST_MECHS = 0x20,
|
|
241
222
|
PROTOCOL_BINARY_CMD_SASL_AUTH = 0x21,
|
|
242
223
|
PROTOCOL_BINARY_CMD_SASL_STEP = 0x22,
|
|
243
224
|
|
|
244
|
-
/* Control */
|
|
245
|
-
PROTOCOL_BINARY_CMD_IOCTL_GET = 0x23,
|
|
246
|
-
PROTOCOL_BINARY_CMD_IOCTL_SET = 0x24,
|
|
247
|
-
|
|
248
|
-
/* Config */
|
|
249
|
-
PROTOCOL_BINARY_CMD_CONFIG_VALIDATE = 0x25,
|
|
250
|
-
PROTOCOL_BINARY_CMD_CONFIG_RELOAD = 0x26,
|
|
251
|
-
|
|
252
|
-
/* Audit */
|
|
253
|
-
PROTOCOL_BINARY_CMD_AUDIT_PUT = 0x27,
|
|
254
|
-
PROTOCOL_BINARY_CMD_AUDIT_CONFIG_RELOAD = 0x28,
|
|
255
|
-
|
|
256
|
-
/* Shutdown the server */
|
|
257
|
-
PROTOCOL_BINARY_CMD_SHUTDOWN = 0x29,
|
|
258
|
-
|
|
259
|
-
/* These commands are used for range operations and exist within
|
|
260
|
-
* this header for use in other projects. Range operations are
|
|
261
|
-
* not expected to be implemented in the memcached server itself.
|
|
262
|
-
*/
|
|
263
|
-
PROTOCOL_BINARY_CMD_RGET = 0x30,
|
|
264
|
-
PROTOCOL_BINARY_CMD_RSET = 0x31,
|
|
265
|
-
PROTOCOL_BINARY_CMD_RSETQ = 0x32,
|
|
266
|
-
PROTOCOL_BINARY_CMD_RAPPEND = 0x33,
|
|
267
|
-
PROTOCOL_BINARY_CMD_RAPPENDQ = 0x34,
|
|
268
|
-
PROTOCOL_BINARY_CMD_RPREPEND = 0x35,
|
|
269
|
-
PROTOCOL_BINARY_CMD_RPREPENDQ = 0x36,
|
|
270
|
-
PROTOCOL_BINARY_CMD_RDELETE = 0x37,
|
|
271
|
-
PROTOCOL_BINARY_CMD_RDELETEQ = 0x38,
|
|
272
|
-
PROTOCOL_BINARY_CMD_RINCR = 0x39,
|
|
273
|
-
PROTOCOL_BINARY_CMD_RINCRQ = 0x3a,
|
|
274
|
-
PROTOCOL_BINARY_CMD_RDECR = 0x3b,
|
|
275
|
-
PROTOCOL_BINARY_CMD_RDECRQ = 0x3c,
|
|
276
|
-
/* End Range operations */
|
|
277
|
-
|
|
278
|
-
/* VBucket commands */
|
|
279
|
-
PROTOCOL_BINARY_CMD_SET_VBUCKET = 0x3d,
|
|
280
|
-
PROTOCOL_BINARY_CMD_GET_VBUCKET = 0x3e,
|
|
281
|
-
PROTOCOL_BINARY_CMD_DEL_VBUCKET = 0x3f,
|
|
282
|
-
/* End VBucket commands */
|
|
283
|
-
|
|
284
|
-
/* TAP commands */
|
|
285
|
-
PROTOCOL_BINARY_CMD_TAP_CONNECT = 0x40,
|
|
286
|
-
PROTOCOL_BINARY_CMD_TAP_MUTATION = 0x41,
|
|
287
|
-
PROTOCOL_BINARY_CMD_TAP_DELETE = 0x42,
|
|
288
|
-
PROTOCOL_BINARY_CMD_TAP_FLUSH = 0x43,
|
|
289
|
-
PROTOCOL_BINARY_CMD_TAP_OPAQUE = 0x44,
|
|
290
|
-
PROTOCOL_BINARY_CMD_TAP_VBUCKET_SET = 0x45,
|
|
291
|
-
PROTOCOL_BINARY_CMD_TAP_CHECKPOINT_START = 0x46,
|
|
292
|
-
PROTOCOL_BINARY_CMD_TAP_CHECKPOINT_END = 0x47,
|
|
293
|
-
/* End TAP */
|
|
294
|
-
|
|
295
|
-
/* Vbucket command to get the VBUCKET sequence numbers for all
|
|
296
|
-
* vbuckets on the node */
|
|
297
|
-
PROTOCOL_BINARY_CMD_GET_ALL_VB_SEQNOS = 0x48,
|
|
298
|
-
|
|
299
|
-
/* DCP */
|
|
300
|
-
PROTOCOL_BINARY_CMD_DCP_OPEN = 0x50,
|
|
301
|
-
PROTOCOL_BINARY_CMD_DCP_ADD_STREAM = 0x51,
|
|
302
|
-
PROTOCOL_BINARY_CMD_DCP_CLOSE_STREAM = 0x52,
|
|
303
|
-
PROTOCOL_BINARY_CMD_DCP_STREAM_REQ = 0x53,
|
|
304
|
-
PROTOCOL_BINARY_CMD_DCP_GET_FAILOVER_LOG = 0x54,
|
|
305
|
-
PROTOCOL_BINARY_CMD_DCP_STREAM_END = 0x55,
|
|
306
|
-
PROTOCOL_BINARY_CMD_DCP_SNAPSHOT_MARKER = 0x56,
|
|
307
|
-
PROTOCOL_BINARY_CMD_DCP_MUTATION = 0x57,
|
|
308
|
-
PROTOCOL_BINARY_CMD_DCP_DELETION = 0x58,
|
|
309
|
-
PROTOCOL_BINARY_CMD_DCP_EXPIRATION = 0x59,
|
|
310
|
-
PROTOCOL_BINARY_CMD_DCP_FLUSH = 0x5a,
|
|
311
|
-
PROTOCOL_BINARY_CMD_DCP_SET_VBUCKET_STATE = 0x5b,
|
|
312
|
-
PROTOCOL_BINARY_CMD_DCP_NOOP = 0x5c,
|
|
313
|
-
PROTOCOL_BINARY_CMD_DCP_BUFFER_ACKNOWLEDGEMENT = 0x5d,
|
|
314
|
-
PROTOCOL_BINARY_CMD_DCP_CONTROL = 0x5e,
|
|
315
|
-
PROTOCOL_BINARY_CMD_DCP_RESERVED4 = 0x5f,
|
|
316
|
-
/* End DCP */
|
|
317
|
-
|
|
318
|
-
PROTOCOL_BINARY_CMD_STOP_PERSISTENCE = 0x80,
|
|
319
|
-
PROTOCOL_BINARY_CMD_START_PERSISTENCE = 0x81,
|
|
320
|
-
PROTOCOL_BINARY_CMD_SET_PARAM = 0x82,
|
|
321
225
|
PROTOCOL_BINARY_CMD_GET_REPLICA = 0x83,
|
|
322
226
|
|
|
323
|
-
/* Bucket engine */
|
|
324
|
-
PROTOCOL_BINARY_CMD_CREATE_BUCKET = 0x85,
|
|
325
|
-
PROTOCOL_BINARY_CMD_DELETE_BUCKET = 0x86,
|
|
326
|
-
PROTOCOL_BINARY_CMD_LIST_BUCKETS = 0x87,
|
|
327
|
-
PROTOCOL_BINARY_CMD_SELECT_BUCKET= 0x89,
|
|
328
|
-
|
|
329
|
-
PROTOCOL_BINARY_CMD_ASSUME_ROLE = 0x8a,
|
|
330
|
-
|
|
331
227
|
PROTOCOL_BINARY_CMD_OBSERVE_SEQNO = 0x91,
|
|
332
228
|
PROTOCOL_BINARY_CMD_OBSERVE = 0x92,
|
|
333
229
|
|
|
334
|
-
PROTOCOL_BINARY_CMD_EVICT_KEY = 0x93,
|
|
335
230
|
PROTOCOL_BINARY_CMD_GET_LOCKED = 0x94,
|
|
336
231
|
PROTOCOL_BINARY_CMD_UNLOCK_KEY = 0x95,
|
|
337
232
|
|
|
338
|
-
/**
|
|
339
|
-
* Return the last closed checkpoint Id for a given VBucket.
|
|
340
|
-
*/
|
|
341
|
-
PROTOCOL_BINARY_CMD_LAST_CLOSED_CHECKPOINT = 0x97,
|
|
342
|
-
/**
|
|
343
|
-
* Close the TAP connection for the registered TAP client and
|
|
344
|
-
* remove the checkpoint cursors from its registered vbuckets.
|
|
345
|
-
*/
|
|
346
|
-
PROTOCOL_BINARY_CMD_DEREGISTER_TAP_CLIENT = 0x9e,
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Reset the replication chain from the node that receives
|
|
350
|
-
* this command. For example, given the replication chain,
|
|
351
|
-
* A->B->C, if A receives this command, it will reset all the
|
|
352
|
-
* replica vbuckets on B and C, which are replicated from A.
|
|
353
|
-
*/
|
|
354
|
-
PROTOCOL_BINARY_CMD_RESET_REPLICATION_CHAIN = 0x9f,
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* CMD_GET_META is used to retrieve the meta section for an item.
|
|
358
|
-
*/
|
|
359
|
-
PROTOCOL_BINARY_CMD_GET_META = 0xa0,
|
|
360
|
-
PROTOCOL_BINARY_CMD_GETQ_META = 0xa1,
|
|
361
|
-
PROTOCOL_BINARY_CMD_SET_WITH_META = 0xa2,
|
|
362
|
-
PROTOCOL_BINARY_CMD_SETQ_WITH_META = 0xa3,
|
|
363
|
-
PROTOCOL_BINARY_CMD_ADD_WITH_META = 0xa4,
|
|
364
|
-
PROTOCOL_BINARY_CMD_ADDQ_WITH_META = 0xa5,
|
|
365
|
-
PROTOCOL_BINARY_CMD_SNAPSHOT_VB_STATES = 0xa6,
|
|
366
|
-
PROTOCOL_BINARY_CMD_VBUCKET_BATCH_COUNT = 0xa7,
|
|
367
|
-
PROTOCOL_BINARY_CMD_DEL_WITH_META = 0xa8,
|
|
368
|
-
PROTOCOL_BINARY_CMD_DELQ_WITH_META = 0xa9,
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Command to create a new checkpoint on a given vbucket by force
|
|
372
|
-
*/
|
|
373
|
-
PROTOCOL_BINARY_CMD_CREATE_CHECKPOINT = 0xaa,
|
|
374
|
-
PROTOCOL_BINARY_CMD_NOTIFY_VBUCKET_UPDATE = 0xac,
|
|
375
|
-
/**
|
|
376
|
-
* Command to enable data traffic after completion of warm
|
|
377
|
-
*/
|
|
378
|
-
PROTOCOL_BINARY_CMD_ENABLE_TRAFFIC = 0xad,
|
|
379
|
-
/**
|
|
380
|
-
* Command to disable data traffic temporarily
|
|
381
|
-
*/
|
|
382
|
-
PROTOCOL_BINARY_CMD_DISABLE_TRAFFIC = 0xae,
|
|
383
|
-
/**
|
|
384
|
-
* Command to change the vbucket filter for a given TAP producer.
|
|
385
|
-
*/
|
|
386
|
-
PROTOCOL_BINARY_CMD_CHANGE_VB_FILTER = 0xb0,
|
|
387
|
-
/**
|
|
388
|
-
* Command to wait for the checkpoint persistence
|
|
389
|
-
*/
|
|
390
|
-
PROTOCOL_BINARY_CMD_CHECKPOINT_PERSISTENCE = 0xb1,
|
|
391
|
-
/**
|
|
392
|
-
* Command that returns meta data for typical memcached ops
|
|
393
|
-
*/
|
|
394
|
-
PROTOCOL_BINARY_CMD_RETURN_META = 0xb2,
|
|
395
|
-
/**
|
|
396
|
-
* Command to trigger compaction of a vbucket
|
|
397
|
-
*/
|
|
398
|
-
PROTOCOL_BINARY_CMD_COMPACT_DB = 0xb3,
|
|
399
|
-
/**
|
|
400
|
-
* Command to set cluster configuration
|
|
401
|
-
*/
|
|
402
|
-
PROTOCOL_BINARY_CMD_SET_CLUSTER_CONFIG = 0xb4,
|
|
403
|
-
/**
|
|
404
|
-
* Command that returns cluster configuration
|
|
405
|
-
*/
|
|
406
233
|
PROTOCOL_BINARY_CMD_GET_CLUSTER_CONFIG = 0xb5,
|
|
407
|
-
PROTOCOL_BINARY_CMD_GET_RANDOM_KEY = 0xb6,
|
|
408
|
-
/**
|
|
409
|
-
* Command to wait for the dcp sequence number persistence
|
|
410
|
-
*/
|
|
411
|
-
PROTOCOL_BINARY_CMD_SEQNO_PERSISTENCE = 0xb7,
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Commands for GO-XDCR
|
|
415
|
-
*/
|
|
416
|
-
PROTOCOL_BINARY_CMD_SET_DRIFT_COUNTER_STATE = 0xc1,
|
|
417
|
-
PROTOCOL_BINARY_CMD_GET_ADJUSTED_TIME = 0xc2,
|
|
418
234
|
|
|
419
235
|
/**
|
|
420
236
|
* Commands for the Sub-document API.
|
|
@@ -448,21 +264,6 @@ extern "C"
|
|
|
448
264
|
/* Subdoc additions for Spock: */
|
|
449
265
|
PROTOCOL_BINARY_CMD_SUBDOC_GET_COUNT = 0xd2,
|
|
450
266
|
|
|
451
|
-
/* Scrub the data */
|
|
452
|
-
PROTOCOL_BINARY_CMD_SCRUB = 0xf0,
|
|
453
|
-
/* Refresh the ISASL data */
|
|
454
|
-
PROTOCOL_BINARY_CMD_ISASL_REFRESH = 0xf1,
|
|
455
|
-
/* Refresh the SSL certificates */
|
|
456
|
-
PROTOCOL_BINARY_CMD_SSL_CERTS_REFRESH = 0xf2,
|
|
457
|
-
/* Internal timer ioctl */
|
|
458
|
-
PROTOCOL_BINARY_CMD_GET_CMD_TIMER = 0xf3,
|
|
459
|
-
/* ns_server - memcached session validation */
|
|
460
|
-
PROTOCOL_BINARY_CMD_SET_CTRL_TOKEN = 0xf4,
|
|
461
|
-
PROTOCOL_BINARY_CMD_GET_CTRL_TOKEN = 0xf5,
|
|
462
|
-
|
|
463
|
-
/* ns_server - memcached internal communication */
|
|
464
|
-
PROTOCOL_BINARY_CMD_INIT_COMPLETE = 0xf6,
|
|
465
|
-
|
|
466
267
|
/* Reserved for being able to signal invalid opcode */
|
|
467
268
|
PROTOCOL_BINARY_CMD_INVALID = 0xff
|
|
468
269
|
} protocol_binary_command;
|
|
@@ -474,25 +275,9 @@ extern "C"
|
|
|
474
275
|
typedef enum {
|
|
475
276
|
PROTOCOL_BINARY_RAW_BYTES = 0x00,
|
|
476
277
|
PROTOCOL_BINARY_DATATYPE_JSON = 0x01,
|
|
477
|
-
|
|
478
|
-
PROTOCOL_BINARY_DATATYPE_COMPRESSED = 0x02,
|
|
479
|
-
/* Compressed == snappy compression */
|
|
480
|
-
PROTOCOL_BINARY_DATATYPE_COMPRESSED_JSON = 0x03
|
|
278
|
+
PROTOCOL_BINARY_DATATYPE_COMPRESSED = 0x02
|
|
481
279
|
} protocol_binary_datatypes;
|
|
482
280
|
|
|
483
|
-
/**
|
|
484
|
-
* Definitions for extended (flexible) metadata
|
|
485
|
-
*
|
|
486
|
-
* @1: Flex Code to identify the number of extended metadata fields
|
|
487
|
-
* @2: Size of the Flex Code, set to 1 byte
|
|
488
|
-
* @3: Current size of extended metadata
|
|
489
|
-
*/
|
|
490
|
-
typedef enum {
|
|
491
|
-
FLEX_META_CODE = 0x01,
|
|
492
|
-
FLEX_DATA_OFFSET = 1,
|
|
493
|
-
EXT_META_LEN = 1
|
|
494
|
-
} protocol_binary_flexmeta;
|
|
495
|
-
|
|
496
281
|
/**
|
|
497
282
|
* Definitions of sub-document flags.
|
|
498
283
|
*/
|
|
@@ -506,7 +291,11 @@ extern "C"
|
|
|
506
291
|
/* (Mutation) Create the document if it does not exist. Implies
|
|
507
292
|
* SUBDOC_FLAG_MKDIR_P.
|
|
508
293
|
*/
|
|
509
|
-
SUBDOC_FLAG_MKDOC = 0x02
|
|
294
|
+
SUBDOC_FLAG_MKDOC = 0x02,
|
|
295
|
+
|
|
296
|
+
SUBDOC_FLAG_XATTR_PATH = 0x04,
|
|
297
|
+
SUBDOC_FLAG_ACCESS_DELETED = 0x8,
|
|
298
|
+
SUBDOC_FLAG_EXPAND_MACROS = 0x010
|
|
510
299
|
} protocol_binary_subdoc_flag;
|
|
511
300
|
|
|
512
301
|
/**
|
|
@@ -567,14 +356,6 @@ extern "C"
|
|
|
567
356
|
uint8_t bytes[sizeof(protocol_binary_response_header)];
|
|
568
357
|
} protocol_binary_response_no_extras;
|
|
569
358
|
|
|
570
|
-
/**
|
|
571
|
-
* Definition of the packet used by the get, getq, getk and getkq command.
|
|
572
|
-
* See section 4
|
|
573
|
-
*/
|
|
574
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_get;
|
|
575
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_getq;
|
|
576
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_getk;
|
|
577
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_getkq;
|
|
578
359
|
|
|
579
360
|
/**
|
|
580
361
|
* Definition of the packet returned from a successful get, getq, getk and
|
|
@@ -591,9 +372,8 @@ extern "C"
|
|
|
591
372
|
uint8_t bytes[sizeof(protocol_binary_response_header) + 4];
|
|
592
373
|
} protocol_binary_response_get;
|
|
593
374
|
|
|
375
|
+
/* used by tests */
|
|
594
376
|
typedef protocol_binary_response_get protocol_binary_response_getq;
|
|
595
|
-
typedef protocol_binary_response_get protocol_binary_response_getk;
|
|
596
|
-
typedef protocol_binary_response_get protocol_binary_response_getkq;
|
|
597
377
|
|
|
598
378
|
/**
|
|
599
379
|
* Definition of the packet used by the delete command
|
|
@@ -615,32 +395,6 @@ extern "C"
|
|
|
615
395
|
*/
|
|
616
396
|
typedef protocol_binary_response_no_extras protocol_binary_response_delete;
|
|
617
397
|
|
|
618
|
-
/**
|
|
619
|
-
* Definition of the packet used by the flush command
|
|
620
|
-
* See section 4
|
|
621
|
-
* Please note that the expiration field is optional, so remember to see
|
|
622
|
-
* check the header.bodysize to see if it is present.
|
|
623
|
-
*/
|
|
624
|
-
typedef union {
|
|
625
|
-
struct {
|
|
626
|
-
protocol_binary_request_header header;
|
|
627
|
-
struct {
|
|
628
|
-
/*
|
|
629
|
-
* Specifying a non-null expiration time is no longer
|
|
630
|
-
* supported
|
|
631
|
-
*/
|
|
632
|
-
uint32_t expiration;
|
|
633
|
-
} body;
|
|
634
|
-
} message;
|
|
635
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
636
|
-
} protocol_binary_request_flush;
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* Definition of the packet returned by the flush command
|
|
640
|
-
* See section 4
|
|
641
|
-
*/
|
|
642
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_flush;
|
|
643
|
-
|
|
644
398
|
/**
|
|
645
399
|
* Definition of the packet used by set, add and replace
|
|
646
400
|
* See section 4
|
|
@@ -655,28 +409,6 @@ extern "C"
|
|
|
655
409
|
} message;
|
|
656
410
|
uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
|
|
657
411
|
} protocol_binary_request_set;
|
|
658
|
-
typedef protocol_binary_request_set protocol_binary_request_add;
|
|
659
|
-
typedef protocol_binary_request_set protocol_binary_request_replace;
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* Definition of the packet returned by set, add and replace
|
|
663
|
-
* See section 4
|
|
664
|
-
*/
|
|
665
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_set;
|
|
666
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_add;
|
|
667
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_replace;
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Definition of the noop packet
|
|
671
|
-
* See section 4
|
|
672
|
-
*/
|
|
673
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_noop;
|
|
674
|
-
|
|
675
|
-
/**
|
|
676
|
-
* Definition of the packet returned by the noop command
|
|
677
|
-
* See section 4
|
|
678
|
-
*/
|
|
679
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_noop;
|
|
680
412
|
|
|
681
413
|
/**
|
|
682
414
|
* Definition of the structure used by the increment and decrement
|
|
@@ -715,38 +447,6 @@ extern "C"
|
|
|
715
447
|
typedef protocol_binary_response_no_extras protocol_binary_response_incr;
|
|
716
448
|
typedef protocol_binary_response_no_extras protocol_binary_response_decr;
|
|
717
449
|
|
|
718
|
-
/**
|
|
719
|
-
* Definition of the quit
|
|
720
|
-
* See section 4
|
|
721
|
-
*/
|
|
722
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_quit;
|
|
723
|
-
|
|
724
|
-
/**
|
|
725
|
-
* Definition of the packet returned by the quit command
|
|
726
|
-
* See section 4
|
|
727
|
-
*/
|
|
728
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_quit;
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* Definition of the packet used by append and prepend command
|
|
732
|
-
* See section 4
|
|
733
|
-
*/
|
|
734
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_append;
|
|
735
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_prepend;
|
|
736
|
-
|
|
737
|
-
/**
|
|
738
|
-
* Definition of the packet returned from a successful append or prepend
|
|
739
|
-
* See section 4
|
|
740
|
-
*/
|
|
741
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_append;
|
|
742
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_prepend;
|
|
743
|
-
|
|
744
|
-
/**
|
|
745
|
-
* Definition of the packet used by the version command
|
|
746
|
-
* See section 4
|
|
747
|
-
*/
|
|
748
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_version;
|
|
749
|
-
|
|
750
450
|
/**
|
|
751
451
|
* Definition of the packet returned from a successful version command
|
|
752
452
|
* See section 4
|
|
@@ -815,13 +515,6 @@ extern "C"
|
|
|
815
515
|
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
816
516
|
} protocol_binary_request_gat;
|
|
817
517
|
|
|
818
|
-
typedef protocol_binary_request_gat protocol_binary_request_gatq;
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* Definition of the packet returned from the GAT(Q)
|
|
822
|
-
*/
|
|
823
|
-
typedef protocol_binary_response_get protocol_binary_response_gat;
|
|
824
|
-
typedef protocol_binary_response_get protocol_binary_response_gatq;
|
|
825
518
|
|
|
826
519
|
/**
|
|
827
520
|
* Definition of the packet used by SUBDOCUMENT single-path commands.
|
|
@@ -963,269 +656,6 @@ extern "C"
|
|
|
963
656
|
uint8_t bytes[sizeof(protocol_binary_response_header)];
|
|
964
657
|
} protocol_binary_response_subdoc_multi_mutation;
|
|
965
658
|
|
|
966
|
-
|
|
967
|
-
/**
|
|
968
|
-
* Definition of a request for a range operation.
|
|
969
|
-
* See http://code.google.com/p/memcached/wiki/RangeOps
|
|
970
|
-
*
|
|
971
|
-
* These types are used for range operations and exist within
|
|
972
|
-
* this header for use in other projects. Range operations are
|
|
973
|
-
* not expected to be implemented in the memcached server itself.
|
|
974
|
-
*/
|
|
975
|
-
typedef union {
|
|
976
|
-
struct {
|
|
977
|
-
protocol_binary_response_header header;
|
|
978
|
-
struct {
|
|
979
|
-
uint16_t size;
|
|
980
|
-
uint8_t reserved;
|
|
981
|
-
uint8_t flags;
|
|
982
|
-
uint32_t max_results;
|
|
983
|
-
} body;
|
|
984
|
-
} message;
|
|
985
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
986
|
-
} protocol_binary_request_rangeop;
|
|
987
|
-
|
|
988
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rget;
|
|
989
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rset;
|
|
990
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rsetq;
|
|
991
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rappend;
|
|
992
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rappendq;
|
|
993
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rprepend;
|
|
994
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rprependq;
|
|
995
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rdelete;
|
|
996
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rdeleteq;
|
|
997
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rincr;
|
|
998
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rincrq;
|
|
999
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rdecr;
|
|
1000
|
-
typedef protocol_binary_request_rangeop protocol_binary_request_rdecrq;
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
/**
|
|
1004
|
-
* Definition of tap commands
|
|
1005
|
-
* See To be written
|
|
1006
|
-
*
|
|
1007
|
-
*/
|
|
1008
|
-
|
|
1009
|
-
typedef union {
|
|
1010
|
-
struct {
|
|
1011
|
-
protocol_binary_request_header header;
|
|
1012
|
-
struct {
|
|
1013
|
-
/**
|
|
1014
|
-
* flags is a bitmask used to set properties for the
|
|
1015
|
-
* the connection. Please In order to be forward compatible
|
|
1016
|
-
* you should set all undefined bits to 0.
|
|
1017
|
-
*
|
|
1018
|
-
* If the bit require extra userdata, it will be stored
|
|
1019
|
-
* in the user-data field of the body (passed to the engine
|
|
1020
|
-
* as enginespeciffic). That means that when you parse the
|
|
1021
|
-
* flags and the engine-specific data, you have to work your
|
|
1022
|
-
* way from bit 0 and upwards to find the correct offset for
|
|
1023
|
-
* the data.
|
|
1024
|
-
*
|
|
1025
|
-
*/
|
|
1026
|
-
uint32_t flags;
|
|
1027
|
-
|
|
1028
|
-
/**
|
|
1029
|
-
* Backfill age
|
|
1030
|
-
*
|
|
1031
|
-
* By using this flag you can limit the amount of data being
|
|
1032
|
-
* transmitted. If you don't specify a backfill age, the
|
|
1033
|
-
* server will transmit everything it contains.
|
|
1034
|
-
*
|
|
1035
|
-
* The first 8 bytes in the engine specific data contains
|
|
1036
|
-
* the oldest entry (from epoc) you're interested in.
|
|
1037
|
-
* Specifying a time in the future (for the server you are
|
|
1038
|
-
* connecting to), will cause it to start streaming current
|
|
1039
|
-
* changes.
|
|
1040
|
-
*/
|
|
1041
|
-
#define TAP_CONNECT_FLAG_BACKFILL 0x01
|
|
1042
|
-
/**
|
|
1043
|
-
* Dump will cause the server to send the data stored on the
|
|
1044
|
-
* server, but disconnect when the keys stored in the server
|
|
1045
|
-
* are transmitted.
|
|
1046
|
-
*/
|
|
1047
|
-
#define TAP_CONNECT_FLAG_DUMP 0x02
|
|
1048
|
-
/**
|
|
1049
|
-
* The body contains a list of 16 bits words in network byte
|
|
1050
|
-
* order specifying the vbucket ids to monitor. The first 16
|
|
1051
|
-
* bit word contains the number of buckets. The number of 0
|
|
1052
|
-
* means "all buckets"
|
|
1053
|
-
*/
|
|
1054
|
-
#define TAP_CONNECT_FLAG_LIST_VBUCKETS 0x04
|
|
1055
|
-
/**
|
|
1056
|
-
* The responsibility of the vbuckets is to be transferred
|
|
1057
|
-
* over to the caller when all items are transferred.
|
|
1058
|
-
*/
|
|
1059
|
-
#define TAP_CONNECT_FLAG_TAKEOVER_VBUCKETS 0x08
|
|
1060
|
-
/**
|
|
1061
|
-
* The tap consumer supports ack'ing of tap messages
|
|
1062
|
-
*/
|
|
1063
|
-
#define TAP_CONNECT_SUPPORT_ACK 0x10
|
|
1064
|
-
/**
|
|
1065
|
-
* The tap consumer would prefer to just get the keys
|
|
1066
|
-
* back. If the engine supports this it will set
|
|
1067
|
-
* the TAP_FLAG_NO_VALUE flag in each of the
|
|
1068
|
-
* tap packets returned.
|
|
1069
|
-
*/
|
|
1070
|
-
#define TAP_CONNECT_REQUEST_KEYS_ONLY 0x20
|
|
1071
|
-
/**
|
|
1072
|
-
* The body contains a list of (vbucket_id, last_checkpoint_id)
|
|
1073
|
-
* pairs. This provides the checkpoint support in TAP streams.
|
|
1074
|
-
* The last checkpoint id represents the last checkpoint that
|
|
1075
|
-
* was successfully persisted.
|
|
1076
|
-
*/
|
|
1077
|
-
#define TAP_CONNECT_CHECKPOINT 0x40
|
|
1078
|
-
/**
|
|
1079
|
-
* The tap consumer is a registered tap client, which means that
|
|
1080
|
-
* the tap server will maintain its checkpoint cursor permanently.
|
|
1081
|
-
*/
|
|
1082
|
-
#define TAP_CONNECT_REGISTERED_CLIENT 0x80
|
|
1083
|
-
|
|
1084
|
-
/**
|
|
1085
|
-
* The initial TAP implementation convert flags to/from network
|
|
1086
|
-
* byte order, but the values isn't stored in host local order
|
|
1087
|
-
* causing them to change if you mix platforms..
|
|
1088
|
-
*/
|
|
1089
|
-
#define TAP_CONNECT_TAP_FIX_FLAG_BYTEORDER 0x100
|
|
1090
|
-
|
|
1091
|
-
} body;
|
|
1092
|
-
} message;
|
|
1093
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
1094
|
-
} protocol_binary_request_tap_connect;
|
|
1095
|
-
|
|
1096
|
-
typedef union {
|
|
1097
|
-
struct {
|
|
1098
|
-
protocol_binary_request_header header;
|
|
1099
|
-
struct {
|
|
1100
|
-
struct {
|
|
1101
|
-
uint16_t enginespecific_length;
|
|
1102
|
-
/*
|
|
1103
|
-
* The flag section support the following flags
|
|
1104
|
-
*/
|
|
1105
|
-
/**
|
|
1106
|
-
* Request that the consumer send a response packet
|
|
1107
|
-
* for this packet. The opaque field must be preserved
|
|
1108
|
-
* in the response.
|
|
1109
|
-
*/
|
|
1110
|
-
#define TAP_FLAG_ACK 0x01
|
|
1111
|
-
/**
|
|
1112
|
-
* The value for the key is not included in the packet
|
|
1113
|
-
*/
|
|
1114
|
-
#define TAP_FLAG_NO_VALUE 0x02
|
|
1115
|
-
/**
|
|
1116
|
-
* The flags are in network byte order
|
|
1117
|
-
*/
|
|
1118
|
-
#define TAP_FLAG_NETWORK_BYTE_ORDER 0x04
|
|
1119
|
-
|
|
1120
|
-
uint16_t flags;
|
|
1121
|
-
uint8_t ttl;
|
|
1122
|
-
uint8_t res1;
|
|
1123
|
-
uint8_t res2;
|
|
1124
|
-
uint8_t res3;
|
|
1125
|
-
} tap;
|
|
1126
|
-
struct {
|
|
1127
|
-
uint32_t flags;
|
|
1128
|
-
uint32_t expiration;
|
|
1129
|
-
} item;
|
|
1130
|
-
} body;
|
|
1131
|
-
} message;
|
|
1132
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 16];
|
|
1133
|
-
} protocol_binary_request_tap_mutation;
|
|
1134
|
-
|
|
1135
|
-
typedef union {
|
|
1136
|
-
struct {
|
|
1137
|
-
protocol_binary_request_header header;
|
|
1138
|
-
struct {
|
|
1139
|
-
struct {
|
|
1140
|
-
uint16_t enginespecific_length;
|
|
1141
|
-
/**
|
|
1142
|
-
* See the definition of the flags for
|
|
1143
|
-
* protocol_binary_request_tap_mutation for a description
|
|
1144
|
-
* of the available flags.
|
|
1145
|
-
*/
|
|
1146
|
-
uint16_t flags;
|
|
1147
|
-
uint8_t ttl;
|
|
1148
|
-
uint8_t res1;
|
|
1149
|
-
uint8_t res2;
|
|
1150
|
-
uint8_t res3;
|
|
1151
|
-
} tap;
|
|
1152
|
-
} body;
|
|
1153
|
-
} message;
|
|
1154
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
|
|
1155
|
-
} protocol_binary_request_tap_no_extras;
|
|
1156
|
-
|
|
1157
|
-
typedef protocol_binary_request_tap_no_extras protocol_binary_request_tap_delete;
|
|
1158
|
-
typedef protocol_binary_request_tap_no_extras protocol_binary_request_tap_flush;
|
|
1159
|
-
|
|
1160
|
-
/**
|
|
1161
|
-
* TAP OPAQUE command list
|
|
1162
|
-
*/
|
|
1163
|
-
#define TAP_OPAQUE_ENABLE_AUTO_NACK 0
|
|
1164
|
-
#define TAP_OPAQUE_INITIAL_VBUCKET_STREAM 1
|
|
1165
|
-
#define TAP_OPAQUE_ENABLE_CHECKPOINT_SYNC 2
|
|
1166
|
-
#define TAP_OPAQUE_OPEN_CHECKPOINT 3
|
|
1167
|
-
#define TAP_OPAQUE_COMPLETE_VB_FILTER_CHANGE 4
|
|
1168
|
-
#define TAP_OPAQUE_CLOSE_TAP_STREAM 7
|
|
1169
|
-
#define TAP_OPAQUE_CLOSE_BACKFILL 8
|
|
1170
|
-
|
|
1171
|
-
typedef protocol_binary_request_tap_no_extras protocol_binary_request_tap_opaque;
|
|
1172
|
-
typedef protocol_binary_request_tap_no_extras protocol_binary_request_tap_vbucket_set;
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* Definition of the packet used by the scrub.
|
|
1177
|
-
*/
|
|
1178
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_scrub;
|
|
1179
|
-
|
|
1180
|
-
/**
|
|
1181
|
-
* Definition of the packet returned from scrub.
|
|
1182
|
-
*/
|
|
1183
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_scrub;
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
/**
|
|
1187
|
-
* Definition of the packet used by set vbucket
|
|
1188
|
-
*/
|
|
1189
|
-
typedef union {
|
|
1190
|
-
struct {
|
|
1191
|
-
protocol_binary_request_header header;
|
|
1192
|
-
struct {
|
|
1193
|
-
vbucket_state_t state;
|
|
1194
|
-
} body;
|
|
1195
|
-
} message;
|
|
1196
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + sizeof(vbucket_state_t)];
|
|
1197
|
-
} protocol_binary_request_set_vbucket;
|
|
1198
|
-
/**
|
|
1199
|
-
* Definition of the packet returned from set vbucket
|
|
1200
|
-
*/
|
|
1201
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_set_vbucket;
|
|
1202
|
-
/**
|
|
1203
|
-
* Definition of the packet used by del vbucket
|
|
1204
|
-
*/
|
|
1205
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_del_vbucket;
|
|
1206
|
-
/**
|
|
1207
|
-
* Definition of the packet returned from del vbucket
|
|
1208
|
-
*/
|
|
1209
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_del_vbucket;
|
|
1210
|
-
|
|
1211
|
-
/**
|
|
1212
|
-
* Definition of the packet used by get vbucket
|
|
1213
|
-
*/
|
|
1214
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_get_vbucket;
|
|
1215
|
-
|
|
1216
|
-
/**
|
|
1217
|
-
* Definition of the packet returned from get vbucket
|
|
1218
|
-
*/
|
|
1219
|
-
typedef union {
|
|
1220
|
-
struct {
|
|
1221
|
-
protocol_binary_response_header header;
|
|
1222
|
-
struct {
|
|
1223
|
-
vbucket_state_t state;
|
|
1224
|
-
} body;
|
|
1225
|
-
} message;
|
|
1226
|
-
uint8_t bytes[sizeof(protocol_binary_response_header) + sizeof(vbucket_state_t)];
|
|
1227
|
-
} protocol_binary_response_get_vbucket;
|
|
1228
|
-
|
|
1229
659
|
/**
|
|
1230
660
|
* Definition of hello's features.
|
|
1231
661
|
*/
|
|
@@ -1234,7 +664,8 @@ extern "C"
|
|
|
1234
664
|
PROTOCOL_BINARY_FEATURE_TLS = 0x2,
|
|
1235
665
|
PROTOCOL_BINARY_FEATURE_TCPNODELAY = 0x03,
|
|
1236
666
|
PROTOCOL_BINARY_FEATURE_MUTATION_SEQNO = 0x04,
|
|
1237
|
-
PROTOCOL_BINARY_FEATURE_TCPDELAY = 0x05
|
|
667
|
+
PROTOCOL_BINARY_FEATURE_TCPDELAY = 0x05,
|
|
668
|
+
PROTOCOL_BINARY_FEATURE_XATTR = 0x06
|
|
1238
669
|
} protocol_binary_hello_features;
|
|
1239
670
|
|
|
1240
671
|
#define MEMCACHED_FIRST_HELLO_FEATURE 0x01
|
|
@@ -1245,7 +676,8 @@ extern "C"
|
|
|
1245
676
|
(a == PROTOCOL_BINARY_FEATURE_TLS) ? "TLS" : \
|
|
1246
677
|
(a == PROTOCOL_BINARY_FEATURE_TCPNODELAY) ? "TCP NODELAY" : \
|
|
1247
678
|
(a == PROTOCOL_BINARY_FEATURE_MUTATION_SEQNO) ? "Mutation seqno" : \
|
|
1248
|
-
(a == PROTOCOL_BINARY_FEATURE_TCPDELAY) ? "TCP DELAY" :
|
|
679
|
+
(a == PROTOCOL_BINARY_FEATURE_TCPDELAY) ? "TCP DELAY" : \
|
|
680
|
+
(a == PROTOCOL_BINARY_FEATURE_XATTR) ? "XATTR" : "Unknown"
|
|
1249
681
|
|
|
1250
682
|
/**
|
|
1251
683
|
* The HELLO command is used by the client and the server to agree
|
|
@@ -1282,518 +714,21 @@ extern "C"
|
|
|
1282
714
|
*/
|
|
1283
715
|
typedef protocol_binary_response_no_extras protocol_binary_response_hello;
|
|
1284
716
|
|
|
1285
|
-
/**
|
|
1286
|
-
* The SET_CTRL_TOKEN command will be used by ns_server and ns_server alone
|
|
1287
|
-
* to set the session cas token in memcached which will be used to
|
|
1288
|
-
* recognize the particular instance on ns_server. The previous token will
|
|
1289
|
-
* be passed in the cas section of the request header for the CAS operation,
|
|
1290
|
-
* and the new token will be part of ext (8B).
|
|
1291
|
-
*
|
|
1292
|
-
* The response to this request will include the cas as it were set,
|
|
1293
|
-
* and a SUCCESS as status, or a KEY_EEXISTS with the existing token in
|
|
1294
|
-
* memcached if the CAS operation were to fail.
|
|
1295
|
-
*/
|
|
1296
|
-
|
|
1297
|
-
/**
|
|
1298
|
-
* Definition of the request packet for SET_CTRL_TOKEN.
|
|
1299
|
-
* Body: new session_cas_token of uint64_t type.
|
|
1300
|
-
*/
|
|
1301
|
-
typedef union {
|
|
1302
|
-
struct {
|
|
1303
|
-
protocol_binary_request_header header;
|
|
1304
|
-
struct {
|
|
1305
|
-
uint64_t new_cas;
|
|
1306
|
-
} body;
|
|
1307
|
-
} message;
|
|
1308
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
|
|
1309
|
-
} protocol_binary_request_set_ctrl_token;
|
|
1310
|
-
|
|
1311
|
-
/**
|
|
1312
|
-
* Definition of the response packet for SET_CTRL_TOKEN
|
|
1313
|
-
*/
|
|
1314
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_set_ctrl_token;
|
|
1315
|
-
|
|
1316
|
-
/**
|
|
1317
|
-
* The GET_CTRL_TOKEN command will be used by ns_server to fetch the current
|
|
1318
|
-
* session cas token held in memcached.
|
|
1319
|
-
*
|
|
1320
|
-
* The response to this request will include the token currently held in
|
|
1321
|
-
* memcached in the cas field of the header.
|
|
1322
|
-
*/
|
|
1323
|
-
|
|
1324
|
-
/**
|
|
1325
|
-
* Definition of the request packet for GET_CTRL_TOKEN.
|
|
1326
|
-
*/
|
|
1327
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_get_ctrl_token;
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
/**
|
|
1331
|
-
* Definition of the response packet for GET_CTRL_TOKEN
|
|
1332
|
-
*/
|
|
1333
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_get_ctrl_token;
|
|
1334
|
-
|
|
1335
|
-
/* DCP related stuff */
|
|
1336
|
-
typedef union {
|
|
1337
|
-
struct {
|
|
1338
|
-
protocol_binary_request_header header;
|
|
1339
|
-
struct {
|
|
1340
|
-
uint32_t seqno;
|
|
1341
|
-
/*
|
|
1342
|
-
* The following flags are defined
|
|
1343
|
-
*/
|
|
1344
|
-
#define DCP_OPEN_PRODUCER 1
|
|
1345
|
-
#define DCP_OPEN_NOTIFIER 2
|
|
1346
|
-
uint32_t flags;
|
|
1347
|
-
} body;
|
|
1348
|
-
} message;
|
|
1349
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
|
|
1350
|
-
} protocol_binary_request_dcp_open;
|
|
1351
|
-
|
|
1352
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_open;
|
|
1353
|
-
|
|
1354
|
-
typedef union {
|
|
1355
|
-
struct {
|
|
1356
|
-
protocol_binary_request_header header;
|
|
1357
|
-
struct {
|
|
1358
|
-
/*
|
|
1359
|
-
* The following flags are defined
|
|
1360
|
-
*/
|
|
1361
|
-
#define DCP_ADD_STREAM_FLAG_TAKEOVER 1
|
|
1362
|
-
#define DCP_ADD_STREAM_FLAG_DISKONLY 2
|
|
1363
|
-
#define DCP_ADD_STREAM_FLAG_LATEST 4
|
|
1364
|
-
uint32_t flags;
|
|
1365
|
-
} body;
|
|
1366
|
-
} message;
|
|
1367
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
1368
|
-
} protocol_binary_request_dcp_add_stream;
|
|
1369
|
-
|
|
1370
|
-
typedef union {
|
|
1371
|
-
struct {
|
|
1372
|
-
protocol_binary_response_header header;
|
|
1373
|
-
struct {
|
|
1374
|
-
uint32_t opaque;
|
|
1375
|
-
} body;
|
|
1376
|
-
} message;
|
|
1377
|
-
uint8_t bytes[sizeof(protocol_binary_response_header) + 4];
|
|
1378
|
-
} protocol_binary_response_dcp_add_stream;
|
|
1379
|
-
|
|
1380
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_dcp_close_stream;
|
|
1381
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_close_stream;
|
|
1382
|
-
|
|
1383
|
-
typedef union {
|
|
1384
|
-
struct {
|
|
1385
|
-
protocol_binary_request_header header;
|
|
1386
|
-
struct {
|
|
1387
|
-
uint32_t flags;
|
|
1388
|
-
uint32_t reserved;
|
|
1389
|
-
uint64_t start_seqno;
|
|
1390
|
-
uint64_t end_seqno;
|
|
1391
|
-
uint64_t vbucket_uuid;
|
|
1392
|
-
uint64_t snap_start_seqno;
|
|
1393
|
-
uint64_t snap_end_seqno;
|
|
1394
|
-
} body;
|
|
1395
|
-
/* Group ID is specified in the key */
|
|
1396
|
-
} message;
|
|
1397
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 48];
|
|
1398
|
-
} protocol_binary_request_dcp_stream_req;
|
|
1399
|
-
|
|
1400
|
-
typedef union {
|
|
1401
|
-
struct {
|
|
1402
|
-
protocol_binary_response_header header;
|
|
1403
|
-
} message;
|
|
1404
|
-
/*
|
|
1405
|
-
** In case of PROTOCOL_BINARY_RESPONSE_ROLLBACK the body contains
|
|
1406
|
-
** the rollback sequence number (uint64_t)
|
|
1407
|
-
*/
|
|
1408
|
-
uint8_t bytes[sizeof(protocol_binary_request_header)];
|
|
1409
|
-
} protocol_binary_response_dcp_stream_req;
|
|
1410
|
-
|
|
1411
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_dcp_get_failover_log;
|
|
1412
|
-
|
|
1413
|
-
/* The body of the message contains UUID/SEQNO pairs */
|
|
1414
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_get_failover_log;
|
|
1415
|
-
|
|
1416
|
-
typedef union {
|
|
1417
|
-
struct {
|
|
1418
|
-
protocol_binary_request_header header;
|
|
1419
|
-
struct {
|
|
1420
|
-
/**
|
|
1421
|
-
* All flags set to 0 == OK,
|
|
1422
|
-
* 1: state changed
|
|
1423
|
-
*/
|
|
1424
|
-
uint32_t flags;
|
|
1425
|
-
} body;
|
|
1426
|
-
} message;
|
|
1427
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
1428
|
-
} protocol_binary_request_dcp_stream_end;
|
|
1429
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_stream_end;
|
|
1430
|
-
|
|
1431
|
-
typedef union {
|
|
1432
|
-
struct {
|
|
1433
|
-
protocol_binary_request_header header;
|
|
1434
|
-
struct {
|
|
1435
|
-
uint64_t start_seqno;
|
|
1436
|
-
uint64_t end_seqno;
|
|
1437
|
-
uint32_t flags;
|
|
1438
|
-
} body;
|
|
1439
|
-
} message;
|
|
1440
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 20];
|
|
1441
|
-
} protocol_binary_request_dcp_snapshot_marker;
|
|
1442
|
-
|
|
1443
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_snapshot_marker;
|
|
1444
|
-
|
|
1445
|
-
typedef union {
|
|
1446
|
-
struct {
|
|
1447
|
-
protocol_binary_request_header header;
|
|
1448
|
-
struct {
|
|
1449
|
-
uint64_t by_seqno;
|
|
1450
|
-
uint64_t rev_seqno;
|
|
1451
|
-
uint32_t flags;
|
|
1452
|
-
uint32_t expiration;
|
|
1453
|
-
uint32_t lock_time;
|
|
1454
|
-
uint16_t nmeta;
|
|
1455
|
-
uint8_t nru;
|
|
1456
|
-
} body;
|
|
1457
|
-
} message;
|
|
1458
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 31];
|
|
1459
|
-
} protocol_binary_request_dcp_mutation;
|
|
1460
|
-
|
|
1461
|
-
typedef union {
|
|
1462
|
-
struct {
|
|
1463
|
-
protocol_binary_request_header header;
|
|
1464
|
-
struct {
|
|
1465
|
-
uint64_t by_seqno;
|
|
1466
|
-
uint64_t rev_seqno;
|
|
1467
|
-
uint16_t nmeta;
|
|
1468
|
-
} body;
|
|
1469
|
-
} message;
|
|
1470
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 18];
|
|
1471
|
-
} protocol_binary_request_dcp_deletion;
|
|
1472
|
-
|
|
1473
|
-
typedef protocol_binary_request_dcp_deletion protocol_binary_request_dcp_expiration;
|
|
1474
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_dcp_flush;
|
|
1475
|
-
|
|
1476
|
-
typedef union {
|
|
1477
|
-
struct {
|
|
1478
|
-
protocol_binary_request_header header;
|
|
1479
|
-
struct {
|
|
1480
|
-
/**
|
|
1481
|
-
* 0x01 - Active
|
|
1482
|
-
* 0x02 - Replica
|
|
1483
|
-
* 0x03 - Pending
|
|
1484
|
-
* 0x04 - Dead
|
|
1485
|
-
*/
|
|
1486
|
-
uint8_t state;
|
|
1487
|
-
} body;
|
|
1488
|
-
} message;
|
|
1489
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 1];
|
|
1490
|
-
} protocol_binary_request_dcp_set_vbucket_state;
|
|
1491
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_set_vbucket_state;
|
|
1492
|
-
|
|
1493
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_dcp_noop;
|
|
1494
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_noop;
|
|
1495
|
-
|
|
1496
|
-
typedef union {
|
|
1497
|
-
struct {
|
|
1498
|
-
protocol_binary_request_header header;
|
|
1499
|
-
struct {
|
|
1500
|
-
uint32_t buffer_bytes;
|
|
1501
|
-
} body;
|
|
1502
|
-
} message;
|
|
1503
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
1504
|
-
} protocol_binary_request_dcp_buffer_acknowledgement;
|
|
1505
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_buffer_acknowledgement;
|
|
1506
|
-
|
|
1507
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_dcp_control;
|
|
1508
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_dcp_control;
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
/**
|
|
1512
|
-
* IOCTL_GET command message to get/set control parameters.
|
|
1513
|
-
*/
|
|
1514
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_ioctl_get;
|
|
1515
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_ioctl_set;
|
|
1516
|
-
|
|
1517
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_config_validate;
|
|
1518
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_config_reload;
|
|
1519
|
-
|
|
1520
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_ssl_refresh;
|
|
1521
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_ssl_refresh;
|
|
1522
|
-
|
|
1523
|
-
/**
|
|
1524
|
-
* Request command timings for a bucket from memcached. Privileged
|
|
1525
|
-
* connections may specify the name of the bucket in the "key" field,
|
|
1526
|
-
* or the aggregated timings for the entire server by using the
|
|
1527
|
-
* special name <code>/all/</code>.
|
|
1528
|
-
*
|
|
1529
|
-
* The returned payload is a json document of the following format:
|
|
1530
|
-
* { "us" : [ x, x, x, x, ... ],
|
|
1531
|
-
* "ms" : [ y, y, y, ...],
|
|
1532
|
-
* "500ms" : [ z, z, z, ...],
|
|
1533
|
-
* "wayout" : nnn
|
|
1534
|
-
* }
|
|
1535
|
-
*/
|
|
1536
|
-
typedef union {
|
|
1537
|
-
struct {
|
|
1538
|
-
protocol_binary_request_header header;
|
|
1539
|
-
struct {
|
|
1540
|
-
uint8_t opcode;
|
|
1541
|
-
} body;
|
|
1542
|
-
} message;
|
|
1543
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 1];
|
|
1544
|
-
} protocol_binary_request_get_cmd_timer;
|
|
1545
|
-
|
|
1546
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_get_cmd_timer;
|
|
1547
|
-
|
|
1548
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_create_bucket;
|
|
1549
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_delete_bucket;
|
|
1550
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_list_buckets;
|
|
1551
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_select_bucket;
|
|
1552
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_assume_role;
|
|
1553
|
-
|
|
1554
|
-
/*
|
|
1555
|
-
* Parameter types of CMD_SET_PARAM command.
|
|
1556
|
-
*/
|
|
1557
|
-
typedef enum {
|
|
1558
|
-
protocol_binary_engine_param_flush = 1, /* flusher-related param type */
|
|
1559
|
-
protocol_binary_engine_param_tap, /* tap-related param type */
|
|
1560
|
-
protocol_binary_engine_param_checkpoint /* checkpoint-related param type */
|
|
1561
|
-
} protocol_binary_engine_param_t;
|
|
1562
|
-
|
|
1563
|
-
/**
|
|
1564
|
-
* CMD_SET_PARAM command message to set engine parameters.
|
|
1565
|
-
* flush, tap, and checkpoint parameter types are currently supported.
|
|
1566
|
-
*/
|
|
1567
|
-
typedef union {
|
|
1568
|
-
struct {
|
|
1569
|
-
protocol_binary_request_header header;
|
|
1570
|
-
struct {
|
|
1571
|
-
protocol_binary_engine_param_t param_type;
|
|
1572
|
-
} body;
|
|
1573
|
-
} message;
|
|
1574
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + sizeof(protocol_binary_engine_param_t)];
|
|
1575
|
-
} protocol_binary_request_set_param;
|
|
1576
|
-
|
|
1577
|
-
typedef union {
|
|
1578
|
-
struct {
|
|
1579
|
-
protocol_binary_request_header header;
|
|
1580
|
-
struct {
|
|
1581
|
-
uint32_t size;
|
|
1582
|
-
} body;
|
|
1583
|
-
} message;
|
|
1584
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
1585
|
-
} protocol_binary_request_set_batch_count;
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
/**
|
|
1589
|
-
* This flag is used by the setWithMeta/addWithMeta/deleteWithMeta packets
|
|
1590
|
-
* to specify that the conflict resolution mechanism should be skipped for
|
|
1591
|
-
* this operation.
|
|
1592
|
-
*/
|
|
1593
|
-
#define SKIP_CONFLICT_RESOLUTION_FLAG 0x01
|
|
1594
|
-
|
|
1595
|
-
#define SET_RET_META 1
|
|
1596
|
-
#define ADD_RET_META 2
|
|
1597
|
-
#define DEL_RET_META 3
|
|
1598
|
-
|
|
1599
|
-
/**
|
|
1600
|
-
* This flag is used with the get meta response packet. If set it
|
|
1601
|
-
* specifies that the item recieved has been deleted, but that the
|
|
1602
|
-
* items meta data is still contained in ep-engine. Eg. the item
|
|
1603
|
-
* has been soft deleted.
|
|
1604
|
-
*/
|
|
1605
|
-
#define GET_META_ITEM_DELETED_FLAG 0x01
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
/**
|
|
1609
|
-
* The physical layout for the CMD_SET_WITH_META looks like the the normal
|
|
1610
|
-
* set request with the addition of a bulk of extra meta data stored
|
|
1611
|
-
* at the <b>end</b> of the package.
|
|
1612
|
-
*/
|
|
1613
|
-
typedef union {
|
|
1614
|
-
struct {
|
|
1615
|
-
protocol_binary_request_header header;
|
|
1616
|
-
struct {
|
|
1617
|
-
uint32_t flags;
|
|
1618
|
-
uint32_t expiration;
|
|
1619
|
-
uint64_t seqno;
|
|
1620
|
-
uint64_t cas;
|
|
1621
|
-
} body;
|
|
1622
|
-
} message;
|
|
1623
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 24];
|
|
1624
|
-
} protocol_binary_request_set_with_meta;
|
|
1625
|
-
|
|
1626
|
-
/**
|
|
1627
|
-
* The message format for delete with meta
|
|
1628
|
-
*/
|
|
1629
|
-
typedef protocol_binary_request_set_with_meta protocol_binary_request_delete_with_meta;
|
|
1630
|
-
|
|
1631
717
|
/**
|
|
1632
718
|
* The message format for getLocked engine API
|
|
1633
719
|
*/
|
|
1634
720
|
typedef protocol_binary_request_gat protocol_binary_request_getl;
|
|
1635
721
|
|
|
1636
|
-
/**
|
|
1637
|
-
* The physical layout for a CMD_GET_META command returns the meta-data
|
|
1638
|
-
* section for an item:
|
|
1639
|
-
*/
|
|
1640
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_get_meta;
|
|
1641
|
-
|
|
1642
|
-
/**
|
|
1643
|
-
* The response for CMD_SET_WITH_META does not carry any user-data and the
|
|
1644
|
-
* status of the operation is signalled in the status bits.
|
|
1645
|
-
*/
|
|
1646
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_set_with_meta;
|
|
1647
|
-
|
|
1648
|
-
typedef union {
|
|
1649
|
-
struct {
|
|
1650
|
-
protocol_binary_request_header header;
|
|
1651
|
-
struct {
|
|
1652
|
-
uint64_t file_version;
|
|
1653
|
-
uint64_t header_offset;
|
|
1654
|
-
uint32_t vbucket_state_updated;
|
|
1655
|
-
uint32_t state;
|
|
1656
|
-
uint64_t checkpoint;
|
|
1657
|
-
} body;
|
|
1658
|
-
} message;
|
|
1659
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 32];
|
|
1660
|
-
} protocol_binary_request_notify_vbucket_update;
|
|
1661
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_notify_vbucket_update;
|
|
1662
|
-
|
|
1663
|
-
/**
|
|
1664
|
-
* The physical layout for the CMD_RETURN_META
|
|
1665
|
-
*/
|
|
1666
|
-
typedef union {
|
|
1667
|
-
struct {
|
|
1668
|
-
protocol_binary_request_header header;
|
|
1669
|
-
struct {
|
|
1670
|
-
uint32_t mutation_type;
|
|
1671
|
-
uint32_t flags;
|
|
1672
|
-
uint32_t expiration;
|
|
1673
|
-
} body;
|
|
1674
|
-
} message;
|
|
1675
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 12];
|
|
1676
|
-
} protocol_binary_request_return_meta;
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* Message format for CMD_INIT_COMPLETE
|
|
1681
|
-
*/
|
|
1682
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_init_complete;
|
|
1683
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_init_complete;
|
|
1684
|
-
|
|
1685
|
-
/**
|
|
1686
|
-
* Message format for CMD_SET_CONFIG
|
|
1687
|
-
*/
|
|
1688
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_set_cluster_config;
|
|
1689
|
-
|
|
1690
722
|
/**
|
|
1691
723
|
* Message format for CMD_GET_CONFIG
|
|
1692
724
|
*/
|
|
1693
725
|
typedef protocol_binary_request_no_extras protocol_binary_request_get_cluster_config;
|
|
1694
726
|
|
|
1695
|
-
/**
|
|
1696
|
-
* Message format for CMD_GET_ADJUSTED_TIME
|
|
1697
|
-
*
|
|
1698
|
-
* The PROTOCOL_BINARY_CMD_GET_ADJUSTED_TIME command will be
|
|
1699
|
-
* used by XDCR to retrieve the vbucket's latest adjusted_time
|
|
1700
|
-
* which is calculated based on the driftCounter if timeSync
|
|
1701
|
-
* has been enabled.
|
|
1702
|
-
*
|
|
1703
|
-
* Request:-
|
|
1704
|
-
*
|
|
1705
|
-
* Header: Contains a vbucket id.
|
|
1706
|
-
*
|
|
1707
|
-
* Response:-
|
|
1708
|
-
*
|
|
1709
|
-
* The response will contain the adjusted_time (type: int64_t)
|
|
1710
|
-
* as part of the body if in case of a SUCCESS, or else a NOTSUP
|
|
1711
|
-
* in case of timeSync not being enabled.
|
|
1712
|
-
*
|
|
1713
|
-
* The request packet's header will contain the vbucket_id.
|
|
1714
|
-
*/
|
|
1715
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_get_adjusted_time;
|
|
1716
|
-
|
|
1717
|
-
/**
|
|
1718
|
-
* Message format for CMD_SET_DRIFT_COUNTER_STATE
|
|
1719
|
-
*
|
|
1720
|
-
* The PROTOCOL_BINARY_CMD_SET_DRIFT_COUNTER_STATE command will be
|
|
1721
|
-
* used by GO-XDCR to set the initial drift counter and enable/disable
|
|
1722
|
-
* the time synchronization for the vbucket.
|
|
1723
|
-
*
|
|
1724
|
-
* Request:-
|
|
1725
|
-
*
|
|
1726
|
-
* Header: Contains a vbucket id.
|
|
1727
|
-
* Extras: Contains the initial drift value which is of type int64_t and
|
|
1728
|
-
* the time sync state (0x00 for disable, 0x01 for enable),
|
|
1729
|
-
*
|
|
1730
|
-
* Response:-
|
|
1731
|
-
*
|
|
1732
|
-
* The response will return a SUCCESS after saving the settings and
|
|
1733
|
-
* a NOT_MY_VBUCKET (along with cluster config) if the vbucket isn't
|
|
1734
|
-
* found.
|
|
1735
|
-
*/
|
|
1736
|
-
typedef union {
|
|
1737
|
-
struct {
|
|
1738
|
-
protocol_binary_request_header header;
|
|
1739
|
-
struct {
|
|
1740
|
-
int64_t initial_drift;
|
|
1741
|
-
uint8_t time_sync;
|
|
1742
|
-
} body;
|
|
1743
|
-
} message;
|
|
1744
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 9];
|
|
1745
|
-
} protocol_binary_request_set_drift_counter_state;
|
|
1746
|
-
|
|
1747
|
-
/**
|
|
1748
|
-
* The physical layout for the CMD_COMPACT_DB
|
|
1749
|
-
*/
|
|
1750
|
-
typedef union {
|
|
1751
|
-
struct {
|
|
1752
|
-
protocol_binary_request_header header;
|
|
1753
|
-
struct {
|
|
1754
|
-
uint64_t purge_before_ts;
|
|
1755
|
-
uint64_t purge_before_seq;
|
|
1756
|
-
uint8_t drop_deletes;
|
|
1757
|
-
uint8_t align_pad1;
|
|
1758
|
-
uint16_t align_pad2;
|
|
1759
|
-
uint32_t align_pad3;
|
|
1760
|
-
} body;
|
|
1761
|
-
} message;
|
|
1762
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 24];
|
|
1763
|
-
} protocol_binary_request_compact_db;
|
|
1764
|
-
|
|
1765
|
-
typedef protocol_binary_request_get protocol_binary_request_get_random;
|
|
1766
|
-
|
|
1767
727
|
#define OBS_STATE_NOT_PERSISTED 0x00
|
|
1768
728
|
#define OBS_STATE_PERSISTED 0x01
|
|
1769
729
|
#define OBS_STATE_NOT_FOUND 0x80
|
|
1770
730
|
#define OBS_STATE_LOGICAL_DEL 0x81
|
|
1771
731
|
|
|
1772
|
-
/**
|
|
1773
|
-
* The physical layout for the PROTOCOL_BINARY_CMD_AUDIT_PUT
|
|
1774
|
-
*/
|
|
1775
|
-
typedef union {
|
|
1776
|
-
struct {
|
|
1777
|
-
protocol_binary_request_header header;
|
|
1778
|
-
struct {
|
|
1779
|
-
uint32_t id;
|
|
1780
|
-
} body;
|
|
1781
|
-
} message;
|
|
1782
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
1783
|
-
} protocol_binary_request_audit_put;
|
|
1784
|
-
|
|
1785
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_audit_put;
|
|
1786
|
-
|
|
1787
|
-
/**
|
|
1788
|
-
* The shutdown message is sent from ns_server to memcached to tell
|
|
1789
|
-
* memcached to initiate a clean shutdown. This is a privileged
|
|
1790
|
-
* command and carries no payload, but the CAS field needs to be
|
|
1791
|
-
* set to the current session token (see GET/SET_CTRL_TOKEN)
|
|
1792
|
-
*/
|
|
1793
|
-
typedef protocol_binary_request_no_extras protocol_binary_request_shutdown;
|
|
1794
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_shutdown;
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
732
|
/**
|
|
1798
733
|
* The PROTOCOL_BINARY_CMD_OBSERVE_SEQNO command is used by the
|
|
1799
734
|
* client to retrieve information about the vbucket in order to
|
|
@@ -1861,52 +796,6 @@ extern "C"
|
|
|
1861
796
|
*/
|
|
1862
797
|
typedef protocol_binary_response_no_extras protocol_binary_response_observe_seqno;
|
|
1863
798
|
|
|
1864
|
-
/**
|
|
1865
|
-
* Definition of the request packet for the command
|
|
1866
|
-
* PROTOCOL_BINARY_CMD_GET_ALL_VB_SEQNOS
|
|
1867
|
-
*
|
|
1868
|
-
* Header: Only opcode field is used.
|
|
1869
|
-
*
|
|
1870
|
-
* Body: Contains the vbucket state for which the vb sequence numbers are
|
|
1871
|
-
* requested.
|
|
1872
|
-
* Please note that this field is optional, header.request.extlen is
|
|
1873
|
-
* checked to see if it is present. If not present, it implies request
|
|
1874
|
-
* is for all vbucket states.
|
|
1875
|
-
*/
|
|
1876
|
-
typedef union {
|
|
1877
|
-
struct {
|
|
1878
|
-
protocol_binary_request_header header;
|
|
1879
|
-
struct {
|
|
1880
|
-
vbucket_state_t state;
|
|
1881
|
-
} body;
|
|
1882
|
-
} message;
|
|
1883
|
-
uint8_t bytes[sizeof(protocol_binary_request_header) +
|
|
1884
|
-
sizeof(vbucket_state_t)];
|
|
1885
|
-
} protocol_binary_request_get_all_vb_seqnos;
|
|
1886
|
-
|
|
1887
|
-
/**
|
|
1888
|
-
* Definition of the payload in the PROTOCOL_BINARY_CMD_GET_ALL_VB_SEQNOS
|
|
1889
|
-
* response.
|
|
1890
|
-
*
|
|
1891
|
-
* The body contains a "list" of "vbucket id - seqno pairs" for all
|
|
1892
|
-
* active and replica buckets on the node in network byte order.
|
|
1893
|
-
*
|
|
1894
|
-
*
|
|
1895
|
-
* Byte/ 0 | 1 | 2 | 3 |
|
|
1896
|
-
* / | | | |
|
|
1897
|
-
* |0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|
|
|
1898
|
-
* +---------------+---------------+---------------+---------------+
|
|
1899
|
-
* 0| VBID | VBID | SEQNO | SEQNO |
|
|
1900
|
-
* +---------------+---------------+---------------+---------------+
|
|
1901
|
-
* 4| SEQNO | SEQNO | SEQNO | SEQNO |
|
|
1902
|
-
* +---------------+---------------+---------------+---------------+
|
|
1903
|
-
* 4| SEQNO | SEQNO |
|
|
1904
|
-
* +---------------+---------------+
|
|
1905
|
-
*/
|
|
1906
|
-
typedef protocol_binary_response_no_extras protocol_binary_response_get_all_vb_seqnos;
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
799
|
/**
|
|
1911
800
|
* @}
|
|
1912
801
|
*/
|