Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


20.1.12 ead_replace() (replaces a value)

Organization of this subsection

(1) Description

This function compares the value associated with a specified key to the value information specified in a comparison condition, and stores the value with the key only if the values match (replaces the value).

(2) Format

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

(3) Arguments

cp

Specifies the handle (pointer) to the cache where the key and value are to be stored.

Specify the handle obtained from ead_start_cache().

key

Specifies the key associated with the value to be replaced.

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

value

Specifies the value information (ead_value_element structure) to be stored.

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

comparative_value

Specifies the value information (ead_value_element structure) to compare.

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

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).