public class MasterImpl extends UnicastRemoteObject implements Master
Agent
,
Registry
,
Serialized FormModifier and Type | Field and Description |
---|---|
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.
|
ref
Modifier | Constructor and Description |
---|---|
protected |
MasterImpl()
Creates and exports a new Master.
|
Modifier and Type | Method and Description |
---|---|
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.
|
clone, exportObject, exportObject, exportObject, unexportObject
getClientHost, getLog, setLog
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
protected MasterImpl() throws RemoteException
RemoteException
- if failed to export objectpublic 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 notIOException
- Problem acecessing or creating the run id fileprotected int configure() throws Exception
Exception
- Any error that could happen configuring the masterprotected void configureLocal() throws Exception
Exception
- If anything goes wrong during the configurationpublic void generateReports(List<Map<String,Metrics>> results) throws IOException
results
- List of Host-Metrics maps, one per driver typeIOException
public void updateMetrics(RuntimeMetrics m)
Master
updateMetrics
in interface Master
m
- The runtime metrics to updatepublic long currentTimeMillis()
currentTimeMillis
in interface Master
protected void changeState(MasterState newState)
newState
- The new statepublic MasterState getCurrentState()
getCurrentState
in interface Master
public void waitForState(MasterState state)
waitForState
in interface Master
state
- The state to wait forpublic void waitForThreadStart()
public void setStartTime(int relTime)
relTime
- The ms time from the run epochpublic void abortRun()
public static void main(String[] args)
args
- The command line arguments are ignored.