Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


20.1.30 ead_execute_function() (executes a user function with key specification or group specification)

Organization of this subsection

(1) Description

This function uses a specified key or group to determine the EADS server on which a user function is to be executed and then executes that user function.

(2) Format

#include <eads.h>
ead_object ead_execute_function
(
  const EAD_CACHE      *cp,                     /* In */
  const char           *key_or_group_name,      /* In */
  const char           *func_name,              /* In */
  const ead_object     *arg,                    /* In */
  int                  *error_code              /* Out */
);

(3) Arguments

cp

Specifies the handle (pointer) to the cache for the user function to be executed.

Specify the handle obtained from ead_start_cache().

key_or_group_name

Specifies a key or a group name.

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

func_name

Specifies the name of the user function.

A user function name can consist of single-byte alphanumeric characters (0 to 9, A to Z, and a to z), underscores (_), periods (.), and dollar signs ($).

There is no limit to the number of characters.

arg

Specifies the arguments (ead_object structure) to pass to the user function.

For details about the ead_object structure, see 20.1.48 ead_object structure (object used in a user function).

If there are no arguments to be passed, specify NULL.

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

If ead_execute_function() terminates normally, it returns the user function execution results (ead_object structure).

For details about the ead_object structure, see 20.1.48 ead_object structure (object used in a user function).

The object_size member of the ead_object structure will contain the size of the byte array specified for the user function's return value.

NULL is set in the object member of the ead_object structure in the following cases:

(5) Notes

The memory area for storing the user function execution results that are 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.