dnxRegistrar.h File Reference

Definitions and prototypes for the DNX Registrar thread. More...

#include "dnxQueue.h"
#include "dnxTransport.h"
#include "dnxProtocol.h"

Go to the source code of this file.

Data Structures

struct  DnxRegistrar
 An abstraction data type for the DNX registrar object. More...

Functions

int dnxGetNodeRequest (DnxRegistrar *reg, DnxNodeRequest **ppNode)
 Return an available node "request for work" object pointer.
int dnxRegistrarCreate (unsigned queuesz, DnxChannel *dispchan, DnxRegistrar **preg)
 Create a new registrar object.
void dnxRegistrarDestroy (DnxRegistrar *reg)
 Destroy a previously created registrar object.


Detailed Description

Definitions and prototypes for the DNX Registrar thread.

The purpose of this thread is to manage Worker Node registrations. When a Worker Node wants to receive ervice check jobs from the Scheduler Node, it must first register itself with the Scheduler Node by sending a TCP-based registration message to it.

The Registrar thread manages this registration process on behalf of the Scheduler.

Author:
Robert W. Ingraham (dnx-devel@lists.sourceforge.net)
Attention:
Please submit patches to http://dnx.sourceforge.net

Definition in file dnxRegistrar.h.


Function Documentation

int dnxGetNodeRequest ( DnxRegistrar reg,
DnxNodeRequest **  ppNode 
)

Return an available node "request for work" object pointer.

Parameters:
[in] reg - the registrar from which a node request should be returned.
[out] ppNode - the address of storage in which to return the located request node.
Returns:
Zero on success, or a non-zero error value.

Definition at line 236 of file dnxRegistrar.c.

References DNX_ERR_TIMEOUT, DNX_OK, dnxDebug(), dnxErrorString(), dnxQueueGet(), dnxStatsInc(), JOBS_REJECTED_NO_NODES, REQUESTS_EXPIRED, iDnxRegistrar_::rqueue, and xfree.

Referenced by ehSvcCheck(), ProcessJobTransferMsg(), and processRequests().

int dnxRegistrarCreate ( unsigned  queuesz,
DnxChannel dispchan,
DnxRegistrar **  preg 
)

Create a new registrar object.

Parameters:
[in] queuesz - the size of the queue to create in this registrar.
[in] dispchan - a pointer to the dispatcher channel.
[out] preg - the address of storage in which to return the newly created registrar.
Returns:
Zero on success, or a non-zero error value.

Definition at line 285 of file dnxRegistrar.c.

References iDnxRegistrar_::dispchan, DNX_ERR_MEMORY, DNX_ERR_THREAD, DNX_OK, dnxErrorString(), dnxLog(), dnxQueueCreate(), dnxRegistrar(), iDnxRegistrar_::rqueue, iDnxRegistrar_::tid, xfree, and xmalloc.

void dnxRegistrarDestroy ( DnxRegistrar reg  ) 

Destroy a previously created registrar object.

Signals the registrar thread, waits for it to stop, and frees allocated resources.

Parameters:
[in] reg - the registrar to be destroyed.

Definition at line 318 of file dnxRegistrar.c.

References dnxQueueDestroy(), iDnxRegistrar_::rqueue, iDnxRegistrar_::tid, and xfree.

Referenced by dnxServerDeInit().


Generated on Tue Apr 13 15:48:08 2010 for DNX by  doxygen 1.5.6