Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


20.1.33 ead_execute_node_function_rt() (executes a user function with EADS server and reception timeout specification)

Organization of this subsection

(1) Description

This function executes a user function with an EADS server specified and 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_node_function_rt() is executing.

(2) Format

#include <eads.h>
ead_object ead_execute_node_function_rt
(
  const EAD_CACHE      *cp,             /* In */
  const ead_node       *target_node,    /* 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 on which the user function is to be executed.

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

target_node

Specifies the pointer to the EADS server (ead_node structure) on which the user function is to be executed.

You can only specify the pointer of the ead_node structure obtained by using the EADS client library. If you specify any other pointer, correct operation is not guaranteed.

For the format and details of the ead_node structure, see 20.1.50 ead_node structure (object used in a user function with an EADS server specified).

An error results if the address information (IP address and port number) managed by the specified ead_node structure does not match the address information of any EADS servers maintained by the EADS client.

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