Reference Guide C API www.spreadconcepts.com


C API
Replicated Hash Table
Version 2.0


Topic
Function
Description
Library rht_lib_init Initializes the library
     
Dictionary rht_create Creates a local replica of a specified replica
  rht_put Inserts the key-value pair (k -> v) into a replica
  rht_get Performs a lookup on a replica
  rht_del Deletes a key and its value from a replica
  rht_size Returns the number of key-value pairs contained in a replica
  rht_fini Called to "shut down" a replica
     
Key-Value Pairs rht_pair_key Returns a constant pointer to the key from a pair entry
  rht_pair_val Returns a constant pointer to the value from a pair entry
  rht_pair_update_type Returns the update type of an key-value pair entry
  rht_pair_time_stamp Returns the Lamport Time Stamp (LTS) from a pair entry's creation
  rht_pair_fini Frees a rht_pair created from a call to rht_get
     
Local-Lock Dictionary
rht_grab Acquires a recursive lock on a replica
  rht_drop Decreases the recursive lock count of the calling thread on a replica
  rht_is_owner Returns the recursive lock count of calling thread on a replica
     
Snapshots rht_snapshot Creates a snapshot of the current state of a replica
  rht_snap_fini Called once and only once to free a replica snapshot
  rht_snap_size Returns the size of a replica snapshot
  rht_snap_begin Sets an iterator to point at the beginning of a replica snapshot
  rht_snap_end Sets an iterator to point at the end of a replica snapshot
  rht_snap_get_it Performs a lookup on a replica snapshot
     
Iterators rht_get_it Similar to rht_get via an iterator
  rht_begin Returns an iterator pointing to beginning of a replica
  rht_end Return an iterator pointing to end of a replica
  rht_it_update_type Returns the update type of the key-value referenced by an iterator
  rht_it_key Returns the key of the key-value pair referenced by an iterator
  rht_it_val Returns the value of the key-value pair referenced by an iterator
  rht_it_time_stamp Return the Lamport Time Stamp for a pair referenced by an iterator
  rht_it_eq Compares two iterators for equality
  rht_it_next Advances an iterator
     
Names & Name Sets rht_name_cmp Comparison function for rht_name, performs a strncmp on 2 strings
  rht_nset_size Returns the number of names in a name set
  rht_nset_contains Returns true if a name set contains a specified name
  rht_nset_begin Initializes an iterator to the beginning of a name set
  rht_nset_end Initializes an iterator to the end of a name set
  rht_nset_get_it Performs a lookup of a specified name in name set
  rht_nset_it_val Returns a reference to the name specified by a name set iterator
  rht_nset_it_next Advances a name set iterator
  rht_nset_it_eq Tests equality of two name set iterators
     
Callbacks rht_on_update_cb User function called every time an update is made to the dictionary
  rht_on_synch_diff_cb User function called every time the level of synchronization of a local replica with respect to other remote replicas changes
  rht_on_failure_cb User function called every time a permanent failure occurs that will not allow the replica to continue making progress
  rht_on_trash_cb User function called when a replica is completely garbage collected
  rht_key_cmp_fcn User function called to compare two keys
  rht_key_hcode_fcn User function called to compute a hashcode of a key
     
Structures rht_name C string representation
  rht_blob Memory array representation, containing both the pointer to and size of memory block
  rht_stamp Structure that represents a time stamp of a update
  rht_options Set of configuration options
     
Errors rht_error Returns any permanent error that exists on a replica
  rht_strerror Returns a string describing the RHT error code passed to it
  error codes List and explanation of error codes that RHT functions can return
     
Misc replica handle Replica unique identifier. Once created must be passed to all functions that operate on a replica.


Copyright © 2004, Spread Concepts LLC, All rights reserved