rht_get performs a
lookup of a key on a specified replica.
If an equivalent key exists in the replica, then a
reference (a rht_pair pointer) to the corresponding
key-value pair will be returned.
This reference allows you to inspect the key, value
and LTS of a key-value pair entry. Such a reference
to a constant key-value pair will remain valid, and
therefore in memory, until rht_pair_fini
is called on it.
Use RHT_GET_DELETES to include deleted entries in
the search.
Use of the default RHT_DIRTY_READ flag will cause
rht_get search immediately without
waiting for any locally generated updates to be applied.
Whereas, specifying the RHT_CLEAN_READ will first apply
all locally generated updates, and then perform the
search.
***Note that the data a key-value pair entry (rht_pair)
references will never change, even if the entry is changed
in the dictionary. A rht_pair references constant
data. If no matching entry is found, success is returned
but p will be set to NULL.****
|