Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

PseudoScheduler Class Reference

#include <PseudoScheduler.h>

Inherits Scheduler.

List of all members.


Detailed Description

A simple scheduler implementation that launches only a single thread to run boxes.


Public Member Functions

 PseudoScheduler ()
void start ()
 Called when a node is started.
void shutdown ()
 Called when a node is stopped.
void scheduleExclusiveTask (ptr< SchedulerTask >)
 Schedules a task to be run as soon as possible, at some point when no boxes are running.
void topologyChanged ()
 Invoked when the network topology changes, i.e., one or more boxes or streams were added or removed.
void drain ()
 Drains the network: waits until there are no more tuples at all in the network and then shuts the network.
void removeFromSchedule (QBox *b)

Public Attributes

vector< string > _disabled_boxes


Constructor & Destructor Documentation

PseudoScheduler::PseudoScheduler  ) 
 


Member Function Documentation

void PseudoScheduler::drain  )  [virtual]
 

Drains the network: waits until there are no more tuples at all in the network and then shuts the network.

Blocks until this is complete, at which point the only valid operation is shutdown(). May be invoked only if the scheduler supports draining.

Reimplemented from Scheduler.

void PseudoScheduler::removeFromSchedule QBox b  )  [virtual]
 

Reimplemented from Scheduler.

void PseudoScheduler::scheduleExclusiveTask ptr< SchedulerTask  )  [virtual]
 

Schedules a task to be run as soon as possible, at some point when no boxes are running.

For example, the scheduler may maintain a thread-safe vector of ptr<SchedulerTask>s. Whenever this vector becomes non-empty, it can signal box-running threads to pause; wait for all pending run() calls to complete; and then run the tasks in one of the box-running threads.

Implements Scheduler.

void PseudoScheduler::shutdown  )  [virtual]
 

Called when a node is stopped.

The implementation of this method must stop any threads that are running boxes and wait for their termination (i.e., join them).

Implements Scheduler.

void PseudoScheduler::start  )  [virtual]
 

Called when a node is started.

The implementation of this method should create one or more threads to run boxes.

Implements Scheduler.

void PseudoScheduler::topologyChanged  )  [virtual]
 

Invoked when the network topology changes, i.e., one or more boxes or streams were added or removed.

This method may only be invoked from within an exclusive task (since the network topology may only change within an exclusive task), and only if the scheduler supports dynamic networks.

Reimplemented from Scheduler.


Member Data Documentation

vector<string> PseudoScheduler::_disabled_boxes
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 12 15:15:23 2004 for Borealis by doxygen 1.3.8