Couchbase C Client
3.1.3
Asynchronous C Client for Couchbase
|
Clear the contents of a bucket.
Flush is useful for development environments (for example clearing a bucket before running tests).
Modules | |
Collections Management | |
Managing collections in the bucket. | |
Timings | |
Determine how long operations are taking to be completed. | |
Functions | |
void | lcb_dump (lcb_INSTANCE *instance, FILE *fp, lcb_U32 flags) |
Write a textual dump to a file. More... | |
lcb_HISTOGRAM * | lcb_histogram_create (void) |
More... | |
void | lcb_histogram_destroy (lcb_HISTOGRAM *hg) |
More... | |
void | lcb_histogram_record (lcb_HISTOGRAM *hg, lcb_U64 duration) |
More... | |
void | lcb_histogram_read (const lcb_HISTOGRAM *hg, const void *cookie, lcb_HISTOGRAM_CALLBACK cb) |
More... | |
void | lcb_histogram_print (lcb_HISTOGRAM *hg, FILE *stream) |
Print the histogram to the specified FILE. More... | |
const char * | lcb_resp_get_error_context (int cbtype, const lcb_RESPBASE *rb) |
More... | |
const char * | lcb_resp_get_error_ref (int cbtype, const lcb_RESPBASE *rb) |
More... | |
lcb_STATUS | lcb_respgetmanifest_status (const lcb_RESPGETMANIFEST *resp) |
lcb_STATUS | lcb_respgetmanifest_cookie (const lcb_RESPGETMANIFEST *resp, void **cookie) |
lcb_STATUS | lcb_respgetmanifest_value (const lcb_RESPGETMANIFEST *resp, const char **json, size_t *json_len) |
lcb_STATUS | lcb_cmdgetmanifest_create (lcb_CMDGETMANIFEST **cmd) |
lcb_STATUS | lcb_cmdgetmanifest_destroy (lcb_CMDGETMANIFEST *cmd) |
lcb_STATUS | lcb_cmdgetmanifest_timeout (lcb_CMDGETMANIFEST *cmd, uint32_t timeout) |
lcb_STATUS | lcb_getmanifest (lcb_INSTANCE *instance, void *cookie, const lcb_CMDGETMANIFEST *cmd) |
lcb_STATUS | lcb_respgetcid_status (const lcb_RESPGETCID *resp) |
lcb_STATUS | lcb_respgetcid_cookie (const lcb_RESPGETCID *resp, void **cookie) |
lcb_STATUS | lcb_respgetcid_manifest_id (const lcb_RESPGETCID *resp, uint64_t *id) |
lcb_STATUS | lcb_respgetcid_collection_id (const lcb_RESPGETCID *resp, uint32_t *id) |
lcb_STATUS | lcb_respgetcid_scoped_collection (const lcb_RESPGETCID *resp, const char **name, size_t *name_len) |
lcb_STATUS | lcb_cmdgetcid_create (lcb_CMDGETCID **cmd) |
lcb_STATUS | lcb_cmdgetcid_destroy (lcb_CMDGETCID *cmd) |
lcb_STATUS | lcb_cmdgetcid_scope (lcb_CMDGETCID *cmd, const char *scope, size_t scope_len) |
lcb_STATUS | lcb_cmdgetcid_collection (lcb_CMDGETCID *cmd, const char *collection, size_t collection_len) |
lcb_STATUS | lcb_cmdgetcid_timeout (lcb_CMDGETCID *cmd, uint32_t timeout) |
lcb_STATUS | lcb_getcid (lcb_INSTANCE *instance, void *cookie, const lcb_CMDGETCID *cmd) |
Typedefs | |
typedef struct lcb_histogram_st | lcb_HISTOGRAM |
typedef void(* | lcb_HISTOGRAM_CALLBACK) (const void *cookie, lcb_timeunit_t timeunit, lcb_U32 min, lcb_U32 max, lcb_U32 total, lcb_U32 maxtotal) |
typedef struct lcb_RESPGETMANIFEST_ | lcb_RESPGETMANIFEST |
typedef struct lcb_CMDGETMANIFEST_ | lcb_CMDGETMANIFEST |
typedef struct lcb_RESPGETCID_ | lcb_RESPGETCID |
typedef struct lcb_CMDGETCID_ | lcb_CMDGETCID |
Enumerations | |
enum | lcb_DUMPFLAGS |
Creating Commands | |
Issuing a command to the Cluster involves selecting the correct command structure, populating it with the data relevant for the command, optionally associating the command with your own application data, issuing the command to a spooling function, and finally receiving the response. Command structures all derive from the common lcb_CMDBASE structure. This structure defines the common fields for all commands. Almost all commands need to contain a key, which should be assigned using the LCB_CMD_SET_KEY() macro. | |
lcb_STATUS | lcb_cbflush3 (lcb_INSTANCE *instance, void *cookie, const lcb_CMDCBFLUSH *cmd) |
More... | |
lcb_STATUS lcb_cbflush3 | ( | lcb_INSTANCE * | instance, |
void * | cookie, | ||
const lcb_CMDCBFLUSH * | cmd | ||
) |
Flush a bucket This function will properly flush any type of bucket using the REST API via HTTP.
The callback invoked under LCB_CALLBACK_CBFLUSH will be invoked with either a success or failure status depending on the outcome of the operation. Note that in order for lcb_cbflush3() to succeed, flush must already be enabled on the bucket via the administrative interface.
instance | the library handle |
cookie | the cookie passed in the callback |
cmd | empty command structure. Currently there are no options for this command. |
void lcb_dump | ( | lcb_INSTANCE * | instance, |
FILE * | fp, | ||
lcb_U32 | flags | ||
) |
Write a textual dump to a file.
This function will inspect the various internal structures of the current client handle (indicated by instance
) and write the state information to the file indicated by fp
.
instance | the handle to dump |
fp | the file to which the dump should be written |
flags | a set of modifiers (of lcb_DUMPFLAGS) indicating what information to dump. Note that a standard set of information is always dumped, but by default more verbose information is hidden, and may be enabled with these flags. |
lcb_HISTOGRAM* lcb_histogram_create | ( | void | ) |
void lcb_histogram_destroy | ( | lcb_HISTOGRAM * | hg | ) |
void lcb_histogram_record | ( | lcb_HISTOGRAM * | hg, |
lcb_U64 | duration | ||
) |
hg | the histogram |
duration | the duration in nanoseconds |
void lcb_histogram_read | ( | const lcb_HISTOGRAM * | hg, |
const void * | cookie, | ||
lcb_HISTOGRAM_CALLBACK | cb | ||
) |
hg | the histogram |
cookie | pointer passed to callback |
cb | callback to invoke |
void lcb_histogram_print | ( | lcb_HISTOGRAM * | hg, |
FILE * | stream | ||
) |
Print the histogram to the specified FILE.
This essentially outputs the same raw information as lcb_histogram_read(), except it prints in implementation-defined format. It's simpler to use than lcb_histogram_read, but less flexible.
hg | the histogram |
stream | File to print the histogram to. |
const char* lcb_resp_get_error_context | ( | int | cbtype, |
const lcb_RESPBASE * | rb | ||
) |
Retrieves the extra error context from the response structure.
This context does not duplicate information described by status code rendered by lcb_strerror() function, and should be logged if available.
const char* lcb_resp_get_error_ref | ( | int | cbtype, |
const lcb_RESPBASE * | rb | ||
) |
Retrieves the error reference id from the response structure.
Error reference id (or event id) should be logged to allow administrators match client-side events with cluster logs.
enum lcb_DUMPFLAGS |