public class JMWorkerHandler extends java.lang.Object implements MessageHandler, IWorkerEventSender
It gets request messages from workers and talks to WorkerMonitor It sends response messages back to workers
Constructor and Description |
---|
JMWorkerHandler(WorkerMonitor workerMonitor,
RRServer rrServer,
boolean zkUsed) |
Modifier and Type | Method and Description |
---|---|
void |
allJoined()
all workers joined the job
|
boolean |
isAllConnected() |
void |
jobScaled(int change,
int numberOfWorkers)
job scaled up or down
|
void |
onMessage(RequestID id,
int workerId,
Message message)
Handles a specific message type
|
void |
unsetAllConnected()
this is called after worker scale-up
sets allConnected to false
|
void |
workerFailed(int workerID)
the worker with the provided workerID failed
|
void |
workerRestarted(JobMasterAPI.WorkerInfo workerInfo)
the worker with the provided workerInfo restarted
|
public JMWorkerHandler(WorkerMonitor workerMonitor, RRServer rrServer, boolean zkUsed)
public boolean isAllConnected()
public void onMessage(RequestID id, int workerId, Message message)
MessageHandler
onMessage
in interface MessageHandler
id
- request idworkerId
- worker idmessage
- protbuf messagepublic void unsetAllConnected()
public void workerFailed(int workerID)
IWorkerEventSender
workerFailed
in interface IWorkerEventSender
public void workerRestarted(JobMasterAPI.WorkerInfo workerInfo)
IWorkerEventSender
workerRestarted
in interface IWorkerEventSender
public void allJoined()
IWorkerEventSender
allJoined
in interface IWorkerEventSender
public void jobScaled(int change, int numberOfWorkers)
IWorkerEventSender
jobScaled
in interface IWorkerEventSender