sends::seda_stage Class Reference
[Sends Pipeline Stage Classes]

Seda pipeline stage base class. More...

#include <seda_stage.hh>

Inheritance diagram for sends::seda_stage:

sends::thread_pool sends::authorize sends::concentrator sends::dump_trans sends::fetch_stage sends::lookup_stage sends::parse_stage sends::template_stage sends::write_stage

List of all members.

Public Member Functions

 seda_stage (int nThread, int nTrans=16)
 Stage constructor.
virtual ~seda_stage (void)
 Destructor.
int debug (void) const
 Debug level.
bool debug (int lvlmin) const
 Test debug level.
virtual void filter (transaction *trans)=0
 Stage processing method.
virtual void init_thread (void)
 Thread initialization method.
void link_output (seda_stage &pool)
 Link output to the next stage.
void link_alternate (seda_stage &pool)
 Link atlernate output to the next stage.
void put_output (transaction *trans)
 Pass transaction to the next pipeline stage.
void put_alternate (transaction *trans)
 Pass transaction to the branch pipeline stage.
tran_queue & ref_input (void)
 Reference the input queue.
void reject (transaction *trans, const std::string &msg)
 Reject a transaction.
void set_debug (int lvl)
 Set debug level.
void set_parameters (const stage_pars &p)
 Set stage parameters.
virtual void shut (void)
 Shut down all threads in the pool.
virtual const char * stage_name (void) const =0
 Stage name.
void start (void)
 Start pipeline stage.
virtual void thread_entry (void)
 Thread entry point.

Classes

struct  stage_pars
 Stage parameter structure. More...


Detailed Description

Seda pipeline stage base class.

The Seda Stage class provides the base for a server pipeline stage. each pipline stage uses a pool of threads to perform one stage of processing in the pipeline. The events to be processed are represented by tokens (transaction objects) placed in the input queue. After process by each stage is completed the tokens are passed on to the next stage (or alternate stage) as indicated by the output and alternate .

Author:
John Zweizig
Version:
1.0; Last modified April 25, 2008

Constructor & Destructor Documentation

sends::seda_stage::seda_stage ( int  nThread,
int  nTrans = 16 
)

Stage constructor.

Construct a stage with the specified number of threads in the thread pool and the specified number of transactions in the input queue.

Parameters:
nThread Initial number of threads in pool.
nTrans Number of transation sots in input queue.

virtual sends::seda_stage::~seda_stage ( void   )  [virtual]

Destructor.

Stage destructor.


Member Function Documentation

int sends::seda_stage::debug ( void   )  const [inline]

Debug level.

Return debug print level for this stage.

Returns:
Debug print level.

bool sends::seda_stage::debug ( int  lvlmin  )  const [inline]

Test debug level.

Test if debug level is greater than the specified value.

Parameters:
lvlmin Minimum debug level.
Returns:
True if debug print level is greater than threshold.

virtual void sends::seda_stage::filter ( transaction trans  )  [pure virtual]

Stage processing method.

Method to perform pipeline stage processing on the transaction passed as an argument.

Parameters:
trans Trnsaction to be processed by this method.

Implemented in sends::authorize, sends::concentrator, sends::dump_trans, sends::fetch_stage, sends::lookup_stage, sends::parse_stage, sends::template_stage, and sends::write_stage.

virtual void sends::seda_stage::init_thread ( void   )  [virtual]

Thread initialization method.

Method to perform initialization processing for each thread.

Reimplemented in sends::concentrator, sends::parse_stage, and sends::write_stage.

void sends::seda_stage::link_output ( seda_stage pool  ) 

Link output to the next stage.

Link the output queue pointer to the input of the specified stage.

Parameters:
pool Next stage in the pipeline.

void sends::seda_stage::link_alternate ( seda_stage pool  ) 

Link atlernate output to the next stage.

Link the alternate queue pointer to the input of the specified stage.

Parameters:
pool Next stage in the pipeline.

void sends::seda_stage::put_output ( transaction trans  ) 

Pass transaction to the next pipeline stage.

Enter the transaction into the output queue (i.e. the input queue of the next stage in the pipeline.

Parameters:
trans Transaction to be passed to the output.

void sends::seda_stage::put_alternate ( transaction trans  ) 

Pass transaction to the branch pipeline stage.

Enter the transaction into the alternate queue (i.e. the input queue of the branch stage in the pipeline).

Parameters:
trans Transaction to be passed to the alternate output.

tran_queue & sends::seda_stage::ref_input ( void   )  [inline]

Reference the input queue.

Return a reference to the input queue for this stage.

Returns:
Reference to the input queue.

void sends::seda_stage::reject ( transaction trans,
const std::string &  msg 
)

Reject a transaction.

Close and release a transaction after a fatal error condition.

Parameters:
trans Pointer to transaction object.
msg Message indicating reason for the rejection.

void sends::seda_stage::set_debug ( int  lvl  ) 

Set debug level.

Set the debug print level for this stage.

Parameters:
lvl value of debug print level for this stage.

void sends::seda_stage::set_parameters ( const stage_pars p  ) 

Set stage parameters.

Set the parameters for this stage.

Parameters:
p parameter block.

virtual void sends::seda_stage::shut ( void   )  [virtual]

Shut down all threads in the pool.

Shut down all threads in the pool by doing the following:

  • Set the pool size to zero. This will prevent the pool from starting new threads and kill threads as they are released.
  • Shut down the input queue. This will release any waiting threads and prevent any further transactions from being added to the queue.
  • release any transactions remaining in the pool.
  • print statistics

Reimplemented in sends::parse_stage.

virtual const char* sends::seda_stage::stage_name ( void   )  const [pure virtual]

Stage name.

Return a constant pointer to the character vector containing the name of this stage.

Returns:
pointer to the stage name.

Implemented in sends::authorize, sends::concentrator, sends::dump_trans, sends::fetch_stage, sends::lookup_stage, sends::parse_stage, sends::template_stage, and sends::write_stage.

void sends::seda_stage::start ( void   ) 

Start pipeline stage.

Perform pipeline stage startup processing including starting up the initial number of threads.

virtual void sends::seda_stage::thread_entry ( void   )  [virtual]

Thread entry point.

Common stage code that provides synchronization and account between thread in the same stage.

Reimplemented from sends::thread_pool.


The documentation for this class was generated from the following file:

Generated on Tue Jun 10 12:18:12 2008 for SENDS by  doxygen 1.5.5