public class Workers extends Nodes
Modifier and Type | Class and Description |
---|---|
class |
Workers.WorkerInfoIterator
The iterator class of WorkerInfo.
|
class |
Workers.WorkerInfoList
The iterable list of WorkerInfo.
|
Constructor and Description |
---|
Workers() |
Workers(java.io.BufferedReader reader,
int selfid)
Initialization the workers.
|
Workers(int selfID) |
Modifier and Type | Method and Description |
---|---|
int |
getMasterID()
Get the ID of the master
|
WorkerInfo |
getMasterInfo()
Get the WorkerInfo of the master
|
int |
getMaxID()
Get the maximum ID among all the workers
|
int |
getMiddleID()
Get the middle ID among all the workers
|
int |
getMinID()
Get the minimum ID among all the workers
|
int |
getNextID()
Get the next ID of this worker
|
WorkerInfo |
getNextInfo()
Get the WorkerInfo of the next worker
|
int |
getNumWorkers()
Get the number of the workers
|
int |
getSelfID()
Get the ID of this worker
|
WorkerInfo |
getSelfInfo()
Get the WorkerInfo of this worker
|
WorkerInfo |
getWorkerInfo(int workerID)
Get the WorkerInfo of the worker
|
Workers.WorkerInfoList |
getWorkerInfoList()
Get the iterable class of the WorkerInfos
|
boolean |
isMaster()
Check if this is the master or not
|
boolean |
isMax()
Check if the ID of this worker is the maximum
among all the workers
|
boolean |
isSelfInWorker()
Check if this worker is in the Workers
|
boolean |
isTheOnlyWorker()
Check if this is the only worker or not
|
getNodeList, getNodes, getNumPhysicalNodes, getRackList, printToNodesFile, sortRacks
public Workers() throws java.lang.Exception
java.lang.Exception
public Workers(int selfID) throws java.lang.Exception
java.lang.Exception
public Workers(java.io.BufferedReader reader, int selfid) throws java.lang.Exception
reader
- the BufferedReaderselfid
- this worker's idjava.lang.Exception
public int getNumWorkers()
public boolean isTheOnlyWorker()
public int getMasterID()
public boolean isMaster()
public WorkerInfo getMasterInfo()
public int getSelfID()
public boolean isSelfInWorker()
public WorkerInfo getSelfInfo()
public boolean isMax()
public int getMinID()
public int getMiddleID()
public int getMaxID()
public int getNextID()
public WorkerInfo getNextInfo()
public WorkerInfo getWorkerInfo(int workerID)
workerID
- the workerpublic Workers.WorkerInfoList getWorkerInfoList()