Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


20.1.13 ead_get() (retrieves a value)

Organization of this subsection

(1) Description

This function retrieves the value associated with a specified key.

(2) Format

#include <eads.h>
ead_value_element ead_get
(
  const EAD_CACHE     *cp,            /* In */
  const char          *key,           /* In */
  int                 *error_code     /* Out */
);

(3) Arguments

cp

Specifies the handle (pointer) to the cache holding the value to be retrieved.

Specify the handle obtained from ead_start_cache().

key

Specifies the key associated with the value to be retrieved.

For details about the data types that can be specified, see 15.2.2(1) Data types that can be specified as keys.

error_code

Specifies the pointer from which to retrieve the error code.

For details about error codes, see 20.2 Error codes in the client library (C).

(4) Return value

The function returns the value information (ead_value_element structure) associated with the key.

For details about the ead_value_element structure, see 20.1.39 ead_value_element structure (value information).

NULL is set in the value member of the ead_value_element structure in the following cases:

(5) Notes

The memory area of the value information that is returned as the return value is not freed automatically. Instead, you must free it in the application program. For details, see 19.1.1(10) Freeing a memory area returned as a return value.