public class MesosWorkerController extends java.lang.Object implements IWorkerController
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
LOG |
| Constructor and Description |
|---|
MesosWorkerController(Config cfg,
JobAPI.Job job,
java.lang.String ip,
int port,
int workerID) |
MesosWorkerController(Config cfg,
JobAPI.Job job,
java.lang.String ip,
int port,
int workerID,
JobAPI.ComputeResource computeResource,
java.util.Map<java.lang.String,java.lang.Integer> additionalPorts) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
needs to close down when finished computation
|
java.util.List<JobMasterAPI.WorkerInfo> |
getAllWorkers()
get all workers in the job.
|
java.util.List<JobMasterAPI.WorkerInfo> |
getJoinedWorkers()
get all joined workers in this job, including the ones finished execution
if there are some workers that have not joined yet, they may not be included in this list.
|
int |
getNumberOfWorkers()
return the number of all workers in this job,
including non-started ones and finished ones
|
JobMasterAPI.WorkerInfo |
getWorkerInfo()
return the WorkerInfo object for this worker
|
JobMasterAPI.WorkerInfo |
getWorkerInfoForID(int id)
return the WorkerInfo object for the given ID
|
void |
initializeWithZooKeeper() |
void |
waitOnBarrier()
wait for all workers in the job to arrive at this barrier
After waiting for the timeout specified in ControllerContext.maxWaitTimeOnBarrier
if some workers still could not arrive at the barrier, throw an exception
|
void |
waitOnBarrier(long timeLimit)
wait for all workers in the job to arrive at this barrier
After waiting for the timeLimit,
if some workers still could not arrive at the barrier, throw an exception
|
void |
waitOnInitBarrier()
this barrier is used when initializing the workers.
|
int |
workerRestartCount()
get worker restartCount
zero means starting for the first time
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCheckpointingClient, getFailureListenerpublic MesosWorkerController(Config cfg, JobAPI.Job job, java.lang.String ip, int port, int workerID)
public MesosWorkerController(Config cfg, JobAPI.Job job, java.lang.String ip, int port, int workerID, JobAPI.ComputeResource computeResource, java.util.Map<java.lang.String,java.lang.Integer> additionalPorts)
public JobMasterAPI.WorkerInfo getWorkerInfo()
IWorkerControllergetWorkerInfo in interface IWorkerControllerpublic JobMasterAPI.WorkerInfo getWorkerInfoForID(int id)
IWorkerControllergetWorkerInfoForID in interface IWorkerControllerpublic int getNumberOfWorkers()
IWorkerControllergetNumberOfWorkers in interface IWorkerControllerpublic java.util.List<JobMasterAPI.WorkerInfo> getJoinedWorkers()
IWorkerControllergetJoinedWorkers in interface IWorkerControllerpublic int workerRestartCount()
IWorkerControllerworkerRestartCount in interface IWorkerControllerpublic void initializeWithZooKeeper()
public java.util.List<JobMasterAPI.WorkerInfo> getAllWorkers()
throws TimeoutException
IWorkerControllerreturn all workers in the job including the ones that have already left, if any
getAllWorkers in interface IWorkerControllerTimeoutExceptionpublic void waitOnBarrier()
throws TimeoutException
IWorkerControllerwaitOnBarrier in interface IWorkerControllerTimeoutExceptionpublic void waitOnBarrier(long timeLimit)
throws TimeoutException,
JobFaultyException
IWorkerControllerwaitOnBarrier in interface IWorkerControllerTimeoutExceptionJobFaultyExceptionpublic void waitOnInitBarrier()
throws TimeoutException
IWorkerControllerwaitOnInitBarrier in interface IWorkerControllerTimeoutExceptionpublic void close()