Reference Guide C API www.spreadconcepts.com


C API
Replicated Hash Table
Version 2.0


rht_del
  rht_code rht_del(rht r, rht_blob k, int flags);


Parameters
  r replica handle of replica to delete from
  k key of key-value pair to be deleted
  flags must be set to RHT_NO_FLAGS


Return Values
  0 on success
  non-zero for error


Description
 

rht_del deletes a key from the specified replica. If an equivalent key exists in the replica, then the corresponding key-value pair will be removed.

Success (the return code) does not depend on whether or not an equivalent key already exists in the rht. The function generates an update to delete the specified key and it is unknown if the key match was found until the update comes back from the network and is applied. If is required to know if the delete was successful, us the on_update callback.

Remember that for RHT_UNION semantics no entry is left behind marking the key as deleted, whereas for RHT_INTERSECT semantics one is.

Also, the same note for rht_put applies to rht_del. If the delete of an entry is initiated around the same time as other updates to that entry, which update will eventually "win" and whether all those updates will be applied or not is determined by the LTSs (Lamport Time Stamp) of the updates.



Requirements
  Header: Declared in rht.h
Library: Use rht.lib
Version: 2.0


Also See
  RHT reference guide


Copyright © 2004, Spread Concepts LLC, All rights reserved