libcouchbase 0.3.3 → 1.0.0
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/CMakeLists.txt +6 -8
- data/ext/libcouchbase/README.markdown +2 -2
- data/ext/libcouchbase/RELEASE_NOTES.markdown +229 -2
- data/ext/libcouchbase/cmake/Modules/ConfigureDtrace.cmake +11 -0
- data/ext/libcouchbase/cmake/Modules/GenerateConfigDotH.cmake +18 -0
- data/ext/libcouchbase/cmake/Modules/GetLibcouchbaseFlags.cmake +3 -2
- data/ext/libcouchbase/cmake/Modules/GetVersionInfo.cmake +3 -3
- data/ext/libcouchbase/cmake/config-cmake.h.in +4 -0
- data/ext/libcouchbase/cmake/defs.mk.in +0 -2
- data/ext/libcouchbase/cmake/source_files.cmake +21 -5
- data/ext/libcouchbase/contrib/cJSON/cJSON.c +1 -1
- data/ext/libcouchbase/contrib/cbsasl/src/client.c +2 -0
- data/ext/libcouchbase/example/users/README +48 -0
- data/ext/libcouchbase/example/users/users.c +147 -0
- data/ext/libcouchbase/include/libcouchbase/auth.h +175 -31
- data/ext/libcouchbase/include/libcouchbase/cntl.h +82 -1
- data/ext/libcouchbase/include/libcouchbase/couchbase.h +45 -3
- data/ext/libcouchbase/include/libcouchbase/error.h +19 -1
- data/ext/libcouchbase/include/libcouchbase/iops.h +3 -0
- data/ext/libcouchbase/include/libcouchbase/n1ql.h +31 -1
- data/ext/libcouchbase/include/libcouchbase/plugins/io/bsdio-inl.c +4 -1
- data/ext/libcouchbase/include/libcouchbase/subdoc.h +36 -2
- 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 +24 -1146
- 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 +23 -4
- data/ext/libcouchbase/src/auth.cc +51 -43
- data/ext/libcouchbase/src/bootstrap.cc +244 -0
- data/ext/libcouchbase/src/bootstrap.h +58 -38
- data/ext/libcouchbase/src/bucketconfig/bc_cccp.cc +120 -158
- data/ext/libcouchbase/src/bucketconfig/bc_file.cc +281 -0
- data/ext/libcouchbase/src/bucketconfig/bc_http.cc +526 -0
- data/ext/libcouchbase/src/bucketconfig/bc_http.h +50 -25
- data/ext/libcouchbase/src/bucketconfig/bc_static.cc +150 -0
- data/ext/libcouchbase/src/bucketconfig/clconfig.h +410 -386
- data/ext/libcouchbase/src/bucketconfig/confmon.cc +393 -0
- data/ext/libcouchbase/src/cbft.cc +22 -27
- data/ext/libcouchbase/src/cntl.cc +56 -22
- data/ext/libcouchbase/src/connspec.cc +47 -6
- data/ext/libcouchbase/src/connspec.h +27 -0
- data/ext/libcouchbase/src/dns-srv.cc +147 -0
- data/ext/libcouchbase/src/dump.cc +3 -3
- data/ext/libcouchbase/src/errmap.cc +173 -0
- data/ext/libcouchbase/src/errmap.h +198 -0
- data/ext/libcouchbase/src/getconfig.cc +7 -33
- data/ext/libcouchbase/src/handler.cc +118 -7
- data/ext/libcouchbase/src/hostlist.cc +0 -36
- data/ext/libcouchbase/src/hostlist.h +44 -62
- data/ext/libcouchbase/src/http/http-priv.h +125 -112
- data/ext/libcouchbase/src/http/http.cc +27 -35
- data/ext/libcouchbase/src/http/http.h +1 -34
- data/ext/libcouchbase/src/http/http_io.cc +28 -36
- data/ext/libcouchbase/src/instance.cc +131 -34
- data/ext/libcouchbase/src/internal.h +58 -26
- data/ext/libcouchbase/src/jsparse/parser.cc +136 -210
- data/ext/libcouchbase/src/jsparse/parser.h +84 -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 +569 -0
- data/ext/libcouchbase/src/lcbio/connect.h +16 -7
- data/ext/libcouchbase/src/lcbio/ctx.c +1 -1
- data/ext/libcouchbase/src/lcbio/iotable.h +101 -16
- data/ext/libcouchbase/src/lcbio/{ioutils.c → ioutils.cc} +30 -51
- data/ext/libcouchbase/src/lcbio/ioutils.h +29 -90
- data/ext/libcouchbase/src/lcbio/manager.cc +543 -0
- data/ext/libcouchbase/src/lcbio/manager.h +133 -96
- data/ext/libcouchbase/src/lcbio/protoctx.c +2 -2
- data/ext/libcouchbase/src/lcbio/timer-cxx.h +87 -0
- data/ext/libcouchbase/src/mc/mcreq.c +11 -2
- data/ext/libcouchbase/src/mc/mcreq.h +9 -2
- data/ext/libcouchbase/src/mcserver/mcserver.cc +175 -43
- data/ext/libcouchbase/src/mcserver/mcserver.h +9 -13
- data/ext/libcouchbase/src/mcserver/negotiate.cc +181 -62
- data/ext/libcouchbase/src/mcserver/negotiate.h +1 -3
- 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 +74 -42
- data/ext/libcouchbase/src/netbuf/netbuf.c +4 -4
- data/ext/libcouchbase/src/newconfig.cc +6 -6
- data/ext/libcouchbase/src/nodeinfo.cc +2 -2
- 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.cc +6 -26
- data/ext/libcouchbase/src/operations/durability_internal.h +6 -3
- data/ext/libcouchbase/src/operations/{get.c → get.cc} +24 -26
- data/ext/libcouchbase/src/operations/{observe.c → observe.cc} +68 -93
- 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.cc +3 -8
- data/ext/libcouchbase/src/operations/{store.c → store.cc} +27 -32
- data/ext/libcouchbase/src/operations/subdoc.cc +129 -42
- data/ext/libcouchbase/src/operations/{touch.c → touch.cc} +0 -0
- data/ext/libcouchbase/src/packetutils.h +30 -2
- data/ext/libcouchbase/src/probes.d +1 -1
- data/ext/libcouchbase/src/rdb/rope.c +1 -1
- data/ext/libcouchbase/src/{retrychk.c → retrychk.cc} +2 -3
- data/ext/libcouchbase/src/retryq.cc +52 -14
- data/ext/libcouchbase/src/retryq.h +3 -3
- data/ext/libcouchbase/src/settings.c +5 -0
- data/ext/libcouchbase/src/settings.h +11 -0
- data/ext/libcouchbase/src/ssl/ssl_c.c +1 -0
- data/ext/libcouchbase/src/ssl/ssl_common.c +2 -0
- data/ext/libcouchbase/src/ssl/ssl_e.c +0 -1
- data/ext/libcouchbase/src/strcodecs/strcodecs.h +1 -1
- data/ext/libcouchbase/src/trace.h +4 -4
- data/ext/libcouchbase/src/vbucket/vbucket.c +6 -10
- 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/tests/basic/t_connstr.cc +88 -50
- data/ext/libcouchbase/tests/basic/t_creds.cc +47 -5
- data/ext/libcouchbase/tests/basic/t_host.cc +67 -75
- data/ext/libcouchbase/tests/basic/t_jsparse.cc +27 -82
- data/ext/libcouchbase/tests/basic/t_misc.cc +1 -1
- data/ext/libcouchbase/tests/basic/t_n1qlstrings.cc +0 -1
- data/ext/libcouchbase/tests/htparse/t_basic.cc +58 -78
- data/ext/libcouchbase/tests/ioserver/connection.cc +1 -1
- data/ext/libcouchbase/tests/ioserver/ioserver.cc +19 -6
- data/ext/libcouchbase/tests/iotests/mock-environment.cc +28 -2
- data/ext/libcouchbase/tests/iotests/mock-environment.h +51 -1
- data/ext/libcouchbase/tests/iotests/t_behavior.cc +1 -7
- data/ext/libcouchbase/tests/iotests/t_confmon.cc +97 -115
- data/ext/libcouchbase/tests/iotests/t_durability.cc +0 -1
- data/ext/libcouchbase/tests/iotests/t_eerrs.cc +119 -0
- data/ext/libcouchbase/tests/iotests/t_errmap.cc +178 -0
- data/ext/libcouchbase/tests/iotests/t_misc.cc +3 -3
- data/ext/libcouchbase/tests/iotests/t_netfail.cc +1 -1
- data/ext/libcouchbase/tests/iotests/t_obseqno.cc +0 -1
- data/ext/libcouchbase/tests/iotests/t_subdoc.cc +18 -11
- data/ext/libcouchbase/tests/mc/t_alloc.cc +9 -9
- data/ext/libcouchbase/tests/socktests/socktest.cc +7 -10
- data/ext/libcouchbase/tests/socktests/socktest.h +2 -3
- data/ext/libcouchbase/tests/socktests/t_basic.cc +6 -6
- data/ext/libcouchbase/tests/socktests/t_manager.cc +5 -6
- data/ext/libcouchbase/tests/socktests/t_ssl.cc +1 -1
- data/ext/libcouchbase/tests/vbucket/confdata/ketama_expected.json +2562 -0
- data/ext/libcouchbase/tests/vbucket/confdata/memd_ketama_config.json +31 -0
- data/ext/libcouchbase/tests/vbucket/t_config.cc +35 -5
- data/ext/libcouchbase/tools/CMakeLists.txt +2 -2
- data/ext/libcouchbase/tools/cbc-handlers.h +128 -0
- data/ext/libcouchbase/tools/cbc-n1qlback.cc +64 -10
- data/ext/libcouchbase/tools/cbc-pillowfight.cc +2 -2
- data/ext/libcouchbase/tools/cbc.cc +143 -10
- data/ext/libcouchbase/tools/docgen/loc.h +1 -1
- data/lib/libcouchbase/connection.rb +4 -3
- data/lib/libcouchbase/version.rb +1 -1
- metadata +37 -28
- data/ext/libcouchbase/include/memcached/vbucket.h +0 -42
- data/ext/libcouchbase/src/bootstrap.c +0 -269
- 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/lcbht/lcbht.c +0 -282
- data/ext/libcouchbase/src/lcbio/connect.c +0 -557
- data/ext/libcouchbase/src/lcbio/manager.c +0 -584
- data/ext/libcouchbase/src/packetutils.c +0 -37
- 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
|
@@ -924,8 +924,89 @@ typedef const char *lcb_BUCKETCRED[2];
|
|
|
924
924
|
*/
|
|
925
925
|
#define LCB_CNTL_READ_CHUNKSIZE 0x42
|
|
926
926
|
|
|
927
|
+
/**
|
|
928
|
+
* Enable/Disable the Error Map feature. This is disabled by default.
|
|
929
|
+
* Works only on servers which support error map
|
|
930
|
+
*
|
|
931
|
+
* Use `enable_errmap` in the connection string
|
|
932
|
+
*
|
|
933
|
+
* @volatile
|
|
934
|
+
* @cntl_arg_both{int* (as boolean)}
|
|
935
|
+
*/
|
|
936
|
+
#define LCB_CNTL_ENABLE_ERRMAP 0x43
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* Enable/Disable sending the SELECT_BUCKET command after authentication.
|
|
940
|
+
* This is useful to test auth, and should not be set by end-users.
|
|
941
|
+
*
|
|
942
|
+
* Note that even if this feature is enabled (the default), the client will
|
|
943
|
+
* only send `SELECT_BUCKET` if the server indicates that it is supported
|
|
944
|
+
* during negotiation.
|
|
945
|
+
*
|
|
946
|
+
* Use `select_bucket` in the connection string
|
|
947
|
+
*
|
|
948
|
+
* @volatile
|
|
949
|
+
* @cntl_arg_both{int* (as boolean)}
|
|
950
|
+
*/
|
|
951
|
+
#define LCB_CNTL_SELECT_BUCKET 0x44
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* Enable/Disable setting the `TCP_KEEPALIVE` option on created sockets.
|
|
955
|
+
* This is enabled by default for I/O backends which support it.
|
|
956
|
+
*
|
|
957
|
+
* The keepalive interval will be set to the operating system default.
|
|
958
|
+
*
|
|
959
|
+
* @committed
|
|
960
|
+
* @cntl_arg_both{int* (as boolean)}
|
|
961
|
+
*/
|
|
962
|
+
#define LCB_CNTL_TCP_KEEPALIVE 0x45
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* Set the amount of time to wait in between polling for a new configuration.
|
|
966
|
+
* This will have no effect if connected to a Memcached buckets, or using
|
|
967
|
+
* HTTP or File-based configurations (see the `bootstrap_on` connection
|
|
968
|
+
* string option).
|
|
969
|
+
*
|
|
970
|
+
* This option facilitates 'fast failover' - in that the client can preemptively
|
|
971
|
+
* check for any cluster topology updates before encountering an error.
|
|
972
|
+
*
|
|
973
|
+
* @volatile
|
|
974
|
+
* @cntl_arg_both{lcb_U32*}
|
|
975
|
+
*
|
|
976
|
+
* The value for this option is a time value. See the top of this header
|
|
977
|
+
* in respect to how to specify this.
|
|
978
|
+
*
|
|
979
|
+
* Using a value of `0` disables this feature.
|
|
980
|
+
*
|
|
981
|
+
* You can also use `config_poll_interval` in the connection string.
|
|
982
|
+
*
|
|
983
|
+
* @note
|
|
984
|
+
* Background polling is implemented in the library's non-blocking event loop.
|
|
985
|
+
* Synchronous clients (i.e. those using `lcb_wait()`) will only be able to
|
|
986
|
+
* poll as often as the library's event loop is active. If the library is
|
|
987
|
+
* suspended, that is, if not inside an `lcb_wait()` call, the library will
|
|
988
|
+
* be unable to do any kind of background polling.
|
|
989
|
+
*/
|
|
990
|
+
#define LCB_CNTL_CONFIG_POLL_INTERVAL 0x46
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* From version 2.7.4, the C library sends a HELLO command before
|
|
994
|
+
* authentication. This works on all modern server versions, but may cause
|
|
995
|
+
* disconnects on more ancient variants (Couchbase 2.x for example).
|
|
996
|
+
*
|
|
997
|
+
* This setting will disable the sending of the HELLO command (which older
|
|
998
|
+
* servers don't understand anyway). To disable the sending of hello, set this
|
|
999
|
+
* value to false.
|
|
1000
|
+
*
|
|
1001
|
+
* @uncommitted
|
|
1002
|
+
* @cntl_arg_both{int* (as boolean)}
|
|
1003
|
+
*
|
|
1004
|
+
* You can also use `send_hello=false` in the connection string.
|
|
1005
|
+
*/
|
|
1006
|
+
#define LCB_CNTL_SEND_HELLO 0x47
|
|
1007
|
+
|
|
927
1008
|
/** This is not a command, but rather an indicator of the last item */
|
|
928
|
-
#define LCB_CNTL__MAX
|
|
1009
|
+
#define LCB_CNTL__MAX 0x48
|
|
929
1010
|
/**@}*/
|
|
930
1011
|
|
|
931
1012
|
#ifdef __cplusplus
|
|
@@ -253,8 +253,18 @@ struct lcb_create_st2 { LCB_CREATE_V2_FIELDS };
|
|
|
253
253
|
*/
|
|
254
254
|
struct lcb_create_st3 {
|
|
255
255
|
const char *connstr; /**< Connection string */
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Username to use for authentication. This should only be set when
|
|
259
|
+
* connecting to a server 5.0 or greater.
|
|
260
|
+
*/
|
|
261
|
+
const char *username;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Password for bucket. Can also be password for username on servers >= 5.0
|
|
265
|
+
*/
|
|
266
|
+
const char *passwd;
|
|
267
|
+
|
|
258
268
|
void *_pad_bucket; /**< @private */
|
|
259
269
|
struct lcb_io_opt_st *io; /**< IO Options */
|
|
260
270
|
lcb_type_t type;
|
|
@@ -625,7 +635,10 @@ typedef enum {
|
|
|
625
635
|
|
|
626
636
|
/**Flag, only valid for subdoc responses, indicates that the response was
|
|
627
637
|
* processed using the single-operation protocol. */
|
|
628
|
-
LCB_RESP_F_SDSINGLE =
|
|
638
|
+
LCB_RESP_F_SDSINGLE = 0x10,
|
|
639
|
+
|
|
640
|
+
/**The response has extra error information as value (see SDK-RFC-28). */
|
|
641
|
+
LCB_RESP_F_ERRINFO = 0x20
|
|
629
642
|
} lcb_RESPFLAGS;
|
|
630
643
|
|
|
631
644
|
/**
|
|
@@ -3679,6 +3692,35 @@ lcb_histogram_read(const lcb_HISTOGRAM *hg, const void *cookie,
|
|
|
3679
3692
|
LCB_INTERNAL_API
|
|
3680
3693
|
void lcb_histogram_print(lcb_HISTOGRAM* hg, FILE* stream);
|
|
3681
3694
|
|
|
3695
|
+
/**
|
|
3696
|
+
* @volatile
|
|
3697
|
+
*
|
|
3698
|
+
* Retrieves the extra error context from the response structure.
|
|
3699
|
+
*
|
|
3700
|
+
* This context does not duplicate information described by status
|
|
3701
|
+
* code rendered by lcb_strerror() function, and should be logged
|
|
3702
|
+
* if available.
|
|
3703
|
+
*
|
|
3704
|
+
* @return the pointer to string or NULL if context wasn't specified.
|
|
3705
|
+
*/
|
|
3706
|
+
LIBCOUCHBASE_API
|
|
3707
|
+
const char *
|
|
3708
|
+
lcb_resp_get_error_context(int cbtype, const lcb_RESPBASE *rb);
|
|
3709
|
+
|
|
3710
|
+
/**
|
|
3711
|
+
* @volatile
|
|
3712
|
+
*
|
|
3713
|
+
* Retrieves the error reference id from the response structure.
|
|
3714
|
+
*
|
|
3715
|
+
* Error reference id (or event id) should be logged to allow
|
|
3716
|
+
* administrators match client-side events with cluster logs.
|
|
3717
|
+
*
|
|
3718
|
+
* @return the pointer to string or NULL if ref wasn't specified.
|
|
3719
|
+
*/
|
|
3720
|
+
LIBCOUCHBASE_API
|
|
3721
|
+
const char *
|
|
3722
|
+
lcb_resp_get_error_ref(int cbtype, const lcb_RESPBASE *rb);
|
|
3723
|
+
|
|
3682
3724
|
/* Post-include some other headers */
|
|
3683
3725
|
#ifdef __cplusplus
|
|
3684
3726
|
}
|
|
@@ -502,7 +502,18 @@ typedef enum {
|
|
|
502
502
|
X(LCB_UNKNOWN_SDCMD, 0x4D, LCB_ERRTYPE_INPUT, "Unknown subdocument command") \
|
|
503
503
|
X(LCB_ENO_COMMANDS, 0x4E, LCB_ERRTYPE_INPUT, "No commands specified") \
|
|
504
504
|
X(LCB_QUERY_ERROR, 0x4F, LCB_ERRTYPE_SRVGEN, \
|
|
505
|
-
"Query execution failed. Inspect raw response object for information")
|
|
505
|
+
"Query execution failed. Inspect raw response object for information") \
|
|
506
|
+
\
|
|
507
|
+
X(LCB_GENERIC_TMPERR, 0x50, LCB_ERRTYPE_TRANSIENT|LCB_ERRTYPE_SRVGEN, \
|
|
508
|
+
"Generic temporary error received from server") \
|
|
509
|
+
X(LCB_GENERIC_SUBDOCERR, 0x51, LCB_ERRTYPE_SUBDOC|LCB_ERRTYPE_SRVGEN, \
|
|
510
|
+
"Generic subdocument error received from server") \
|
|
511
|
+
X(LCB_GENERIC_CONSTRAINT_ERR, 0x52, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN, \
|
|
512
|
+
"Generic constraint error received from server") \
|
|
513
|
+
X(LCB_NAMESERVER_ERROR, 0x53, LCB_ERRTYPE_NETWORK, \
|
|
514
|
+
"Invalid reply received from nameserver") \
|
|
515
|
+
X(LCB_NOT_AUTHORIZED, 0x54, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN, \
|
|
516
|
+
"Not authorized for operation")
|
|
506
517
|
|
|
507
518
|
/** Error codes returned by the library. */
|
|
508
519
|
typedef enum {
|
|
@@ -566,6 +577,13 @@ int lcb_get_errtype(lcb_error_t err);
|
|
|
566
577
|
LIBCOUCHBASE_API
|
|
567
578
|
const char *lcb_strerror(lcb_t instance, lcb_error_t error);
|
|
568
579
|
|
|
580
|
+
/**
|
|
581
|
+
* Get a shorter textual description of an error message. This is the
|
|
582
|
+
* constant name
|
|
583
|
+
*/
|
|
584
|
+
LCB_INTERNAL_API
|
|
585
|
+
const char *lcb_strerror_short(lcb_error_t error);
|
|
586
|
+
|
|
569
587
|
/**
|
|
570
588
|
* This may be used in conjunction with the errmap callback if it wishes
|
|
571
589
|
* to fallback for default behavior for the given code.
|
|
@@ -380,6 +380,9 @@ typedef int (*lcb_ioE_chkclosed_fn)
|
|
|
380
380
|
/** Disable Nagle's algorithm (use an int) */
|
|
381
381
|
#define LCB_IO_CNTL_TCP_NODELAY 1
|
|
382
382
|
|
|
383
|
+
/** Enable/Disable TCP Keepalive */
|
|
384
|
+
#define LCB_IO_CNTL_TCP_KEEPALIVE 2
|
|
385
|
+
|
|
383
386
|
/**
|
|
384
387
|
* @brief Execute a specificied operation on a socket.
|
|
385
388
|
* @param iops The iops
|
|
@@ -261,6 +261,15 @@ lcb_n1p_mkcmd(lcb_N1QLPARAMS *params, lcb_CMDN1QL *cmd);
|
|
|
261
261
|
/** @private The lcb_CMDN1QL::query member is an internal JSON structure */
|
|
262
262
|
#define LCB_CMDN1QL_F_JSONQUERY 1<<17
|
|
263
263
|
|
|
264
|
+
/**
|
|
265
|
+
* This is an analytics query. Use the `host` field to specify the host/port
|
|
266
|
+
* to target. When this flag is set, things like prepared queries and
|
|
267
|
+
* parametrized statements will not work.
|
|
268
|
+
*
|
|
269
|
+
* @uncommited
|
|
270
|
+
*/
|
|
271
|
+
#define LCB_CMDN1QL_F_CBASQUERY 1<<18
|
|
272
|
+
|
|
264
273
|
/**
|
|
265
274
|
* Command structure for N1QL queries. Typically an application will use the
|
|
266
275
|
* lcb_N1QLPARAMS structure to populate the #query and #content_type fields.
|
|
@@ -287,7 +296,10 @@ struct lcb_CMDN1QL {
|
|
|
287
296
|
/** Length of the query data */
|
|
288
297
|
size_t nquery;
|
|
289
298
|
|
|
290
|
-
/**
|
|
299
|
+
/**
|
|
300
|
+
* Ignored since version 2.5.3.
|
|
301
|
+
* Starting from version 2.7.3, is used for experimental CBAS support
|
|
302
|
+
*/
|
|
291
303
|
const char *host;
|
|
292
304
|
|
|
293
305
|
/** Ignored since version 2.5.3 */
|
|
@@ -350,6 +362,24 @@ lcb_n1ql_query(lcb_t instance, const void *cookie, const lcb_CMDN1QL *cmd);
|
|
|
350
362
|
* @param instance the instance
|
|
351
363
|
* @param handle the handle for the request. This is obtained during the
|
|
352
364
|
* request as an 'out' parameter (see lcb_CMDN1QL::handle)
|
|
365
|
+
*
|
|
366
|
+
* To obtain the `handle` parameter, do something like this:
|
|
367
|
+
*
|
|
368
|
+
* @code{.c}
|
|
369
|
+
* lcb_N1QLHANDLE handle;
|
|
370
|
+
* lcb_CMDN1QL cmd;
|
|
371
|
+
* // (Initialize command...)
|
|
372
|
+
* cmd.handle = &handle;
|
|
373
|
+
* lcb_n1ql_query(instance, cookie, &cmd);
|
|
374
|
+
* @endcode.
|
|
375
|
+
*
|
|
376
|
+
* If the lcb_n1ql_query() function returns `LCB_SUCCESS` then the `handle`
|
|
377
|
+
* above is populated with the opaque handle. You can then use this handle
|
|
378
|
+
* to cancel the query at a later point, such as within the callback.
|
|
379
|
+
*
|
|
380
|
+
* @code{.c}
|
|
381
|
+
* lcb_n1ql_cancel(instance, handle);
|
|
382
|
+
* @endcode
|
|
353
383
|
*/
|
|
354
384
|
LIBCOUCHBASE_API
|
|
355
385
|
void
|
|
@@ -284,7 +284,7 @@ cntl_getset_impl(lcb_io_opt_t io, lcb_socket_t sock, int mode, int oslevel,
|
|
|
284
284
|
#ifndef _WIN32
|
|
285
285
|
socklen_t dummy = optsize;
|
|
286
286
|
#else
|
|
287
|
-
|
|
287
|
+
char dummy = optsize;
|
|
288
288
|
#endif
|
|
289
289
|
|
|
290
290
|
if (mode == LCB_IO_CNTL_GET) {
|
|
@@ -313,6 +313,9 @@ cntl_impl(lcb_io_opt_t io, lcb_socket_t sock, int mode, int option, void *arg)
|
|
|
313
313
|
case LCB_IO_CNTL_TCP_NODELAY:
|
|
314
314
|
return cntl_getset_impl(io,
|
|
315
315
|
sock, mode, IPPROTO_TCP, TCP_NODELAY, sizeof(int), arg);
|
|
316
|
+
case LCB_IO_CNTL_TCP_KEEPALIVE:
|
|
317
|
+
return cntl_getset_impl(io,
|
|
318
|
+
sock, mode, SOL_SOCKET, SO_KEEPALIVE, sizeof(int), arg);
|
|
316
319
|
default:
|
|
317
320
|
LCB_IOPS_ERRNO(io) = ENOTSUP;
|
|
318
321
|
return -1;
|
|
@@ -138,6 +138,16 @@ typedef enum {
|
|
|
138
138
|
*/
|
|
139
139
|
LCB_SDCMD_GET_COUNT,
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Retrieve the entire document
|
|
143
|
+
*/
|
|
144
|
+
LCB_SDCMD_GET_FULLDOC,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Replace the entire document
|
|
148
|
+
*/
|
|
149
|
+
LCB_SDCMD_SET_FULLDOC,
|
|
150
|
+
|
|
141
151
|
LCB_SDCMD_MAX
|
|
142
152
|
} lcb_SUBDOCOP;
|
|
143
153
|
|
|
@@ -177,8 +187,14 @@ typedef struct {
|
|
|
177
187
|
/** Create intermediate paths */
|
|
178
188
|
#define LCB_SDSPEC_F_MKINTERMEDIATES (1<<16)
|
|
179
189
|
|
|
180
|
-
/**
|
|
181
|
-
#define
|
|
190
|
+
/** Access document XATTR path */
|
|
191
|
+
#define LCB_SDSPEC_F_XATTRPATH (1<<18)
|
|
192
|
+
|
|
193
|
+
/** Access document virtual/materialized path. Implies F_XATTRPATH */
|
|
194
|
+
#define LCB_SDSPEC_F_XATTR_MACROVALUES (1<<19)
|
|
195
|
+
|
|
196
|
+
/** Access Xattrs of deleted documents */
|
|
197
|
+
#define LCB_SDSPEC_F_XATTR_DELETED_OK (1<<20)
|
|
182
198
|
|
|
183
199
|
/**
|
|
184
200
|
* Set the path for an @ref lcb_SDSPEC structure
|
|
@@ -210,6 +226,24 @@ typedef struct {
|
|
|
210
226
|
#define LCB_SDMULTI_MODE_INVALID 0
|
|
211
227
|
#define LCB_SDMULTI_MODE_LOOKUP 1
|
|
212
228
|
#define LCB_SDMULTI_MODE_MUTATE 2
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* This command flag should be used if the document is to be created
|
|
232
|
+
* if it does not exist.
|
|
233
|
+
*/
|
|
234
|
+
#define LCB_CMDSUBDOC_F_UPSERT_DOC (1<<16)
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* This command flag should be used if the document must be created anew.
|
|
238
|
+
* In this case, it will fail if it already exists
|
|
239
|
+
*/
|
|
240
|
+
#define LCB_CMDSUBDOC_F_INSERT_DOC (1<<17)
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Access a potentially deleted document. For internal Couchbase use
|
|
244
|
+
*/
|
|
245
|
+
#define LCB_CMDSUBDOC_F_ACCESS_DELETED (1<<18)
|
|
246
|
+
|
|
213
247
|
typedef struct {
|
|
214
248
|
LCB_CMD_BASE;
|
|
215
249
|
|
|
@@ -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,32 @@ 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
|
-
|
|
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,
|
|
227
|
+
PROTOCOL_BINARY_CMD_SELECT_BUCKET = 0x89,
|
|
330
228
|
|
|
331
229
|
PROTOCOL_BINARY_CMD_OBSERVE_SEQNO = 0x91,
|
|
332
230
|
PROTOCOL_BINARY_CMD_OBSERVE = 0x92,
|
|
333
231
|
|
|
334
|
-
PROTOCOL_BINARY_CMD_EVICT_KEY = 0x93,
|
|
335
232
|
PROTOCOL_BINARY_CMD_GET_LOCKED = 0x94,
|
|
336
233
|
PROTOCOL_BINARY_CMD_UNLOCK_KEY = 0x95,
|
|
337
234
|
|
|
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
235
|
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
236
|
|
|
419
237
|
/**
|
|
420
238
|
* Commands for the Sub-document API.
|
|
@@ -448,20 +266,8 @@ extern "C"
|
|
|
448
266
|
/* Subdoc additions for Spock: */
|
|
449
267
|
PROTOCOL_BINARY_CMD_SUBDOC_GET_COUNT = 0xd2,
|
|
450
268
|
|
|
451
|
-
/*
|
|
452
|
-
|
|
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,
|
|
269
|
+
/* get error code mappings */
|
|
270
|
+
PROTOCOL_BINARY_CMD_GET_ERROR_MAP = 0xfe,
|
|
465
271
|
|
|
466
272
|
/* Reserved for being able to signal invalid opcode */
|
|
467
273
|
PROTOCOL_BINARY_CMD_INVALID = 0xff
|
|
@@ -474,41 +280,9 @@ extern "C"
|
|
|
474
280
|
typedef enum {
|
|
475
281
|
PROTOCOL_BINARY_RAW_BYTES = 0x00,
|
|
476
282
|
PROTOCOL_BINARY_DATATYPE_JSON = 0x01,
|
|
477
|
-
|
|
478
|
-
PROTOCOL_BINARY_DATATYPE_COMPRESSED = 0x02,
|
|
479
|
-
/* Compressed == snappy compression */
|
|
480
|
-
PROTOCOL_BINARY_DATATYPE_COMPRESSED_JSON = 0x03
|
|
283
|
+
PROTOCOL_BINARY_DATATYPE_COMPRESSED = 0x02
|
|
481
284
|
} protocol_binary_datatypes;
|
|
482
285
|
|
|
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
|
-
/**
|
|
497
|
-
* Definitions of sub-document flags.
|
|
498
|
-
*/
|
|
499
|
-
typedef enum {
|
|
500
|
-
/* No flags set */
|
|
501
|
-
SUBDOC_FLAG_NONE = 0x0,
|
|
502
|
-
|
|
503
|
-
/* (Mutation) Should non-existent intermediate paths be created? */
|
|
504
|
-
SUBDOC_FLAG_MKDIR_P = 0x01,
|
|
505
|
-
|
|
506
|
-
/* (Mutation) Create the document if it does not exist. Implies
|
|
507
|
-
* SUBDOC_FLAG_MKDIR_P.
|
|
508
|
-
*/
|
|
509
|
-
SUBDOC_FLAG_MKDOC = 0x02
|
|
510
|
-
} protocol_binary_subdoc_flag;
|
|
511
|
-
|
|
512
286
|
/**
|
|
513
287
|
* Definition of the header structure for a request packet.
|
|
514
288
|
* See section 2
|
|
@@ -567,14 +341,6 @@ extern "C"
|
|
|
567
341
|
uint8_t bytes[sizeof(protocol_binary_response_header)];
|
|
568
342
|
} protocol_binary_response_no_extras;
|
|
569
343
|
|
|
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
344
|
|
|
579
345
|
/**
|
|
580
346
|
* Definition of the packet returned from a successful get, getq, getk and
|
|
@@ -591,9 +357,8 @@ extern "C"
|
|
|
591
357
|
uint8_t bytes[sizeof(protocol_binary_response_header) + 4];
|
|
592
358
|
} protocol_binary_response_get;
|
|
593
359
|
|
|
360
|
+
/* used by tests */
|
|
594
361
|
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
362
|
|
|
598
363
|
/**
|
|
599
364
|
* Definition of the packet used by the delete command
|
|
@@ -615,32 +380,6 @@ extern "C"
|
|
|
615
380
|
*/
|
|
616
381
|
typedef protocol_binary_response_no_extras protocol_binary_response_delete;
|
|
617
382
|
|
|
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
383
|
/**
|
|
645
384
|
* Definition of the packet used by set, add and replace
|
|
646
385
|
* See section 4
|
|
@@ -655,28 +394,6 @@ extern "C"
|
|
|
655
394
|
} message;
|
|
656
395
|
uint8_t bytes[sizeof(protocol_binary_request_header) + 8];
|
|
657
396
|
} 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
397
|
|
|
681
398
|
/**
|
|
682
399
|
* Definition of the structure used by the increment and decrement
|
|
@@ -715,38 +432,6 @@ extern "C"
|
|
|
715
432
|
typedef protocol_binary_response_no_extras protocol_binary_response_incr;
|
|
716
433
|
typedef protocol_binary_response_no_extras protocol_binary_response_decr;
|
|
717
434
|
|
|
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
435
|
/**
|
|
751
436
|
* Definition of the packet returned from a successful version command
|
|
752
437
|
* See section 4
|
|
@@ -815,13 +500,6 @@ extern "C"
|
|
|
815
500
|
uint8_t bytes[sizeof(protocol_binary_request_header) + 4];
|
|
816
501
|
} protocol_binary_request_gat;
|
|
817
502
|
|
|
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
503
|
|
|
826
504
|
/**
|
|
827
505
|
* Definition of the packet used by SUBDOCUMENT single-path commands.
|
|
@@ -963,269 +641,6 @@ extern "C"
|
|
|
963
641
|
uint8_t bytes[sizeof(protocol_binary_response_header)];
|
|
964
642
|
} protocol_binary_response_subdoc_multi_mutation;
|
|
965
643
|
|
|
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
644
|
/**
|
|
1230
645
|
* Definition of hello's features.
|
|
1231
646
|
*/
|
|
@@ -1234,18 +649,24 @@ extern "C"
|
|
|
1234
649
|
PROTOCOL_BINARY_FEATURE_TLS = 0x2,
|
|
1235
650
|
PROTOCOL_BINARY_FEATURE_TCPNODELAY = 0x03,
|
|
1236
651
|
PROTOCOL_BINARY_FEATURE_MUTATION_SEQNO = 0x04,
|
|
1237
|
-
PROTOCOL_BINARY_FEATURE_TCPDELAY = 0x05
|
|
652
|
+
PROTOCOL_BINARY_FEATURE_TCPDELAY = 0x05,
|
|
653
|
+
PROTOCOL_BINARY_FEATURE_XATTR = 0x06,
|
|
654
|
+
PROTOCOL_BINARY_FEATURE_XERROR = 0x07,
|
|
655
|
+
PROTOCOL_BINARY_FEATURE_SELECT_BUCKET = 0x08
|
|
1238
656
|
} protocol_binary_hello_features;
|
|
1239
657
|
|
|
1240
658
|
#define MEMCACHED_FIRST_HELLO_FEATURE 0x01
|
|
1241
|
-
#define MEMCACHED_TOTAL_HELLO_FEATURES
|
|
659
|
+
#define MEMCACHED_TOTAL_HELLO_FEATURES 10
|
|
1242
660
|
|
|
1243
661
|
#define protocol_feature_2_text(a) \
|
|
1244
662
|
(a == PROTOCOL_BINARY_FEATURE_DATATYPE) ? "Datatype" : \
|
|
1245
663
|
(a == PROTOCOL_BINARY_FEATURE_TLS) ? "TLS" : \
|
|
1246
664
|
(a == PROTOCOL_BINARY_FEATURE_TCPNODELAY) ? "TCP NODELAY" : \
|
|
1247
665
|
(a == PROTOCOL_BINARY_FEATURE_MUTATION_SEQNO) ? "Mutation seqno" : \
|
|
1248
|
-
(a == PROTOCOL_BINARY_FEATURE_TCPDELAY) ? "TCP DELAY" :
|
|
666
|
+
(a == PROTOCOL_BINARY_FEATURE_TCPDELAY) ? "TCP DELAY" : \
|
|
667
|
+
(a == PROTOCOL_BINARY_FEATURE_XATTR) ? "XATTR" : \
|
|
668
|
+
(a == PROTOCOL_BINARY_FEATURE_XERROR) ? "Error Map": \
|
|
669
|
+
(a == PROTOCOL_BINARY_FEATURE_SELECT_BUCKET) ? "Select Bucket": "Unknown"
|
|
1249
670
|
|
|
1250
671
|
/**
|
|
1251
672
|
* The HELLO command is used by the client and the server to agree
|
|
@@ -1282,518 +703,21 @@ extern "C"
|
|
|
1282
703
|
*/
|
|
1283
704
|
typedef protocol_binary_response_no_extras protocol_binary_response_hello;
|
|
1284
705
|
|
|
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
706
|
/**
|
|
1632
707
|
* The message format for getLocked engine API
|
|
1633
708
|
*/
|
|
1634
709
|
typedef protocol_binary_request_gat protocol_binary_request_getl;
|
|
1635
710
|
|
|
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
711
|
/**
|
|
1691
712
|
* Message format for CMD_GET_CONFIG
|
|
1692
713
|
*/
|
|
1693
714
|
typedef protocol_binary_request_no_extras protocol_binary_request_get_cluster_config;
|
|
1694
715
|
|
|
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
716
|
#define OBS_STATE_NOT_PERSISTED 0x00
|
|
1768
717
|
#define OBS_STATE_PERSISTED 0x01
|
|
1769
718
|
#define OBS_STATE_NOT_FOUND 0x80
|
|
1770
719
|
#define OBS_STATE_LOGICAL_DEL 0x81
|
|
1771
720
|
|
|
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
721
|
/**
|
|
1798
722
|
* The PROTOCOL_BINARY_CMD_OBSERVE_SEQNO command is used by the
|
|
1799
723
|
* client to retrieve information about the vbucket in order to
|
|
@@ -1861,52 +785,6 @@ extern "C"
|
|
|
1861
785
|
*/
|
|
1862
786
|
typedef protocol_binary_response_no_extras protocol_binary_response_observe_seqno;
|
|
1863
787
|
|
|
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
788
|
/**
|
|
1911
789
|
* @}
|
|
1912
790
|
*/
|