32 #define LCB_CONFIG_MCD_PORT 11210 33 #define LCB_CONFIG_MCD_SSL_PORT 11207 34 #define LCB_CONFIG_HTTP_PORT 8091 35 #define LCB_CONFIG_HTTP_SSL_PORT 18091 36 #define LCB_CONFIG_MCCOMPAT_PORT 11211 52 #define LCB_CMD_SET_KEY(cmd, keybuf, keylen) LCB_KREQ_SIMPLE(&(cmd)->key, keybuf, keylen) 71 #define LCB_CMD_BASE \ 98 const char *collection; \ 282 lcb_U32 max, lcb_U32 total, lcb_U32 maxtotal);
328 struct lcb_histogram_st;
329 typedef struct lcb_histogram_st lcb_HISTOGRAM;
355 typedef void (*lcb_HISTOGRAM_CALLBACK)(
const void *cookie,
lcb_timeunit_t timeunit, lcb_U32 min, lcb_U32 max,
356 lcb_U32 total, lcb_U32 maxtotal);
366 void lcb_histogram_read(
const lcb_HISTOGRAM *hg,
const void *cookie, lcb_HISTOGRAM_CALLBACK cb);
418 typedef struct lcb_RESPGETMANIFEST_ lcb_RESPGETMANIFEST;
420 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetmanifest_status(
const lcb_RESPGETMANIFEST *resp);
421 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetmanifest_cookie(
const lcb_RESPGETMANIFEST *resp,
void **cookie);
422 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetmanifest_value(
const lcb_RESPGETMANIFEST *resp,
const char **json,
425 typedef struct lcb_CMDGETMANIFEST_ lcb_CMDGETMANIFEST;
427 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetmanifest_create(lcb_CMDGETMANIFEST **cmd);
428 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetmanifest_destroy(lcb_CMDGETMANIFEST *cmd);
429 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetmanifest_timeout(lcb_CMDGETMANIFEST *cmd, uint32_t timeout);
430 LIBCOUCHBASE_API
lcb_STATUS lcb_getmanifest(
lcb_INSTANCE *instance,
void *cookie,
const lcb_CMDGETMANIFEST *cmd);
432 typedef struct lcb_RESPGETCID_ lcb_RESPGETCID;
434 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetcid_status(
const lcb_RESPGETCID *resp);
435 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetcid_cookie(
const lcb_RESPGETCID *resp,
void **cookie);
436 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetcid_manifest_id(
const lcb_RESPGETCID *resp, uint64_t *
id);
437 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetcid_collection_id(
const lcb_RESPGETCID *resp, uint32_t *
id);
438 LIBCOUCHBASE_API
lcb_STATUS lcb_respgetcid_scoped_collection(
const lcb_RESPGETCID *resp,
const char **name,
441 typedef struct lcb_CMDGETCID_ lcb_CMDGETCID;
443 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetcid_create(lcb_CMDGETCID **cmd);
444 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetcid_destroy(lcb_CMDGETCID *cmd);
445 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetcid_scope(lcb_CMDGETCID *cmd,
const char *scope,
size_t scope_len);
446 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetcid_collection(lcb_CMDGETCID *cmd,
const char *collection,
size_t collection_len);
447 LIBCOUCHBASE_API
lcb_STATUS lcb_cmdgetcid_timeout(lcb_CMDGETCID *cmd, uint32_t timeout);
495 #define LCB_GETNODE_UNAVAILABLE "invalid_host:0" LCB_INTERNAL_API void lcb_stop_loop(lcb_INSTANCE *instance)
void * lcb_mem_alloc(lcb_SIZE size)
Functions to allocate and free memory related to libcouchbase.
Time is in nanoseconds.
Definition: utils.h:235
lcb_timeunit_t
Time units reported by lcb_get_timings()
Definition: utils.h:234
Only return a node which is connected, or a node which is known to be up.
Definition: utils.h:487
Dump various metrics information.
Definition: utils.h:310
const char * lcb_get_node(lcb_INSTANCE *instance, lcb_GETNODETYPE type, unsigned index)
Return a string of host:port for a node of the given type.
lcb_STATUS lcb_get_timings(lcb_INSTANCE *instance, const void *cookie, lcb_timings_callback callback)
Get the timings histogram
lcb_HISTOGRAM * lcb_histogram_create(void)
const char *const * lcb_get_server_list(lcb_INSTANCE *instance)
Get a list of nodes in the cluster
Time is in microseconds.
Definition: utils.h:236
lcb_STATUS
Error codes returned by the library.
Definition: error.h:210
lcb_STATUS lcb_disable_timings(lcb_INSTANCE *instance)
Stop recording (and release all resources from previous measurements) timing metrics.
LCB_INTERNAL_API void lcb_run_loop(lcb_INSTANCE *instance)
const char * lcb_resp_get_error_context(int cbtype, const lcb_RESPBASE *rb)
Equivalent to LCB_NODE_HTCONFIG|LCB_NODE_CONNECTED
Definition: utils.h:496
Dump information about each packet.
Definition: utils.h:306
Get a view (CAPI) node.
Definition: utils.h:485
Time is in milliseconds.
Definition: utils.h:237
Equivalent to LCB_NODE_HTCONFIG|LCB_NODE_NEVERNULL.
Definition: utils.h:502
lcb_S32 lcb_get_num_nodes(lcb_INSTANCE *instance)
Get the number of the nodes in the cluster
lcb_S32 lcb_get_num_replicas(lcb_INSTANCE *instance)
Get the number of the replicas in the cluster
struct lcb_st lcb_INSTANCE
Library handle representing a connection to a cluster and its data buckets.
Definition: couchbase.h:35
void lcb_histogram_destroy(lcb_HISTOGRAM *hg)
const char * lcb_get_keynode(lcb_INSTANCE *instance, const void *key, size_t nkey)
Get the target server for a given key.
void(* lcb_timings_callback)(lcb_INSTANCE *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: utils.h:285
void lcb_dump(lcb_INSTANCE *instance, FILE *fp, lcb_U32 flags)
Write a textual dump to a file.
Dump the raw vbucket configuration.
Definition: utils.h:304
lcb_DUMPFLAGS
Definition: utils.h:302
LCB_INTERNAL_API lcb_U64 lcb_nstime(void)
Get a data (memcached) node.
Definition: utils.h:483
const char * lcb_resp_get_error_ref(int cbtype, const lcb_RESPBASE *rb)
void lcb_histogram_read(const lcb_HISTOGRAM *hg, const void *cookie, lcb_HISTOGRAM_CALLBACK cb)
Dump memory usage/reservation information about buffers.
Definition: utils.h:308
Get an HTTP configuration (Rest API) node.
Definition: utils.h:481
lcb_STATUS lcb_enable_timings(lcb_INSTANCE *instance)
Start recording timing metrics for the different operations.
Specifying this flag adds additional semantics which instruct the library to search additional resour...
Definition: utils.h:493
Time is in seconds.
Definition: utils.h:238
Dump everything.
Definition: utils.h:312
lcb_GETNODETYPE
Type of node to retrieve for the lcb_get_node() function.
Definition: utils.h:479
void lcb_histogram_record(lcb_HISTOGRAM *hg, lcb_U64 duration)
void lcb_histogram_print(lcb_HISTOGRAM *hg, FILE *stream)
Print the histogram to the specified FILE.
lcb_STATUS lcb_cbflush3(lcb_INSTANCE *instance, void *cookie, const lcb_CMDCBFLUSH *cmd)
void lcb_mem_free(void *ptr)
Use this to free memory allocated with lcb_mem_alloc.