public class ERXJobLoadBalancer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ERXJobLoadBalancer.JobSet
Describes which jobs (index mod modulo) the worker should attempt to process
|
static class |
ERXJobLoadBalancer.WorkerIdentification
Identifies a worker to the load balancer
|
Constructor and Description |
---|
ERXJobLoadBalancer() |
Modifier and Type | Method and Description |
---|---|
static void |
createJobs(String workerType,
int n) |
void |
heartbeat(ERXJobLoadBalancer.WorkerIdentification workerId)
Signals to the load balancer that the worker identified is alive
Clients should call this periodically, and certainly more often than the timeout
|
ERXJobLoadBalancer.JobSet |
idSpace(ERXJobLoadBalancer.WorkerIdentification workerId) |
static ERXJobLoadBalancer |
jobLoadBalancer() |
static void |
main(String[] args) |
protected String |
pathForWorkerIdentification(ERXJobLoadBalancer.WorkerIdentification workerId) |
static void |
processJobs(String workerType,
int workerNumber) |
void |
setTtlForWorkerType(String type,
long ttl)
Sets the timeout for a given worker type
|
protected File |
sharedRoot() |
String |
sharedRootLocation() |
long |
ttlForWorkerType(String type) |
static void |
usage() |
String |
workerInstanceIdentification() |
public static ERXJobLoadBalancer jobLoadBalancer()
public String sharedRootLocation()
protected File sharedRoot()
public long ttlForWorkerType(String type)
type
- public void setTtlForWorkerType(String type, long ttl)
type
- ttl
- (in milliseconds)protected String pathForWorkerIdentification(ERXJobLoadBalancer.WorkerIdentification workerId)
public void heartbeat(ERXJobLoadBalancer.WorkerIdentification workerId)
workerId
- which worker is alivepublic ERXJobLoadBalancer.JobSet idSpace(ERXJobLoadBalancer.WorkerIdentification workerId)
workerId
- public String workerInstanceIdentification()
public static void main(String[] args)
public static void usage()
public static void createJobs(String workerType, int n)
public static void processJobs(String workerType, int workerNumber)
Copyright © 2002 – 2020 Project Wonder.