public abstract class AbstractDataGenerator extends AbstractPlatformConnectorComponent
| Modifier and Type | Field and Description |
|---|---|
protected int |
generatorId
The ID of this generator.
|
protected int |
numberOfGenerators
The number of data generators that might be running in parallel.
|
protected DataSender |
sender2System
Sender for transferring data to the benchmarked system.
|
protected DataSender |
sender2TaskGen
Sender for transferring data to the task generators.
|
private Semaphore |
startDataGenMutex
Semaphore used to wait for the start signal of the benchmark controller.
|
cmdChannel, cmdQueueFactory, DEFAULT_CMD_RESPONSE_TIMEOUT, defaultContainerTypeconnectionFactory, incomingDataQueueFactory, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, outgoingDataQueuefactory, rabbitMQHostName, START_WAITING_TIME_BEFORE_RETRY| Constructor and Description |
|---|
AbstractDataGenerator() |
AbstractDataGenerator(DataSender sender2TaskGen,
DataSender sender2System) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract void |
generateData() |
int |
getGeneratorId() |
int |
getNumberOfGenerators() |
void |
init()
This method initializes the component.
|
void |
receiveCommand(byte command,
byte[] data)
This method is called if a command is received and might be interesting
for this particular component.
|
void |
run()
This method executes the component.
|
protected void |
sendDataToSystemAdapter(byte[] data) |
protected void |
sendDataToSystemAdapter(InputStream stream) |
protected void |
sendDataToTaskGenerator(byte[] data) |
protected void |
sendDataToTaskGenerator(InputStream stream) |
addContainerObserver, createContainer, getFactoryForIncomingCmdQueues, getFactoryForIncomingDataQueues, getFactoryForOutgoingCmdQueues, getFactoryForOutgoingDataQueues, stopContaineraddCommandHeaderId, createContainer, createContainer, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuecreateConnection, generateSessionQueueName, getHobbitSessionIdprivate Semaphore startDataGenMutex
protected int generatorId
protected int numberOfGenerators
protected DataSender sender2TaskGen
protected DataSender sender2System
public AbstractDataGenerator()
public AbstractDataGenerator(DataSender sender2TaskGen, DataSender sender2System)
public void init()
throws Exception
Componentinit in interface Componentinit in class AbstractCommandReceivingComponentException - if an error occurs during the initializationpublic void run()
throws Exception
ComponentException - if an error occurs during the executionpublic void receiveCommand(byte command,
byte[] data)
CommandReceivingComponentreceiveCommand in interface CommandReceivingComponentreceiveCommand in class AbstractPlatformConnectorComponentcommand - the byte encoding the commanddata - additional data that was sent together with the commandprotected void sendDataToTaskGenerator(byte[] data)
throws IOException
IOExceptionprotected void sendDataToTaskGenerator(InputStream stream) throws IOException
IOExceptionprotected void sendDataToSystemAdapter(byte[] data)
throws IOException
IOExceptionprotected void sendDataToSystemAdapter(InputStream stream) throws IOException
IOExceptionpublic int getGeneratorId()
public int getNumberOfGenerators()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractCommandReceivingComponentIOExceptionCopyright © 2017–2018. All rights reserved.