public class BasicK8sWorker extends java.lang.Object implements IWorker, IScalerListener, IReceiverFromDriver
Constructor and Description |
---|
BasicK8sWorker() |
Modifier and Type | Method and Description |
---|---|
void |
driverMessageReceived(Any anyMessage)
received a broadcast message from the driver
|
static void |
echoServer(JobMasterAPI.WorkerInfo workerInfo)
an echo server.
|
void |
execute(Config config,
JobAPI.Job job,
IWorkerController workerController,
IPersistentVolume persistentVolume,
IVolatileVolume volatileVolume)
Execute with the resources configured
|
void |
listHdfsDir()
a method to test hdfs access from workers
|
void |
printWorkersPerNode(java.util.Map<java.lang.String,java.util.List<JobMasterAPI.WorkerInfo>> workersPerNode) |
void |
sleepRandomTime(long maxTimeMS)
a test method to make the worker wait some time
|
static void |
sleepSomeTime(java.lang.String id,
long sleepSeconds)
a test method to make the worker wait some time
|
void |
workersScaledDown(int instancesRemoved)
called when new instances of workers are removed from the job
|
void |
workersScaledUp(int instancesAdded)
called when new instances of workers are added the job
|
public void execute(Config config, JobAPI.Job job, IWorkerController workerController, IPersistentVolume persistentVolume, IVolatileVolume volatileVolume)
IWorker
public void workersScaledUp(int instancesAdded)
IScalerListener
workersScaledUp
in interface IScalerListener
public void workersScaledDown(int instancesRemoved)
IScalerListener
workersScaledDown
in interface IScalerListener
public void driverMessageReceived(Any anyMessage)
IReceiverFromDriver
driverMessageReceived
in interface IReceiverFromDriver
anyMessage
- received message from the driverpublic static void echoServer(JobMasterAPI.WorkerInfo workerInfo)
public static void sleepSomeTime(java.lang.String id, long sleepSeconds)
public void sleepRandomTime(long maxTimeMS)
public void printWorkersPerNode(java.util.Map<java.lang.String,java.util.List<JobMasterAPI.WorkerInfo>> workersPerNode)
public void listHdfsDir()