Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


20.1.32 ead_execute_node_function() (executes a user function with an EADS server specified)

Organization of this subsection

(1) Description

This function executes a user function with an EADS server specified.

(2) Format

#include <eads.h>
ead_object ead_execute_node_function
(
  const EAD_CACHE      *cp,            /* In */
  const ead_node       *target_node,   /* 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().

target_node

Specifies a pointer to the EADS server (ead_node structure) that will execute the user function.

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.

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