Couchbase C Client
2.5.6
|
Retrieve a document from the cluster.
Functions | |
lcb_error_t | lcb_get3 (lcb_t instance, const void *cookie, const lcb_CMDGET *cmd) |
Spool a single get operation. More... | |
Macros | |
#define | LCB_CMDGET_F_CLEAREXP |
If this bit is set in lcb_CMDGET::cmdflags then the expiry time is cleared if lcb_CMDGET::exptime is 0. More... | |
lcb_error_t lcb_get3 | ( | lcb_t | instance, |
const void * | cookie, | ||
const lcb_CMDGET * | cmd | ||
) |
Spool a single get operation.
instance | the handle |
cookie | a pointer to be associated with the command |
cmd | the command structure |
struct lcb_CMDGET |
Command for retrieving a single item.
exptime
fieldGet And Touch:
It is possible to retrieve an item and concurrently modify its expiration time (thus keeping it "alive"). The item's expiry time can be set using the exptime field.
Data Fields | ||
---|---|---|
lcb_U32 | cmdflags |
Common flags for the command. These modify the command itself. Currently the lower 16 bits of this field are reserved, and the higher 16 bits are used for individual commands. |
lcb_U32 | exptime |
Specify the expiration time. This is either an absolute Unix time stamp or a relative offset from now, in seconds. If the value of this number is greater than the value of thirty days in seconds, then it is a Unix timestamp. This field is used in mutation operations (lcb_store3()) to indicate the lifetime of the item. It is used in lcb_get3() with the lcb_CMDGET::lock option to indicate the lock expiration itself. |
lcb_U64 | cas |
The known CAS of the item. This is passed to mutation to commands to ensure the item is only changed if the server-side CAS value matches the one specified here. For other operations (such as lcb_CMDENDURE) this is used to ensure that the item has been persisted/replicated to a number of servers with the value specified here. |
lcb_KEYBUF | key |
The key for the document itself. This should be set via LCB_CMD_SET_KEY() |
lcb_KEYBUF | _hashkey |
|
int | lock |
If set to true, the exptime field inside options will take to mean the time the lock should be held. While the lock is held, other operations trying to access the key will fail with an |
struct lcb_RESPGET |
Response structure when retrieving a single item.
Data Fields | |
void * | cookie |
Application-defined pointer passed as the cookie parameter when scheduling the command. More... | |
const void * | key |
Key for request. | |
lcb_SIZE | nkey |
Size of key. | |
lcb_CAS | cas |
CAS for response (if applicable) | |
lcb_error_t | rc |
Status code. | |
lcb_U16 | version |
ABI version for response. | |
lcb_U16 | rflags |
Response specific flags. More... | |
const void * | value |
Value buffer for the item. | |
lcb_SIZE | nvalue |
Length of value. | |
void * | bufh |
lcb_U32 | itmflags |
User-defined flags for the item. | |
void* cookie |
Application-defined pointer passed as the cookie
parameter when scheduling the command.
lcb_U16 rflags |
Response specific flags.
see lcb_RESPFLAGS
#define LCB_CMDGET_F_CLEAREXP |
If this bit is set in lcb_CMDGET::cmdflags then the expiry time is cleared if lcb_CMDGET::exptime is 0.
This allows get-and-touch with an expiry of 0.