Developing Apama Applications > Developing Apama Applications in EPL > Using Correlator Persistence > How the correlator recovers state > Recovery order
Recovery order
When the correlator recovers state from a recovery datastore it does the following in the following order:
1. Recompile and reinject all source except for deleted events and monitors, which are ignored.
2. Restore objects and listeners in persistent monitors. The correlator does not execute any user code in the first two steps. While it sets up listeners, the listeners cannot yet change state.
3. Set currentTime to the currentTime of the last committed snapshot, which might be considerably earlier than the current time of day if the correlator was down for some time before recovering.
4. Initiate execution of any onBeginRecovery() actions on instances of restored events, monitors, and custom aggregate functions in all persistent monitor instances in all contexts. The order of execution of these actions is undefined. See Defining recovery actions.
5. Quiesce — The correlator waits for all events that have been sent to a context to be processed, and also waits for any events that are sent to a context as a result of those events to be processsed, and so on, until no more events are generated and sent to a context. The correlator also does this for spawn...to statements. This is similar to processing all events in all queues. Be careful not to generate an infinite loop of send...to statements.
6. Restore events, clock ticks, pending spawn...to statements, and so on, that were waiting on context queues when the snapshot was taken.
7. Send a single clock tick of the time at which the correlator is recovered, that is, the current time of day. If -XrecoveryTime was set when the correlator was started, the correlator uses that time for the current time of day.
8. Initiate execution of onload() actions in all non-persistent monitors in injection order.
9. Quiesce.
10. Initiate execution of any onConcludeRecovery() actions on instances of restored events, monitors, and custom aggregate functions in all persistent monitor instances in all contexts. The order of execution of these actions is undefined. See Defining recovery actions.
11. Quiesce.
12. Start generating clock ticks.
13. Start taking persistence snapshots.
14. Open the server port. External components can now connect with the correlator, for example, IAF, engine_send, and engine_receive.
Copyright © 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.