Deploying and Managing Apama Applications > Correlator Utilities Reference > Deleting code from a correlator
Deleting code from a correlator
The engine_delete tool removes EPL code and JMon applications from the correlator. The executable for this tool is located in the bin directory of the Apama installation. Running the tool in the Apama Command Prompt ensures that the environment variables are set correctly.
Synopsis
To remove applications from the event correlator:
*On Windows, run engine_delete.exe.
*On UNIX, run engine_delete.
To obtain the following usage message, run the command without any options or with the –h option:
Usage: engine_delete [ options ] [ name1 [ name2 ... ] ]
To delete named objects from a correlator.
Where options include:
-h | --help This message
-n | --hostname <host> Connect to an engine on <host>
-p | --port <port> Engine is listening on <port>
-f | --file <filename> Read names from <filename>
-F | --force Force deletion of names even if they are in use
-k | --kill Kill a monitor by name even if it is running
-a | --all Delete everything in the engine - use with care
-y | --yes Don't ask 'are you sure?' when deleting all
-v | --verbose Be more verbose
-u | --utf8 Assume input is in UTF8
-V | --version Print program version info
Use '-' to read from <stdin>
Multiple -f options may be given
Description
The engine_delete tool deletes named applications, monitors and event types from an event correlator. Names are the full package names as previously assigned to an application monitor or event type when injected into the event correlator.
To specify the items you want to delete, you can specify any one of the following in the engine_delete command line:
*Names of the items to delete.
*The -f option with the name of a file that contains the names of the items you want to delete. In this file, specify each name on a separate line.
*Neither of the above. In this case, the engine_delete tool reads names from stdin until you type an end-of-file signal, (CTRL-D on UNIX and CTRL-Z on Windows). If you want, you can specify "-" in the command line to indicate that input will come from stdin.
The tool is silent by default unless an error occurs. To receive progress information, specify the –v option.
The tool permits two kinds of operations — delete and kill. These cause different side-effects and you must use them carefully.
*When you delete a monitor, the correlator tries to terminate all of that monitor’s instances. If they are responsive (not in some deadlocked state) each one executes its ondie() action, and when the last one exits the correlator calls the monitor’s onunload() action. This assumes that the monitor you are deleting defines ondie() and onunload() actions.
If a monitor instance does not respond to a delete request, the correlator cannot invoke the monitor’s onunload() action. In this case, you must kill, rather than delete, the monitor instance.
*When you kill a monitor, the correlator immediately terminates all of the monitor’s instances, without invoking ondie() or onunload() actions.
Options
The tool engine_delete tool takes the following command line options:
Option
Description
 
-h
Displays usage information. Optional.
 
-n host
Name of the host on which the event correlator is running. Optional. The default is localhost.
Note: Non-ASCII characters in host names are not supported.
 
-p port
Port on which the event correlator is listening. Optional. The default is 15903.
 
-f filename
Indicates that you want the engine_delete tool to read names of items to delete from the specified file. In this file, each line contains one name. Optional. The default is that input comes from stdin.
 
-F
Forces deletion of named event types even if they are still in use — that is, they are referenced by active monitors or applications. A forced delete also removes all objects that refer to the event type you are deleting. For example, if monitor A has listeners for B events and C events and you forcibly delete C events the operation deletes monitor A, which of course means that the listener for B events is deleted. Optional. The default is that event types that are in use are not deleted.
 
-k
Kills all instances of the named monitor regardless of whether an instance is in use. For example, you can specify this option to remove a monitor that is stuck in an infinite loop. Any ondie() and onunload() actions defined in killed monitors are not executed.
 
-a
Forces deletion of all applications, monitors, and event types. The correlator finishes processing any events on input queues and then does the deletions. Any events sent after invoking engine_delete -a are not recognized. Specifying this option does not stop a monitor that is in an infinite loop. You must explicitly kill such monitors. Specifying the -a option is equivalent to specifying the -F option and naming every object in the correlator. If you want to kill every object in the correlator, shut down and restart the correlator. See Shutting down and managing components.
 
-y
Removes the "are you sure?" prompt when using the -a option.
 
-v
Requests verbose output.
 
-u
Indicates that input files are in UTF-8 encoding. This specifies that the engine_delete utility should not convert the input to any other encoding.
 
-V
Displays version information for the engine_delete tool.
Operands
The engine_delete tool takes the following operands:
 
[ name1 [ name2 ... ] ]
The name of zero or more EPL or JMon applications, monitors and/or event types to delete from the event correlator.
If you do not specify at least one item name, and you do not specify the -f option, the engine_delete tool expects input from stdin.
Exit status
The following exit values are returned:
Status
Description
 
0
The items were deleted from the event correlator successfully.
 
1
No connection to the event correlator was possible or the connection failed.
 
2
Other error(s) occurred while deleting the named items.
Copyright © 2013-2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.