18 #ifndef LIBCOUCHBASE_COUCHBASE_H 19 #define LIBCOUCHBASE_COUCHBASE_H 1 26 #define LCB_CONFIG_MCD_PORT 11210 27 #define LCB_CONFIG_MCD_SSL_PORT 11207 28 #define LCB_CONFIG_HTTP_PORT 8091 29 #define LCB_CONFIG_HTTP_SSL_PORT 18091 30 #define LCB_CONFIG_MCCOMPAT_PORT 11211 42 struct lcb_http_request_st;
43 typedef struct lcb_http_request_st *lcb_http_request_t;
49 #include <libcouchbase/sysdefs.h> 50 #include <libcouchbase/assert.h> 51 #include <libcouchbase/visibility.h> 54 #include <libcouchbase/http.h> 55 #include <libcouchbase/configuration.h> 59 #include <libcouchbase/_cxxwrap.h> 66 typedef lcb_U8 lcb_datatype_t;
67 typedef lcb_U32 lcb_USECS;
265 #ifndef __LCB_DOXYGEN__ 269 typedef enum { LCB_CONFIG_TRANSPORT_LIST_END = 0, LCB_CONFIG_TRANSPORT_HTTP = 1, LCB_CONFIG_TRANSPORT_CCCP, LCB_CONFIG_TRANSPORT_MAX } lcb_config_transport_t;
270 #define LCB_CREATE_V0_FIELDS const char *host; const char *user; const char *passwd; const char *bucket; struct lcb_io_opt_st *io; 271 #define LCB_CREATE_V1_FIELDS LCB_CREATE_V0_FIELDS lcb_type_t type; 272 #define LCB_CREATE_V2_FIELDS LCB_CREATE_V1_FIELDS const char *mchosts; const lcb_config_transport_t* transports; 273 struct lcb_create_st0 { LCB_CREATE_V0_FIELDS };
274 struct lcb_create_st1 { LCB_CREATE_V1_FIELDS };
275 struct lcb_create_st2 { LCB_CREATE_V2_FIELDS };
296 struct lcb_io_opt_st *
io;
320 struct lcb_io_opt_st *
io;
335 struct lcb_create_st0 v0;
336 struct lcb_create_st1 v1;
337 struct lcb_create_st2 v2;
504 #define LCB_CMD_BASE \ 546 #define LCB_CMD_F_INTERNAL_CALLBACK (1 << 0) 553 #define LCB_CMD_F_MULTIAUTH (1<<1) 569 #define LCB_CMD_SET_KEY(cmd, keybuf, keylen) \ 570 LCB_KREQ_SIMPLE(&(cmd)->key, keybuf, keylen) 582 #define LCB_CMD__SETVBID(cmd, vbid) do { \ 583 (cmd)->_hashkey.type = LCB_KV_VBID; \ 584 (cmd)->_hashkey.contig.nbytes = vbid; \ 621 #define LCB_RESP_BASE \ 646 #define LCB_RESP_SERVER_FIELDS \ 657 LCB_RESP_SERVER_FIELDS
729 LCB_CALLBACK_STOREDUR,
731 LCB_CALLBACK_SDMUTATE,
744 #define LCB_CALLBACK_VIEWQUERY -1 747 #define LCB_CALLBACK_N1QL -2 750 #define LCB_CALLBACK_IXMGMT -3 828 #define LCB_CMDGET_F_CLEAREXP (1<<16) 871 lcb_datatype_t datatype;
1121 lcb_datatype_t datatype;
1153 #define LCB_CMD_SET_VALUE(scmd, valbuf, vallen) do { \ 1154 (scmd)->value.vtype = LCB_KV_COPY; \ 1155 (scmd)->value.u_buf.contig.bytes = valbuf; \ 1156 (scmd)->value.u_buf.contig.nbytes = vallen; \ 1175 #define LCB_CMD_SET_VALUEIOV(scmd, iovs, niovs) do { \ 1176 (scmd)->value.vtype = LCB_KV_IOVCOPY; \ 1177 (scmd)->value.u_buf.multi.iov = iovs; \ 1178 (scmd)->value.u_buf.multi.niov = niovs; \ 1344 typedef struct lcb_MULTICMD_CTX_st {
1362 lcb_error_t (*done)(
struct lcb_MULTICMD_CTX_st *ctx,
const void *cookie);
1371 void (*fail)(
struct lcb_MULTICMD_CTX_st *ctx);
1380 void (*setspan)(
struct lcb_MULTICMD_CTX_st *ctx, lcbtrace_SPAN *span);
1483 lcb_U16 replicate_to;
1490 lcb_U8 check_delete;
1507 typedef struct lcb_durability_opts_st {
1516 #define LCB_CMDENDURE_F_MUTATION_TOKEN (1 << 16) 1543 lcb_U8 exists_master;
1549 lcb_U8 persisted_master;
1697 lcb_datatype_t datatype;
1742 #define LCB_DURABILITY_VALIDATE_CAPMAX (1 << 1) 1774 lcb_U16 *persist_to, lcb_U16 *replicate_to,
int options);
1785 #define LCB_CMDOBSERVE_F_MASTER_ONLY (1 << 16) 1795 const lcb_U16* servers_;
1812 LCB_OBSERVE_MAX = 0x82
1877 lcb_U16 server_index;
1891 lcb_U16 server_index;
1893 lcb_U64 persisted_seqno;
1945 #define LCB_MUTATION_TOKEN_ID(p) ((p)->uuid_) 1947 #define LCB_MUTATION_TOKEN_SEQ(p) ((p)->seqno_) 1949 #define LCB_MUTATION_TOKEN_VB(p) ((p)->vbid_) 1951 #define LCB_MUTATION_TOKEN_ISVALID(p) \ 1952 (p && !((p)->uuid_ == 0 && (p)->seqno_ == 0 && (p)->vbid_ == 0)) 2254 #define LCB_CMDSTATS_F_KV (1 << 16) 2262 LCB_RESP_SERVER_FIELDS
2320 LCB_RESP_SERVER_FIELDS
2321 const char *mcversion;
2341 LCB_VERBOSITY_DETAIL = 0x00,
2342 LCB_VERBOSITY_DEBUG = 0x01,
2343 LCB_VERBOSITY_INFO = 0x02,
2344 LCB_VERBOSITY_WARNING = 0x03
2451 #define LCB_PINGSVC_F_KV 0x01 2456 #define LCB_PINGSVC_F_N1QL 0x02 2461 #define LCB_PINGSVC_F_VIEWS 0x04 2466 #define LCB_PINGSVC_F_FTS 0x08 2471 #define LCB_PINGSVC_F_ANALYTICS 0x10 2479 #define LCB_PINGOPT_F_NOMETRICS 0x01 2485 #define LCB_PINGOPT_F_JSON 0x02 2491 #define LCB_PINGOPT_F_JSONDETAILS 0x04 2496 #define LCB_PINGOPT_F_JSONPRETTY 0x08 2529 LCB_PINGSTATUS_OK = 0,
2530 LCB_PINGSTATUS_TIMEOUT,
2531 LCB_PINGSTATUS_ERROR,
2560 LCB_RESP_SERVER_FIELDS
2720 LCB_HTTP_METHOD_GET = 0,
2721 LCB_HTTP_METHOD_POST = 1,
2722 LCB_HTTP_METHOD_PUT = 2,
2723 LCB_HTTP_METHOD_DELETE = 3,
2724 LCB_HTTP_METHOD_MAX = 4
2736 #define LCB_CMDHTTP_F_STREAM (1 << 16) 2743 #define LCB_CMDHTTP_F_CASTMO (1 << 17) 2749 #define LCB_CMDHTTP_F_NOUPASS (1 << 18) 2773 lcb_http_request_t *reqhandle;
2776 const char *content_type;
2780 const char *username;
2784 const char *password;
2808 const char *
const * headers;
2816 lcb_http_request_t _htreq;
3368 #define LCB_DATATYPE_JSON 0x01 3371 typedef enum { LCB_VALUE_RAW = 0x00, LCB_VALUE_F_JSON = 0x01, LCB_VALUE_F_SNAPPYCOMP = 0x02 }
lcb_VALUEFLAGS;
3417 #define LCB_GETNODE_UNAVAILABLE "invalid_host:0" 3872 #if !defined(LCB_VERSION_STRING) || defined(__LCB_DOXYGEN__) 3874 #define LCB_VERSION_STRING "unknown" 3877 #if !defined(LCB_VERSION) || defined(__LCB_DOXYGEN__) 3893 #define LCB_VERSION 0x000000 3896 #if !defined(LCB_VERSION_CHANGESET) || defined(__LCB_DOXYGEN__) 3898 #define LCB_VERSION_CHANGESET "0xdeadbeef" 3915 LIBCOUCHBASE_API LCB_EXTERN_VAR
3919 #define LCB_SUPPORTS_SSL 1 3921 #define LCB_SUPPORTS_SNAPPY 2 3923 #define LCB_SUPPORTS_TRACING 3 3985 struct lcb_histogram_st;
3986 typedef struct lcb_histogram_st lcb_HISTOGRAM;
4015 typedef void (*lcb_HISTOGRAM_CALLBACK)
4016 (
const void *cookie,
lcb_timeunit_t timeunit, lcb_U32 min, lcb_U32 max,
4017 lcb_U32 total, lcb_U32 maxtotal);
4029 lcb_HISTOGRAM_CALLBACK cb);
4086 #include <libcouchbase/subdoc.h> 4088 #include <libcouchbase/api-legacy.h> Structure for performing an HTTP request.
Definition: couchbase.h:2807
Special pseudo-type, for ping endpoints in various services.
Definition: couchbase.h:2758
void lcb_dump(lcb_t instance, FILE *fp, lcb_U32 flags)
Write a textual dump to a file.
int lcb_supports_feature(int n)
Execute an arbitrary request against a host and port.
Definition: couchbase.h:2742
int version
Indicates which field in the lcb_CRST_u union should be used.
Definition: couchbase.h:330
Dump memory usage/reservation information about buffers.
Definition: couchbase.h:4066
void lcb_set_auth(lcb_t instance, lcb_AUTHENTICATOR *auth)
Sets the authenticator object for the instance.
lcb_MULTICMD_CTX * lcb_observe3_ctxnew(lcb_t instance)
Create a new multi context for an observe operation
void lcb_destroy_async(lcb_t instance, const void *arg)
Asynchronously schedule the destruction of an instance.
lcb_error_t lcb_cbflush3(lcb_t instance, const void *cookie, const lcb_CMDCBFLUSH *cmd)
lcb_stats3()
Definition: couchbase.h:726
The item missing on the disk and the memory.
Definition: couchbase.h:1834
Unknown or unspecified.
Definition: couchbase.h:258
Handle for administrative access.
Definition: couchbase.h:249
void lcb_refresh_config(lcb_t instance)
Force the library to refetch the cluster configuration
lcb_RESPCALLBACK lcb_install_callback3(lcb_t instance, int cbtype, lcb_RESPCALLBACK cb)
LCB_INTERNAL_API void lcb_stop_loop(lcb_t instance)
Search a fulltext index.
Definition: couchbase.h:2748
lcb_observe3_ctxnew()
Definition: couchbase.h:730
Options for lcb_endure3_ctxnew() (wrapper)
Definition: couchbase.h:1526
struct lcb_io_opt_st * io
IO Options.
Definition: couchbase.h:296
void(* lcb_bootstrap_callback)(lcb_t instance, lcb_error_t err)
Bootstrap callback.
Definition: couchbase.h:427
Time is in nanoseconds.
Definition: couchbase.h:3869
Response structure for the version command.
Definition: couchbase.h:2353
void lcb_set_cookie(lcb_t instance, const void *cookie)
Associate a cookie with an instance of lcb.
Response structure for counter operations.
Definition: couchbase.h:2094
void(* lcb_destroy_callback)(const void *cookie)
Callback received when instance is about to be destroyed.
Definition: couchbase.h:3394
lcb_timeunit_t
Time units reported by lcb_get_timings()
Definition: couchbase.h:3868
Only return a node which is connected, or a node which is known to be up.
Definition: couchbase.h:3469
Response structure for cluster statistics.
Definition: couchbase.h:2294
lcb_verbosity_level_t
level field for lcb_server_verbosity3 ()
Definition: couchbase.h:2376
Execute an N1QL Query.
Definition: couchbase.h:2745
lcb_error_t lcb_noop3(lcb_t instance, const void *cookie, const lcb_CMDNOOP *cmd)
lcb_error_t lcb_server_verbosity3(lcb_t instance, const void *cookie, const lcb_CMDVERBOSITY *cmd)
lcb_error_t lcb_unlock3(lcb_t instance, const void *cookie, const lcb_CMDUNLOCK *cmd)
Unlock a previously locked item using lcb_CMDGET::lock
Use sequence-number based polling.
Definition: couchbase.h:1449
lcb_error_t lcb_wait(lcb_t instance)
Wait for the execution of all batched requests
Use the preferred durability.
Definition: couchbase.h:1426
void lcb_sched_enter(lcb_t instance)
Enter a scheduling context.
const void * lcb_get_cookie(lcb_t instance)
Retrieve the cookie associated with this instance
void lcb_sched_flush(lcb_t instance)
Request commands to be flushed to the network
Query all the replicas sequentially, retrieving the first successful response.
Definition: couchbase.h:947
void(* lcb_timings_callback)(lcb_t instance, const void *cookie, lcb_timeunit_t timeunit, lcb_U32 min, lcb_U32 max, lcb_U32 total, lcb_U32 maxtotal)
The following function is called for each bucket in the timings histogram when you call lcb_get_timin...
Definition: couchbase.h:3920
const char * connstr
Connection string.
Definition: couchbase.h:282
Response structure for endure.
Definition: couchbase.h:1551
Data persisted and replicated.
Definition: couchbase.h:259
void lcb_histogram_read(const lcb_HISTOGRAM *hg, const void *cookie, lcb_HISTOGRAM_CALLBACK cb)
Response structure for lcb_observe_seqno3()
Definition: couchbase.h:1916
lcb_error_t lcb_get_bootstrap_status(lcb_t instance)
Gets the initial bootstrap status
lcb_CMDBASE lcb_CMDTOUCH
Command structure for a touch request.
Definition: couchbase.h:2223
lcb_BTYPE
Type of the bucket.
Definition: couchbase.h:257
lcb_RESPBASE lcb_RESPREMOVE
Response structure for removal operation.
Definition: couchbase.h:1283
Default callback invoked as a fallback.
Definition: couchbase.h:719
Command structure for lcb_storedur3() This is much like lcb_CMDSTORE, but also includes durability op...
Definition: couchbase.h:1714
Time is in microseconds.
Definition: couchbase.h:3870
LCB_EXTERN_VAR const lcb_U32 lcb_version_g
Global/extern variable containing the version of the library.
Definition: couchbase.h:4001
lcb_error_t lcb_diag(lcb_t instance, const void *cookie, const lcb_CMDDIAG *cmd)
Returns diagnostics report about network connections.
void lcb_wait3(lcb_t instance, lcb_WAITFLAGS flags)
Wait for completion of scheduled operations.
Response structure for lcb_store3()
Definition: couchbase.h:1148
Credentials store for Couchbase.
lcb_DURMODE
Type of durability polling to use.
Definition: couchbase.h:1420
Will cause the operation to fail unless the key already exists in the cluster.
Definition: couchbase.h:1080
void * lcb_mem_alloc(lcb_SIZE size)
Functions to allocate and free memory related to libcouchbase.
lcb_error_t lcb_http3(lcb_t instance, const void *cookie, const lcb_CMDHTTP *cmd)
lcb_error_t lcb_ping3(lcb_t instance, const void *cookie, const lcb_CMDPING *cmd)
Check connections by sending NOOP-like messages to all services.
lcb_PINGSVCTYPE
Type of the service.
Definition: couchbase.h:2559
lcb_error_t lcb_touch3(lcb_t instance, const void *cookie, const lcb_CMDTOUCH *cmd)
Spool a touch request.
lcb_http_method_t
HTTP Request method enumeration These just enumerate the various types of HTTP request methods suppor...
Definition: couchbase.h:2769
lcb_error_t lcb_counter3(lcb_t instance, const void *cookie, const lcb_CMDCOUNTER *cmd)
Schedule single counter operation.
const char * lcb_strcbtype(int cbtype)
Returns the type of the callback as a string.
Base structure for informational commands from servers This contains an additional lcb_RESPSERVERBASE...
Definition: couchbase.h:662
lcb_U32 lcb_cntl_getu32(lcb_t instance, int cmd)
Retrieve an lcb_U32 setting
The response was a result of a not-my-vbucket error.
Definition: couchbase.h:691
Common ABI header for all commands.
Definition: couchbase.h:539
Like LCB_APPEND, but prepends the new value to the existing value.
Definition: couchbase.h:1105
This union contains the set of current and historical options.
Definition: couchbase.h:334
lcb_server_versions3()
Definition: couchbase.h:727
struct lcb_create_st3 v3
Use this field.
Definition: couchbase.h:338
Response structure for an observe command.
Definition: couchbase.h:1846
lcb_error_t lcb_get_timings(lcb_t instance, const void *cookie, lcb_timings_callback callback)
Get the timings histogram
lcb_storage_t
Values for lcb_CMDSTORE::operation.
Definition: couchbase.h:1069
lcb_get3()
Definition: couchbase.h:720
Execute a management API request.
Definition: couchbase.h:2737
Handle for data access (default)
Definition: couchbase.h:248
Equivalent to LCB_NODE_HTCONFIG|LCB_NODE_CONNECTED
Definition: couchbase.h:3478
Dump the raw vbucket configuration.
Definition: couchbase.h:4062
lcb_http3()
Definition: couchbase.h:733
lcb_error_t lcb_cntl_setu32(lcb_t instance, int cmd, lcb_U32 arg)
Convenience function to set a value as an lcb_U32
lcb_VALUEFLAGS
Definition: couchbase.h:3443
int lcb_cntl_exists(int ctl)
Determine if a specific control code exists.
lcb_touch3()
Definition: couchbase.h:723
void lcb_histogram_destroy(lcb_HISTOGRAM *hg)
Options for lcb_endure3_ctxnew()
Definition: couchbase.h:1453
Structure for PING requests.
Definition: couchbase.h:2545
void lcb_destroy(lcb_t instance)
Destroy (and release all allocated resources) an instance of lcb.
lcb_error_t lcb_connect(lcb_t instance)
Schedule the initial connection This function will schedule the initial connection for the handle...
Get a view (CAPI) node.
Definition: couchbase.h:3467
lcb_destroy_callback lcb_set_destroy_callback(lcb_t, lcb_destroy_callback)
Set the callback to be invoked when the instance is destroyed asynchronously.
void(* lcb_RESPCALLBACK)(lcb_t instance, int cbtype, const lcb_RESPBASE *resp)
Callback invoked for responses.
Definition: couchbase.h:768
Definition of all of the error codes used by libcouchbase.
lcb_observe_t
Possible statuses for keys in OBSERVE response.
Definition: couchbase.h:1828
Command structure for endure.
Definition: couchbase.h:1544
Time is in milliseconds.
Definition: couchbase.h:3871
The item found in the memory, but not yet on the disk.
Definition: couchbase.h:1830
lcb_cbflush3()
Definition: couchbase.h:734
Structure representing a synchronization token.
Definition: couchbase.h:668
Multi Command Context API Some commands (notably, OBSERVE and its higher level equivalent, endue) are handled more efficiently at the cluster side by stuffing multiple items into a single packet.
Definition: couchbase.h:1363
lcb_CMDBASE lcb_CMDUNLOCK
Command for lcb_unlock3()
Definition: couchbase.h:2169
Equivalent to LCB_NODE_HTCONFIG|LCB_NODE_NEVERNULL.
Definition: couchbase.h:3484
Will cause the operation to fail if the key already exists in the cluster.
Definition: couchbase.h:1074
lcb_error_t lcb_store3(lcb_t instance, const void *cookie, const lcb_CMDSTORE *cmd)
Schedule a single storage request
lcb_error_t lcb_durability_validate(lcb_t instance, lcb_U16 *persist_to, lcb_U16 *replicate_to, int options)
const lcb_MUTATION_TOKEN * lcb_get_mutation_token(lcb_t instance, const lcb_KEYBUF *kb, lcb_error_t *errp)
lcb_flush3()
Definition: couchbase.h:729
The response was artificially generated inside the client.
Definition: couchbase.h:688
lcb_error_t lcb_observe_seqno3(lcb_t instance, const void *cookie, const lcb_CMDOBSEQNO *cmd)
Get the persistence/replication status for a given mutation token
const char * lcb_resp_get_error_ref(int cbtype, const lcb_RESPBASE *rb)
Structure for an observe request.
Definition: couchbase.h:1816
lcb_unlock3()
Definition: couchbase.h:725
lcb_U16 vbid_
Use LCB_MUTATION_TOKEN_VB()
Definition: couchbase.h:671
lcb_S32 lcb_get_num_nodes(lcb_t instance)
Get the number of the nodes in the cluster
Structure for PING responses.
Definition: couchbase.h:2605
Query all the replicas concurrently, retrieving all the responses.
Definition: couchbase.h:950
lcb_error_t lcb_tick_nowait(lcb_t instance)
Opaque pointer containing credentials for the library.
lcb_CALLBACKTYPE
The type of response passed to the callback.
Definition: couchbase.h:718
lcb_replica_t
Select get-replica mode.
Definition: couchbase.h:944
Command codes for libcouchbase.
Command for retrieving a single item.
Definition: couchbase.h:863
lcb_rget3()
Definition: couchbase.h:731
lcb_remove3()
Definition: couchbase.h:724
Data not persisted, but replicated.
Definition: couchbase.h:260
Command structure for lcb_observe_seqno3().
Definition: couchbase.h:1898
lcb_noop3()
Definition: couchbase.h:739
Low level structures used by commands for buffers.
Execute an Analytics Query.
Definition: couchbase.h:2751
Command for counter operations.
Definition: couchbase.h:2075
const char * username
Username to use for authentication.
Definition: couchbase.h:288
lcb_error_t lcb_server_versions3(lcb_t instance, const void *cookie, const lcb_CMDBASE *cmd)
int lcb_is_redacting_logs(lcb_t instance)
lcb_bootstrap_callback lcb_set_bootstrap_callback(lcb_t instance, lcb_bootstrap_callback callback)
Set the callback for notification of success or failure of initial connection.
Entry describing the status of the service in the cluster.
Definition: couchbase.h:2587
lcb_counter3()
Definition: couchbase.h:722
Query the specific replica specified by the lcb_rget3_cmd_t::index field.
Definition: couchbase.h:954
Structure for HTTP responses.
Definition: couchbase.h:2852
lcb_store3()
Definition: couchbase.h:721
lcb_U64 seqno_
Use LCB_MUTATION_TOKEN_SEQ()
Definition: couchbase.h:670
lcb_U64 uuid_
Use LCB_MUTATION_TOKEN_ID()
Definition: couchbase.h:669
Dump various metrics information.
Definition: couchbase.h:4068
void lcb_sched_leave(lcb_t instance)
Leave the current scheduling context, scheduling the commands within the context to be flushed to th...
lcb_CMDBASE lcb_CMDREMOVE
Command for removing an item from the server.
Definition: couchbase.h:1271
Get a data (memcached) node.
Definition: couchbase.h:3465
lcb_server_verbosity3()
Definition: couchbase.h:728
Data not persisted and not replicated.
Definition: couchbase.h:261
const char * lcb_get_keynode(lcb_t instance, const void *key, size_t nkey)
Get the target server for a given key.
Response structure for `LCB_CALLBACK_STOREDUR.
Definition: couchbase.h:1741
lcb_PINGSTATUS
Status of the service
Definition: couchbase.h:2573
lcb_logprocs * logger
Logger.
Definition: couchbase.h:319
struct lcb_st * lcb_t
Library handle representing a connection to a cluster and its data buckets.
Definition: couchbase.h:41
Base response structure for callbacks.
Definition: couchbase.h:648
Wrapper structure for lcb_create()
Definition: couchbase.h:328
lcb_type_t
Handle types.
Definition: couchbase.h:247
lcb_error_t
Error codes returned by the library.
Definition: error.h:580
lcb_RESPFLAGS
Response flags.
Definition: couchbase.h:679
lcb_RESPCALLBACK lcb_get_callback3(lcb_t instance, int cbtype)
void lcb_cancel_http_request(lcb_t instance, lcb_http_request_t request)
Cancel ongoing HTTP request
Get an HTTP configuration (Rest API) node.
Definition: couchbase.h:3463
lcb_MULTICMD_CTX * lcb_endure3_ctxnew(lcb_t instance, const lcb_durability_opts_t *options, lcb_error_t *err)
Return a new command context for scheduling endure operations
For lcb_observe_seqno3()
Definition: couchbase.h:735
lcb_error_t lcb_stats3(lcb_t instance, const void *cookie, const lcb_CMDSTATS *cmd)
Schedule a request for statistics from the cluster.
lcb_error_t lcb_enable_timings(lcb_t instance)
Start recording timing metrics for the different operations.
Specifying this flag adds additional semantics which instruct the library to search additional resour...
Definition: couchbase.h:3475
const char * lcb_get_version(lcb_U32 *version)
Get the version of the library.
Unconditionally store the item in the cluster.
Definition: couchbase.h:1083
Behave like the old lcb_wait()
Definition: couchbase.h:3106
Flag, only valid for subdoc responses, indicates that the response was processed using the single-ope...
Definition: couchbase.h:699
int lcb_is_waiting(lcb_t instance)
Check if instance is blocked in the event loop
const char * lcb_get_node(lcb_t instance, lcb_GETNODETYPE type, unsigned index)
Return a string of host:port for a node of the given type.
lcb_error_t lcb_create(lcb_t *instance, const struct lcb_create_st *options)
Create an instance of lcb.
lcb_error_t lcb_get3(lcb_t instance, const void *cookie, const lcb_CMDGET *cmd)
Spool a single get operation
lcb_RESPBASE lcb_RESPTOUCH
Response structure for a touch request.
Definition: couchbase.h:2227
Time is in seconds.
Definition: couchbase.h:3872
Command for requesting an item from a replica.
Definition: couchbase.h:968
LCB_INTERNAL_API void lcb_run_loop(lcb_t instance)
void lcb_breakout(lcb_t instance)
Forcefully break from the event loop.
lcb_RESPBASE lcb_RESPUNLOCK
Response structure for an unlock command.
Definition: couchbase.h:2173
lcb_error_t lcb_flush3(lcb_t instance, const void *cookie, const lcb_CMDFLUSH *cmd)
const char * lcb_resp_get_error_context(int cbtype, const lcb_RESPBASE *rb)
lcb_ping3()
Definition: couchbase.h:740
Logging context
Definition: cntl.h:545
lcb_error_t lcb_disable_timings(lcb_t instance)
Stop recording (and release all resources from previous measurements) timing metrics.
void lcb_sched_fail(lcb_t instance)
Fail all commands in the current scheduling context.
const char *const * lcb_get_server_list(lcb_t instance)
Get a list of nodes in the cluster
Dump information about each packet.
Definition: couchbase.h:4064
lcb_DUMPFLAGS
Definition: couchbase.h:4060
lcb_diag()
Definition: couchbase.h:741
No more responses are to be received for this request.
Definition: couchbase.h:681
lcb_GETNODETYPE
Type of node to retrieve for the lcb_get_node() function.
Definition: couchbase.h:3461
lcb_error_t lcb_cntl_string(lcb_t instance, const char *key, const char *value)
Alternatively one may change configuration settings by passing a string key and value...
Rather than setting the contents of the entire document, take the value specified in lcb_CMDSTORE::va...
Definition: couchbase.h:1100
Execute a request against the bucket.
Definition: couchbase.h:2729
Do not check pending operations before running the event loop.
Definition: couchbase.h:3115
void lcb_histogram_print(lcb_HISTOGRAM *hg, FILE *stream)
Print the histogram to the specified FILE.
Command for storing an item to the server.
Definition: couchbase.h:1118
The response has extra error information as value (see SDK-RFC-28).
Definition: couchbase.h:702
void lcb_histogram_record(lcb_HISTOGRAM *hg, lcb_U64 duration)
Dump everything.
Definition: couchbase.h:4070
The response has additional internal data.
Definition: couchbase.h:695
lcb_WAITFLAGS
Flags for lcb_wait3()
Definition: couchbase.h:3104
lcb_error_t lcb_storedur3(lcb_t instance, const void *cookie, const lcb_CMDSTOREDUR *cmd)
lcb_endure3_ctxnew()
Definition: couchbase.h:732
Common request header for all keys.
Definition: kvbuf.h:66
lcb_error_t lcb_cntl(lcb_t instance, int mode, int cmd, void *arg)
This function exposes an ioctl/fcntl-like interface to read and write various configuration propert...
Response structure when retrieving a single item.
Definition: couchbase.h:876
lcb_CMDBASE lcb_CMDSTATS
Command structure for stats request The lcb_CMDSTATS::key field should contain the statistics key...
Definition: couchbase.h:2281
Public I/O integration interface.
lcb_HISTOGRAM * lcb_histogram_create(void)
lcb_http_type_t
The type of HTTP request to execute.
Definition: couchbase.h:2724
The item hit the disk.
Definition: couchbase.h:1832
lcb_S32 lcb_get_num_replicas(lcb_t instance)
Get the number of the replicas in the cluster
Explicitly request CAS-based durability.
Definition: couchbase.h:1440
Inner structure V3 for lcb_create().
Definition: couchbase.h:281
Inner structure V4 for lcb_create().
Definition: couchbase.h:305
Structure representing a value to be stored.
Definition: kvbuf.h:115
const char * passwd
Password for bucket.
Definition: couchbase.h:293
No knowledge of the key :)
Definition: couchbase.h:1836
The default storage mode.
Definition: couchbase.h:1093
void lcb_mem_free(void *ptr)
Use this to free memory allocated with lcb_mem_alloc.
<for lcb_storedur3()
Definition: couchbase.h:737
LCB_INTERNAL_API lcb_U64 lcb_nstime(void)
lcb_error_t lcb_rget3(lcb_t instance, const void *cookie, const lcb_CMDGETREPLICA *cmd)
Spool a single get-with-replica request.
const lcb_MUTATION_TOKEN * lcb_resp_get_mutation_token(int cbtype, const lcb_RESPBASE *rb)
Retrieves the mutation token from the response structure.
lcb_error_t lcb_remove3(lcb_t instance, const void *cookie, const lcb_CMDREMOVE *cmd)
Spool a removal of an item.