#include "dnxJobList.h"
#include "dnxTransport.h"
Go to the source code of this file.
Data Structures | |
struct | DnxDispatcher |
Abstract data type for the DNX job dispatcher. More... | |
Functions | |
DnxChannel * | dnxDispatcherGetChannel (DnxDispatcher *disp) |
Return a reference to the dispatcher channel object. | |
int | dnxDispatcherCreate (char *chname, char *url, DnxJobList *joblist, DnxDispatcher **pdisp) |
Create a new dispatcher object. | |
void | dnxDispatcherDestroy (DnxDispatcher *disp) |
Destroy an existing dispatcher object. |
The purpose of this thread is to dispatch service check jobs to the registered worker nodes for execution. It accomplishes this by accepting work node registrations and then dispatching service check jobs to registered worker nodes using a weighted-round-robin algorithm. The algorithm's weighting is based upon the number of jobs-per-second throughput rating of each worker node.
Definition in file dnxDispatcher.h.
int dnxDispatcherCreate | ( | char * | chname, | |
char * | url, | |||
DnxJobList * | joblist, | |||
DnxDispatcher ** | pdisp | |||
) |
Create a new dispatcher object.
[in] | chname | - the name of the dispatch channel. |
[in] | url | - the dispatcher channel URL. |
[in] | joblist | - a pointer to the global job list object. |
[out] | pdisp | - the address of storage for the return of the new dispatcher object. |
[in] | chname | - the name of the dispatch channel. |
[in] | url | - the dispatcher channel url. |
[in] | joblist | - a pointer to the global job list object. |
[out] | pdisp | - the address of storage for the return of the new dispatcher object. |
Definition at line 177 of file dnxDispatcher.c.
References iDnxDispatcher_::channel, iDnxDispatcher_::chname, DNX_ERR_MEMORY, DNX_ERR_THREAD, DNX_MODE_PASSIVE, DNX_OK, dnxChanMapAdd(), dnxChanMapDelete(), dnxConnect(), dnxDisconnect(), dnxDispatcher(), dnxErrorString(), dnxLog(), iDnxDispatcher_::joblist, iDnxDispatcher_::tid, iDnxDispatcher_::url, xfree, xmalloc, and xstrdup.
Referenced by dnxServerInit().
void dnxDispatcherDestroy | ( | DnxDispatcher * | disp | ) |
Destroy an existing dispatcher object.
[in] | disp | - a pointer to the dispatcher object to be destroyed. |
Definition at line 239 of file dnxDispatcher.c.
References iDnxDispatcher_::channel, iDnxDispatcher_::chname, dnxChanMapDelete(), dnxDisconnect(), iDnxDispatcher_::tid, iDnxDispatcher_::url, and xfree.
Referenced by dnxServerDeInit().
DnxChannel* dnxDispatcherGetChannel | ( | DnxDispatcher * | disp | ) |
Return a reference to the dispatcher channel object.
[in] | disp | - the dispatcher whose dispatch channel should be returned. |
This method exists so the registrar can send a job on the same socket from which it received a job request.
[in] | disp | - the dispatcher from which to retrieve the channel. |
disp
. Definition at line 172 of file dnxDispatcher.c.
Referenced by dnxServerInit().