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 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 |
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.
|
protected List<Iterator<ResultPair>> |
resultPairIterators
Iterators that have been started.
|
protected RabbitQueue |
system2EvalStoreQueue
The incoming queue from the system.
|
protected RabbitQueue |
taskGen2EvalStoreQueue
The incoming queue from the task generator.
|
private Semaphore |
terminationMutex
Mutex used to wait for the termination signal.
|
cmdChannel, cmdConnection, defaultContainerTypeconnectionFactory, dataConnection, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, rabbitMQHostName, START_WAITING_TIME_BEFORE_RETRY| Constructor and Description |
|---|
AbstractEvaluationStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract Iterator<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, createDefaultRabbitQueue, stopContaineraddCommandHeaderId, createContainer, createContainer, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuegenerateSessionQueueName, getHobbitSessionIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreceiveResponseDatareceiveExpectedResponseDataprivate static final org.slf4j.Logger LOGGER
public static final byte NEW_ITERATOR_ID
private static final byte[] EMPTY_RESPONSE
private Semaphore terminationMutex
protected List<Iterator<ResultPair>> resultPairIterators
protected RabbitQueue taskGen2EvalStoreQueue
protected RabbitQueue system2EvalStoreQueue
protected RabbitQueue evalModule2EvalStoreQueue
protected com.rabbitmq.client.Channel ackChannel
public void init()
throws Exception
Componentinit in interface Componentinit in class AbstractCommandReceivingComponentException - if an error occurs during the initializationprotected abstract Iterator<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. All rights reserved.