Couchbase C Client
2.4.4
|
Get items from replica.
This is like lcb_get() but is useful when an item from the master cannot be retrieved.
From command version 1, it is possible to select strategy of how to select the replica node. Currently three strategies are available:
#### Get document from the first available replica
This will will generate lcb_get_num_replicas() responses
Functions | |
lcb_error_t | lcb_get_replica (lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_get_replica_cmd_t *const *commands) |
Get a number of replca values from the cache. More... | |
Enumerations | |
enum | lcb_replica_t |
Select get-replica mode. More... | |
lcb_error_t lcb_get_replica | ( | lcb_t | instance, |
const void * | command_cookie, | ||
lcb_SIZE | num, | ||
const lcb_get_replica_cmd_t *const * | commands | ||
) |
Get a number of replca values from the cache.
Example:
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 get |
struct lcb_GETREPLICACMDv1 |
Command for lcb_get_replica()
Data Fields | ||
---|---|---|
const void * | key | |
lcb_SIZE | nkey | |
lcb_replica_t | strategy | Strategy to use. |
int | index | If strategy is LCB_REPLICA_SELECT, specific the replica index to use. |
struct lcb_get_replica_cmd_t |
wrapper structure for lcb_get_replica()
Data Fields | ||
---|---|---|
int | version | |
union lcb_get_replica_cmd_t | v |
enum lcb_replica_t |
Select get-replica mode.