|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.sun.faban.driver.engine.MasterImpl
public class MasterImpl
This is the main Master class for running a Faban driver. The Master is instantiated on the master machine by the user wishing to run a benchmark. It is responsible for co-ordinating the work of all the Agents, setting up the benchmark test, collecting the results etc. NOTE: The registry and agents must have been brought up before starting the driver. The driver will fail otherwise.
Agent,
Registry,
Serialized Form| Field Summary | |
|---|---|
protected Agent[][] |
agentRefs
Remote references for each agentImpl of each driver type. |
protected int[] |
agentThreads
Threads required per agentImpl for each driver. |
protected static String |
fs
Convenience accessor to the file separator. |
protected int[] |
remainderThreads
Remaining threads to be distributed to the first agents. |
protected RunInfo |
runInfo
The RunInfo structure. |
protected Timer |
scheduler
The scheduler used in the master. |
protected MasterState |
state
The current state of the master. |
protected Object |
stateLock
The lock object for the state. |
protected Timer |
timer
The time recorder. |
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Constructor Summary | |
|---|---|
protected |
MasterImpl()
Creates and exports a new Master. |
| Method Summary | |
|---|---|
void |
abortRun()
Notifies the master to terminate the run immediately. |
protected void |
changeState(MasterState newState)
Introduces a state change in the master. |
protected int |
configure()
Contacts the registry and gets references for all agents. |
protected void |
configureLocal()
Configures a local, in-process agent. |
long |
currentTimeMillis()
Obtain the master's time for time adjustment. |
void |
generateReports(List<Map<String,Metrics>> results)
Generates the summary and detail report. |
MasterState |
getCurrentState()
Obtains the current state of the master. |
String |
getRunID(boolean increment)
This method retrieves the ID for the current run, by looking in the specappplatform.seq file in the user's home directory. |
static void |
main(String[] args)
The main method to start the master. |
void |
runBenchmark()
Runs the benchmark from begin to end. |
void |
setStartTime(int relTime)
Sets the benchmark start time after all threads are started. |
void |
updateMetrics(RuntimeMetrics m)
Updates the master with the latest runtime metrics so the master can dump out the stats accordingly. |
void |
waitForState(MasterState state)
Wait for a certain state on the master. |
void |
waitForThreadStart()
Waits for all threads in all agents to start. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|---|
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
|---|
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
|---|
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Agent[][] agentRefs
protected int[] agentThreads
protected int[] remainderThreads
protected RunInfo runInfo
protected Timer timer
protected static String fs
protected final Object stateLock
protected MasterState state
protected Timer scheduler
| Constructor Detail |
|---|
protected MasterImpl()
throws RemoteException
RemoteException - if failed to export object| Method Detail |
|---|
public void runBenchmark()
throws Exception
Exception - Any error that had occurred during the run.
public String getRunID(boolean increment)
throws IOException
increment - Whether the file shall be incremented or not
IOException
protected int configure()
throws Exception
Exception - Any error that could happen configuring the master
protected void configureLocal()
throws Exception
Exception - If anything goes wrong during the configuration
public void generateReports(List<Map<String,Metrics>> results)
throws IOException
results - List of Host-Metrics maps, one per driver type
IOExceptionpublic void updateMetrics(RuntimeMetrics m)
Master
updateMetrics in interface Masterm - The runtime metrics to updatepublic long currentTimeMillis()
currentTimeMillis in interface Masterprotected void changeState(MasterState newState)
newState - The new statepublic MasterState getCurrentState()
getCurrentState in interface Masterpublic void waitForState(MasterState state)
waitForState in interface Masterstate - The state to wait forpublic void waitForThreadStart()
public void setStartTime(int relTime)
relTime - The ms time from the run epochpublic void abortRun()
abortRun in interface Masterpublic static void main(String[] args)
args - The command line arguments are ignored.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||