public abstract class ForwardingQueueConsumer extends Object implements QueueConsumer, co.cask.tephra.TransactionAware
TransactionAware QueueConsumer that forwards all queue operations to another
QueueConsumer and optionally forward transaction operations if the target QueueConsumer
is also TransactionAware.| Modifier and Type | Field and Description |
|---|---|
protected QueueConsumer |
consumer |
protected co.cask.tephra.TransactionAware |
txAware |
| Constructor and Description |
|---|
ForwardingQueueConsumer(QueueConsumer consumer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
commitTx() |
DequeueResult<byte[]> |
dequeue()
Dequeue an entry from the queue.
|
DequeueResult<byte[]> |
dequeue(int maxBatchSize)
Dequeue multiple entries from the queue.
|
ConsumerConfig |
getConfig()
Returns the configuration of this consumer.
|
QueueName |
getQueueName()
Returns the queue name that this consumer is working on.
|
String |
getTransactionAwareName() |
Collection<byte[]> |
getTxChanges() |
void |
postTxCommit() |
boolean |
rollbackTx() |
void |
startTx(co.cask.tephra.Transaction tx) |
void |
updateTx(co.cask.tephra.Transaction transaction) |
protected final QueueConsumer consumer
protected final co.cask.tephra.TransactionAware txAware
public ForwardingQueueConsumer(QueueConsumer consumer)
public String getTransactionAwareName()
getTransactionAwareName in interface co.cask.tephra.TransactionAwarepublic QueueName getQueueName()
QueueConsumergetQueueName in interface QueueConsumerpublic ConsumerConfig getConfig()
QueueConsumergetConfig in interface QueueConsumerpublic DequeueResult<byte[]> dequeue() throws IOException
QueueConsumerdequeue in interface QueueConsumerDequeueResult.IOExceptionpublic DequeueResult<byte[]> dequeue(int maxBatchSize) throws IOException
QueueConsumerdequeue in interface QueueConsumermaxBatchSize - Maximum number of entries to queue.DequeueResult.IOExceptionpublic void startTx(co.cask.tephra.Transaction tx)
startTx in interface co.cask.tephra.TransactionAwarepublic void updateTx(co.cask.tephra.Transaction transaction)
updateTx in interface co.cask.tephra.TransactionAwarepublic Collection<byte[]> getTxChanges()
getTxChanges in interface co.cask.tephra.TransactionAwarepublic boolean commitTx()
throws Exception
commitTx in interface co.cask.tephra.TransactionAwareExceptionpublic void postTxCommit()
postTxCommit in interface co.cask.tephra.TransactionAwareCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.