Determine if an item exists and if it has been replicated and persisted to various nodes.
|
#define | LCB_OBSERVE_FIELDS_COMMON |
|
Observe key.
observe->version = 0;
observe->v.v0.key = "my-key";
observe->v.v0.nkey = strlen(observe->v.v0.key);
- Parameters
-
instance | the instance used to batch the requests from |
command_cookie | A cookie passed to all of the notifications from this command |
num | the total number of elements in the commands array |
commands | the array containing the items to observe |
- Returns
- The status of the operation
- Stability
- Committed:
Response Structure for lcb_observe()
Data Fields |
const void * |
key |
|
lcb_SIZE |
nkey |
|
lcb_cas_t |
cas |
CAS of the item on this server. |
lcb_observe_t |
status |
Status flags. |
int |
from_master |
zero if key came from replica |
lcb_time_t |
ttp |
average time to persist on this server |
lcb_time_t |
ttr |
average time to replicate on this server |
typedef void(* lcb_observe_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_observe_resp_t *resp) |
The callback function for an observe request.
- Parameters
-
instance | the instance performing the operation |
cookie | the cookie associated with with the command |
error | The status of the operation |
resp | More information about the operation (only key and nkey is valid if error != LCB_SUCCESS) |
Enumerator |
---|
LCB_OBSERVE_MASTER_ONLY |
Only sends a command to the master.
In this case the callback will be invoked only once for the master, and then another time with the NULL callback
|
Possible statuses for keys in OBSERVE response.
Enumerator |
---|
LCB_OBSERVE_FOUND |
The item found in the memory, but not yet on the disk.
|
LCB_OBSERVE_PERSISTED |
The item hit the disk.
|
LCB_OBSERVE_NOT_FOUND |
The item missing on the disk and the memory.
|
LCB_OBSERVE_LOGICALLY_DELETED |
No knowledge of the key :)
|