SOS: Scalable Object Store  4.0.0
 All Classes Functions Variables Typedefs Enumerations Enumerator Groups Pages
Indices

Indices

An Index keeps a named, ordered collection of Key/Value references to Objects. The Key is define by the type sos_key_t and the value is defined by the type sos_obj_ref_t. The Value is a Reference to an Object.

Some Indices are associated with an Attribute of a Schema. This is a convenience since internal to SOS, all of these collections are implemented as an Index. Whether a Schema attribute has an Index is specified when the Schema is created.

Other Indices are created directly with the sos_index_new() function. These Indices are primarily used when a complex key is required that is based on the value of more than a single Attribute. For example, if a use requires an ordering by Job + Time, a JobTime Index may be created where the key is the concatenation of the Job Id and the Unix Timestamp.

The functions for managing Indices include the following:

  • sos_index_new() Create a new index
  • sos_index_open() Open an existing index
  • sos_index_insert() Insert an Object into an Index
  • sos_index_find() Find an object in the index with the specified key
  • sos_index_find_inf() Find the object inferior (i.e. greatest lower bound) to the specified key
  • sos_index_find_sup() Find the object superior (i.e. least upper bound) orf the specified key
  • sos_index_commit() Commit index changes to stable storage
  • sos_index_close() Close the index
  • sos_index_key_size() Return the size of a key on this index
  • sos_index_key_new() Create a key for this index
  • sos_index_key_from_str() Assign a value to a key from a string
  • sos_index_key_to_str() Return a formated string representation of a key
  • sos_index_key_cmp() Compare two keys
  • sos_index_print() Print an internal representation of the index
  • sos_index_update() Update a key and associated data
  • sos_container_index_list() Print a list of indices defined on the container
  • sos_container_index_iter_new() Create a container index iterator
  • sos_container_index_iter_free() Destroy a container index iterator
  • sos_container_index_iter_first() Return the first index in the container
  • sos_container_index_iter_next() Return the next index on the iterator