Launching a remote analytic executable

There are three types of AE registration:
  • Local AE: For a local AE, the NPS launches the AE process.
  • Remote AE: For a remote AE, the Netezza system does not launch the AE process; it looks for a previously-running instance, listening on a specific remote AE connection point address. The key register_ae setting for a remote AE is --remote.
  • Remote AE Launch: The third type of registration is for launching a remote AE. A launch registration has elements from both local and remote registrations. You must specify the program to execute, as with a local registration. You must specify the connection point settings, as with a remote registration. The key register_ae setting for a remote launch registration is --launch.

A registration for launching an AE must always be for a table function with an argument signature of bigint and return TABLE(aeresult varchar(255)).

Remote AE Launch Examples

When the launch function is called, it starts the remote AE, similar to a Linux daemon. The remote AE is then ready for requests.

$NZ_EXPORT_DIR/ae/utilities/bin/register_ae --language java --template udtf \
 --version 3 
--sig "apply_launch_v1(bigint)" 
--return "TABLE(aeresult varchar(255))" 
--define java_class=org.netezza.education.ApplyDriverV4 
--launch 
--rname apply 
--level 1

To launch on the host:

SELECT aeresult FROM TABLE WITH FINAL(apply_launch_v1(0));

To launch on a SPU:

SELECT aeresult FROM _v_dual_dslice, TABLE WITH FINAL(apply_launch_v1(dsid));

The return column, aeresult, contains information about the launched remote AE, such as the remote AE process IDs, that may be useful for troubleshooting. If the launch fails, this function throws an exception.

Example

SELECT * FROM TABLE WITH FINAL(apply_launch_v1(0));
AERESULT 
---------------------------------------------------------------------------------
------------------
tran: 2704 session: 17646 DATA slc: 0 hardware: 0 machine: hostname process:
24320 thread: 24321

For more information about registering a remote AE launch function, see Registering Analytic Executables. For information about controlling a running remote AE, see the next section, Controlling a Running Remote AE.