public abstract class AbstractEvaluationStorage extends AbstractPlatformConnectorComponent implements ResponseReceivingComponent, ExpectedResponseReceivingComponent
timestamp length id datatimestamp is a long value (only expected if the message
is received from a task generator)length is an int value containing the length of the
following id stringid is a string with the given lengthdata is the remaining bytes that are received| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractEvaluationStorage.ExpectedResponseReceiver
Receiver handling the expected responses.
|
protected class |
AbstractEvaluationStorage.IterationRequestReceiver |
protected class |
AbstractEvaluationStorage.SystemResponseReceiver
Receiver handling the responses coming from the system.
|
| Modifier and Type | Field and Description |
|---|---|
protected com.rabbitmq.client.Channel |
ackChannel
Channel on which the acknowledgements are send.
|
protected String |
ackExchangeName |
private static int |
DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES
Default value of the
maxParallelProcessedMsgs attribute. |
private static byte[] |
EMPTY_RESPONSE
The empty response that is sent if an error occurs.
|
protected RabbitQueue |
evalModule2EvalStoreQueue
The incoming queue from the evaluation module.
|
static int |
EXPECTED_RESPONSE_STREAM_ID |
protected DataReceiverImpl |
expResponseReceiver
The incoming queue from the task generator.
|
static int |
ITERATOR_ID_STREAM_ID |
private static org.slf4j.Logger |
LOGGER |
private int |
maxParallelProcessedMsgs
The maximum number of incoming messages of a single queue that are processed
in parallel.
|
static byte |
NEW_ITERATOR_ID
If a request contains this iterator ID, a new iterator is created and its
first result as well as its Id are returned.
|
static String |
RECEIVE_TIMESTAMP_FOR_SYSTEM_RESULTS_KEY |
static int |
RECEIVED_RESPONSE_STREAM_ID |
protected boolean |
receiveTimeStamp |
protected Map<String,PairedDataSender> |
replyingSenders |
protected List<Iterator<? extends ResultPair>> |
resultPairIterators
Iterators that have been started.
|
protected DataReceiverImpl |
systemResponseReceiver
The incoming queue from the system.
|
protected DataReceiver |
systemResultReceiver
The incoming queue from the system.
|
protected DataReceiver |
taskResultReceiver
The incoming queue from the task generator.
|
private Semaphore |
terminationMutex
Mutex used to wait for the termination signal.
|
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 |
|---|
AbstractEvaluationStorage()
Constructor using the
DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES=
50. |
AbstractEvaluationStorage(int maxParallelProcessedMsgs)
Constructor setting the maximum number of messages processed in parallel.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
acknowledgeResponse(String taskId) |
void |
close() |
protected abstract Iterator<? extends ResultPair> |
createIterator()
Creates a new iterator that iterates over the response pairs.
|
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.
|
addContainerObserver, createContainer, getFactoryForIncomingCmdQueues, getFactoryForIncomingDataQueues, getFactoryForOutgoingCmdQueues, getFactoryForOutgoingDataQueues, stopContaineraddCommandHeaderId, createContainer, createContainer, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuecreateConnection, generateSessionQueueName, getHobbitSessionIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreceiveResponseDatareceiveExpectedResponseDataprivate static final org.slf4j.Logger LOGGER
public static final int ITERATOR_ID_STREAM_ID
public static final int EXPECTED_RESPONSE_STREAM_ID
public static final int RECEIVED_RESPONSE_STREAM_ID
public static final String RECEIVE_TIMESTAMP_FOR_SYSTEM_RESULTS_KEY
public static final byte NEW_ITERATOR_ID
private static final byte[] EMPTY_RESPONSE
private static final int DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES
maxParallelProcessedMsgs attribute.private Semaphore terminationMutex
protected DataReceiverImpl expResponseReceiver
protected DataReceiverImpl systemResponseReceiver
private final int maxParallelProcessedMsgs
protected List<Iterator<? extends ResultPair>> resultPairIterators
protected DataReceiver taskResultReceiver
protected DataReceiver systemResultReceiver
protected RabbitQueue evalModule2EvalStoreQueue
protected com.rabbitmq.client.Channel ackChannel
protected String ackExchangeName
protected Map<String,PairedDataSender> replyingSenders
protected boolean receiveTimeStamp
public AbstractEvaluationStorage()
DEFAULT_MAX_PARALLEL_PROCESSED_MESSAGES=
50.public AbstractEvaluationStorage(int maxParallelProcessedMsgs)
maxParallelProcessedMsgs - The maximum number of incoming messages of a single queue that are
processed in parallel. Additional messages have to wait.public void init()
throws Exception
Componentinit in interface Componentinit in class AbstractCommandReceivingComponentException - if an error occurs during the initializationprotected abstract Iterator<? extends ResultPair> createIterator()
public void run()
throws Exception
Componentpublic 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 acknowledgeResponse(String taskId)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractCommandReceivingComponentIOExceptionCopyright © 2017–2018. All rights reserved.