Class AbstractEvaluationModule

All Implemented Interfaces:
Closeable, AutoCloseable, CommandReceivingComponent, Component, PlatformConnector

public abstract class AbstractEvaluationModule extends AbstractPlatformConnectorComponent
This abstract class implements basic functions that can be used to implement a task generator.
Author:
Michael Röder (roeder@informatik.uni-leipzig.de)
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • consumer

      protected QueueingConsumer consumer
      Consumer used to receive the responses from the evaluation storage.
    • evalModule2EvalStoreQueue

      protected RabbitQueue evalModule2EvalStoreQueue
      Queue to the evaluation storage.
    • evalStore2EvalModuleQueue

      protected RabbitQueue evalStore2EvalModuleQueue
      Incoming queue from the evaluation storage.
    • experimentUri

      protected String experimentUri
      The URI of the experiment.
    • QUEUEPOLLTIMEOUT

      private static final int QUEUEPOLLTIMEOUT
      Timeout parameter for delivery queue message poll.
      See Also:
  • Constructor Details

    • AbstractEvaluationModule

      public AbstractEvaluationModule()
  • Method Details

    • init

      public void init() throws Exception
      Description copied from interface: Component
      This method initializes the component.
      Specified by:
      init in interface Component
      Overrides:
      init in class AbstractCommandReceivingComponent
      Throws:
      Exception - if an error occurs during the initialization
    • run

      public void run() throws Exception
      Description copied from interface: Component
      This method executes the component.
      Throws:
      Exception - if an error occurs during the execution
    • collectResponses

      protected void collectResponses() throws Exception
      This method communicates with the evaluation storage to collect all response pairs. For every pair the evaluateResponse(byte[], byte[], long, long) method is called.
      Throws:
      Exception - if a communication error occurs.
    • evaluateResponse

      protected abstract void evaluateResponse(byte[] expectedData, byte[] receivedData, long taskSentTimestamp, long responseReceivedTimestamp) throws Exception
      Evaluates the given response pair.
      Parameters:
      expectedData - the data that has been expected
      receivedData - the data that has been received from the system
      taskSentTimestamp - the time at which the task has been sent to the system
      responseReceivedTimestamp - the time at which the response has been received from the system
      Throws:
      Exception - if an error occurs during the evaluation
    • summarizeEvaluation

      protected abstract org.apache.jena.rdf.model.Model summarizeEvaluation() throws Exception
      Summarizes the evaluation and generates an RDF model containing the evaluation results.
      Returns:
      an RDF model containing the evaluation results
      Throws:
      Exception - if a sever error occurs
    • sendResultModel

      private void sendResultModel(org.apache.jena.rdf.model.Model model) throws IOException
      Sends the model to the benchmark controller.
      Parameters:
      model - the model that should be sent
      Throws:
      IOException - if an error occurs during the commmunication
    • receiveCommand

      public void receiveCommand(byte command, byte[] data)
      Description copied from interface: CommandReceivingComponent
      This method is called if a command is received and might be interesting for this particular component.
      Specified by:
      receiveCommand in interface CommandReceivingComponent
      Overrides:
      receiveCommand in class AbstractPlatformConnectorComponent
      Parameters:
      command - the byte encoding the command
      data - additional data that was sent together with the command
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class AbstractCommandReceivingComponent
      Throws:
      IOException
    • createDefaultModel

      protected org.apache.jena.rdf.model.Model createDefaultModel()