Sun StorageTek 5800 System Client API Reference Manual

Using the API for Storing Name-Value Records

A common way of storing metadata in the synchronous C API for the 5800 system is to use the name-value record API.

ProcedureTo Use the API for Storing Name-Value Records

  1. Call hc_init once per process.

  2. Call hc_session_create_ez to initialize the session and download the schema.

  3. Create the metadata record with hc_nvr_create.

  4. Fill the new metadata piece by piece with hc_nvr_add_metadata_* functions (see Building Name-Value Records) for each 5800 system type.

  5. Call either hc_store_metadata_ez or hc_store_both_ez to store the new metadata record.

  6. When you are done, free the metadata record by calling hc_nvr_free.

  7. When the session is finished, call hc_session_free to free the session data structures.

  8. When all threads are completed, call hc_cleanup to release the global session.