public final class JobMasterClientExample
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.Integer> |
generateAdditionalPorts(Config config,
int workerPort)
generate the additional requested ports for this worker
|
static java.util.List<java.lang.Integer> |
getIDs(java.util.List<JobMasterAPI.WorkerInfo> workerList) |
static void |
main(java.lang.String[] args)
a test class to run JMWorkerAgent
First, a JobMaster instance should be started on a machine
This client should connect to that server
|
static void |
simulateClient(Config config,
JobAPI.Job job,
int workerID)
a method to simulate JMWorkerAgent running in workers
|
static void |
sleeeep(long duration) |
static void |
throwException(int workerID) |
static Config |
updateConfig(Config config1,
Config config2,
java.lang.String jmAddress)
construct a Config object
|
public static void main(java.lang.String[] args)
It reads config files from conf/kubernetes directory It uses the first ComputeResource in that config file as the ComputeResource of this worker Number of workers is the number of workers in the first ComputeResource
When all workers joined, they get the full worker list Then, each worker sends a barrier message Then, each worker sends a completed message and closes
public static void simulateClient(Config config, JobAPI.Job job, int workerID)
public static void throwException(int workerID)
public static java.util.List<java.lang.Integer> getIDs(java.util.List<JobMasterAPI.WorkerInfo> workerList)
public static Config updateConfig(Config config1, Config config2, java.lang.String jmAddress)
public static java.util.Map<java.lang.String,java.lang.Integer> generateAdditionalPorts(Config config, int workerPort)
public static void sleeeep(long duration)