ERXJobLoadBalancer Class Reference

Collaboration diagram for ERXJobLoadBalancer:

Collaboration graph
[legend]

List of all members.

Classes

class  JobSet
class  WorkerIdentification

Public Member Functions

void heartbeat (WorkerIdentification workerId)
JobSet idSpace (final WorkerIdentification workerId)
void setTtlForWorkerType (String type, long ttl)
String sharedRootLocation ()
long ttlForWorkerType (String type)
String workerInstanceIdentification ()

Static Public Member Functions

static void createJobs (String workerType, int n)
static ERXJobLoadBalancer jobLoadBalancer ()
static void main (String[] args)
static void processJobs (String workerType, int workerNumber)
static void usage ()

Protected Member Functions

String pathForWorkerIdentification (WorkerIdentification workerId)
File sharedRoot ()

Private Attributes

File _sharedRoot
String _sharedRootLocation
Hashtable _ttlsPerType = new Hashtable()

Static Private Attributes

static ERXJobLoadBalancer _instance
static final String DEFAULT_DEAD_TIMEOUT_MILLIS = "er.extensions.ERXJobLoadBalancer.DefaultDeadTimeoutMillis"
static final Logger log = Logger.getLogger(ERXJobLoadBalancer.class)
static final String SHARED_ROOT_LOCATION = "er.extensions.ERXJobLoadBalancer.RootLocation"


Member Function Documentation

static void createJobs ( String  workerType,
int  n 
) [static]

void heartbeat ( WorkerIdentification  workerId  ) 

Signals to the load balncer that the worker identified is alive Clients should call this periodically, and certainly more often than the timeout

Parameters:
workerId which worker is alive

JobSet idSpace ( final WorkerIdentification  workerId  ) 

Parameters:
workerId 
Returns:
the JobSet that the worker should attempt to process Given a worker looks at the shared state and determine the id space (index mod module) they should be processing

static ERXJobLoadBalancer jobLoadBalancer (  )  [static]

static void main ( String[]  args  )  [static]

String pathForWorkerIdentification ( WorkerIdentification  workerId  )  [protected]

static void processJobs ( String  workerType,
int  workerNumber 
) [static]

void setTtlForWorkerType ( String  type,
long  ttl 
)

Sets the timeout for a given worker type

Parameters:
type 
ttl (in milliseconds)

File sharedRoot (  )  [protected]

String sharedRootLocation (  ) 

Returns:
the shared path where the state of the workers is stored

long ttlForWorkerType ( String  type  ) 

Parameters:
type 
Returns:
the ttl for a given worker type. An instance that has not called heartbeat for more than this TTL will be considered dead by the other instances

static void usage (  )  [static]

String workerInstanceIdentification (  ) 

Returns:
a String suitable to identify this particular worker instance !! this string is not MT safe


Member Data Documentation

ERXJobLoadBalancer _instance [static, private]

File _sharedRoot [private]

Hashtable _ttlsPerType = new Hashtable() [private]

final String DEFAULT_DEAD_TIMEOUT_MILLIS = "er.extensions.ERXJobLoadBalancer.DefaultDeadTimeoutMillis" [static, private]

final Logger log = Logger.getLogger(ERXJobLoadBalancer.class) [static, private]

final String SHARED_ROOT_LOCATION = "er.extensions.ERXJobLoadBalancer.RootLocation" [static, private]


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

Generated on Sat May 26 06:43:07 2012 for Project Wonder by  doxygen 1.5.8