public abstract class AbstractEvaluationStorage extends AbstractPlatformConnectorComponent implements ResponseReceivingComponent, ExpectedResponseReceivingComponent
| Modifier and Type | Field and Description |
|---|---|
protected com.rabbitmq.client.Channel |
ackChannel
Channel on which the acknowledgements are send.
|
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.
|
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 |
protected List<Iterator<? extends ResultPair>> |
resultPairIterators
Iterators that have been started.
|
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 |
|---|---|
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 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
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
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 commandpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractCommandReceivingComponentIOExceptionCopyright © 2017–2018. All rights reserved.