public class InMemoryQueueConsumer extends Object implements QueueConsumer, co.cask.tephra.TransactionAware
| Constructor and Description |
|---|
InMemoryQueueConsumer(QueueName queueName,
ConsumerConfig config,
int numGroups,
InMemoryQueueService queueService) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
commitTx() |
DequeueResult |
dequeue()
Dequeue an entry from the queue.
|
DequeueResult |
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) |
public InMemoryQueueConsumer(QueueName queueName, ConsumerConfig config, int numGroups, InMemoryQueueService queueService)
public String getTransactionAwareName()
getTransactionAwareName in interface co.cask.tephra.TransactionAwarepublic QueueName getQueueName()
QueueConsumergetQueueName in interface QueueConsumerpublic ConsumerConfig getConfig()
QueueConsumergetConfig in interface QueueConsumerpublic DequeueResult dequeue() throws IOException
QueueConsumerdequeue in interface QueueConsumerDequeueResult.IOExceptionpublic DequeueResult 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.TransactionAwarepublic boolean rollbackTx()
throws Exception
rollbackTx in interface co.cask.tephra.TransactionAwareExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.