REEF imposes a centralized control flow design on applications: All events are routed to the master node, called the Driver. REEF also prescribes event-driven programming for the Driver. In that sense, the application provided Driver is a collection of event handlers for the various events exposed in `DriverConfiguration`. While most of these deal with occurrences during the computation (Evaluator allocation, Task launch, ...), several stand out as life-cycle events of the Driver, and therefore the application:

ON_START

This event is triggered by REEF when the Driver is ready to start executing. At this point communication with the Resource Manager has been established, all event handlers have been instantiated and the event graph in the Driver was deemed to be complete enough to start. In a typical application, this is when the Driver requests the first set of Evaluators.

ON_STOP

This event is fired right before the Driver shuts down. REEF determines Driver shutdown by proof that no future events can happen:

  • The Clock has no outstanding alarms.
  •  The resource manager has no outstanding requests.
  • The application has no Evaluators allocated anymore.

Hence, the ON_STOP event can be used to prevent Driver shutdown, e.g. in applications that need to wait for external triggers (e.g. a UI) to proceed. To do so, one would schedule an alarm in the ON_STOP handler.

  • No labels