Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


20.1.31 ead_execute_function_rt() (executes a user function with key specification or group specification and reception timeout 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. This function also sets a reception timeout value.

The value of the eads.client.connection.receive.timeout parameter in the client properties is not applicable while ead_execute_function_rt() is executing.

(2) Format

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

(3) Arguments

cp

Specifies the handle (pointer) to the cache in which the user function is to be executed.

Specify the handle (pointer) obtained from ead_start_cache() when access to the cache was started.

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.

recv_timeout

Specifies a data reception timeout value (in milliseconds).

For details about the data that can be specified, see 9.3.3(3)(b) eads.client.connection.receive.timeout.

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_rt() terminates normally, it returns the user function execution results (ead_object structure).

For details about the ead_object structure and its format, 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 is returned as the return value is not freed automatically. You must free it in the application program. For details, see 19.1.1(10) Freeing a memory area returned as a return value.