public abstract class AbstractStreamingEvaluationModule extends AbstractPlatformConnectorComponent implements PairedStreamHandler
| Modifier and Type | Field and Description |
|---|---|
protected RabbitQueue |
evalModule2EvalStoreQueue
Queue to the evaluation storage.
|
protected String |
experimentUri
The URI of the experiment.
|
protected boolean |
iterationFinished |
protected byte |
iteratorId |
private static org.slf4j.Logger |
LOGGER |
protected DataReceiverImpl |
receiver |
protected Semaphore |
requestNextResultPair |
cmdChannel, cmdQueueFactory, cmdResponseTimeout, DEFAULT_CMD_RESPONSE_TIMEOUT, defaultContainerTypeconnectionFactory, incomingDataQueueFactory, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, outgoingDataQueuefactory, rabbitMQHostName, START_WAITING_TIME_BEFORE_RETRY| Constructor and Description |
|---|
AbstractStreamingEvaluationModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
collectResponses()
This method communicates with the evaluation storage to collect all response
pairs.
|
protected org.apache.jena.rdf.model.Model |
createDefaultModel() |
protected abstract void |
evaluateResponse(InputStream expectedData,
InputStream receivedData,
long taskSentTimestamp,
long responseReceivedTimestamp)
Evaluates the given response pair.
|
void |
handleIncomingStream(String streamId,
InputStream stream)
Method handling the given InputStream.
|
void |
handleIncomingStreams(String streamId,
InputStream[] streams) |
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.
|
private void |
sendResultModel(org.apache.jena.rdf.model.Model model)
Sends the model to the benchmark controller.
|
protected abstract org.apache.jena.rdf.model.Model |
summarizeEvaluation()
Summarizes the evaluation and generates an RDF model containing the
evaluation results.
|
addContainerObserver, createContainer, getFactoryForIncomingCmdQueues, getFactoryForIncomingDataQueues, getFactoryForOutgoingCmdQueues, getFactoryForOutgoingDataQueues, stopContaineraddCommandHeaderId, createContainer, createContainer, getCmdResponseTimeout, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueue, setCmdResponseTimeoutcreateConnection, generateSessionQueueName, getHobbitSessionIdprivate static final org.slf4j.Logger LOGGER
protected RabbitQueue evalModule2EvalStoreQueue
protected String experimentUri
protected DataReceiverImpl receiver
protected byte iteratorId
protected Semaphore requestNextResultPair
protected boolean iterationFinished
public void init()
throws Exception
Componentinit in interface Componentinit in class AbstractCommandReceivingComponentException - if an error occurs during the initializationpublic void run()
throws Exception
Componentprotected void collectResponses()
throws Exception
#evaluateResponse(byte[], byte[], long, long) method is called.Exception - if a communication error occurs.public void handleIncomingStreams(String streamId, InputStream[] streams)
handleIncomingStreams in interface PairedStreamHandlerprotected abstract void evaluateResponse(InputStream expectedData, InputStream receivedData, long taskSentTimestamp, long responseReceivedTimestamp) throws Exception
expectedData - the data that has been expectedreceivedData - the data that has been received from the systemtaskSentTimestamp - the time at which the task has been sent to the systemresponseReceivedTimestamp - the time at which the response has been received from the systemException - if an error occurs during the evaluationprotected abstract org.apache.jena.rdf.model.Model summarizeEvaluation()
throws Exception
Exception - if a sever error occursprivate void sendResultModel(org.apache.jena.rdf.model.Model model)
throws IOException
model - the model that should be sentIOException - if an error occurs during the commmunicationpublic 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 commandpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractCommandReceivingComponentIOExceptionprotected org.apache.jena.rdf.model.Model createDefaultModel()
public void handleIncomingStream(String streamId, InputStream stream)
IncomingStreamHandlerhandleIncomingStream in interface IncomingStreamHandlerstreamId - the id of the streamstream - the input stream containing the incoming dataCopyright © 2017–2018. All rights reserved.