Modifier and Type | Class and Description |
---|---|
static class |
AnalystWorker.WorkType |
Modifier and Type | Field and Description |
---|---|
boolean |
autoShutdown
should this worker shut down automatically
|
int |
dryRunFailureRate
If this value is non-negative, the worker will not actually do any work.
|
static String |
machineId
worker ID - just a random ID so we can differentiate machines used for computation.
|
static int |
POLL_TIMEOUT |
static Random |
random |
static int |
SINGLE_POINT_KEEPALIVE
How long (minimum, in milliseconds) should this worker stay alive after receiving a single point request?
|
static String |
WORKER_ID_HEADER |
Constructor and Description |
---|
AnalystWorker(Properties config) |
Modifier and Type | Method and Description |
---|---|
void |
deleteRequest(AnalystClusterRequest clusterRequest)
Tell the broker that the given message has been successfully processed by a worker (HTTP DELETE).
|
void |
finishPriorityTask(AnalystClusterRequest clusterRequest,
Object result)
Signal the broker that the given high-priority task is completed, providing a result.
|
String |
getInstanceType()
Get the AWS instance type if applicable
|
List<AnalystClusterRequest> |
getSomeWork(AnalystWorker.WorkType type) |
static void |
main(String[] args)
Requires a worker configuration, which is a Java Properties file with the following
attributes.
|
void |
run()
This is the main worker event loop which fetches tasks from a broker and schedules them for execution.
|
public static final String machineId
public static final String WORKER_ID_HEADER
public static final int POLL_TIMEOUT
public int dryRunFailureRate
public static final int SINGLE_POINT_KEEPALIVE
public final boolean autoShutdown
public static final Random random
public AnalystWorker(Properties config)
public void run()
public List<AnalystClusterRequest> getSomeWork(AnalystWorker.WorkType type)
public void finishPriorityTask(AnalystClusterRequest clusterRequest, Object result)
public void deleteRequest(AnalystClusterRequest clusterRequest)
public String getInstanceType()
public static void main(String[] args)
Copyright © 2018. All rights reserved.