public abstract class ForwardingStreamConsumer extends Object implements StreamConsumer
StreamConsumer that forwards every methods to another StreamConsumer.| Modifier | Constructor and Description |
|---|---|
protected |
ForwardingStreamConsumer(StreamConsumer delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
commitTx() |
ConsumerConfig |
getConsumerConfig() |
Id.Stream |
getStreamId() |
String |
getTransactionAwareName() |
Collection<byte[]> |
getTxChanges() |
DequeueResult<co.cask.cdap.api.flow.flowlet.StreamEvent> |
poll(int maxEvents,
long timeout,
TimeUnit timeoutUnit)
Retrieves up to
maxEvents of StreamEvent from the stream. |
void |
postTxCommit() |
boolean |
rollbackTx() |
void |
startTx(co.cask.tephra.Transaction tx) |
void |
updateTx(co.cask.tephra.Transaction tx) |
protected ForwardingStreamConsumer(StreamConsumer delegate)
public Id.Stream getStreamId()
getStreamId in interface StreamConsumerpublic ConsumerConfig getConsumerConfig()
getConsumerConfig in interface StreamConsumerpublic DequeueResult<co.cask.cdap.api.flow.flowlet.StreamEvent> poll(int maxEvents, long timeout, TimeUnit timeoutUnit) throws IOException, InterruptedException
StreamConsumermaxEvents of StreamEvent from the stream.poll in interface StreamConsumermaxEvents - Maximum number of events to retrievetimeout - Maximum of time to spend on trying to read up to maxEventstimeoutUnit - Unit for the timeoutDequeueResult which carries StreamEvents inside.IOException - If there is error while reading eventsInterruptedException - If interrupted while waitingpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void startTx(co.cask.tephra.Transaction tx)
startTx in interface co.cask.tephra.TransactionAwarepublic void updateTx(co.cask.tephra.Transaction tx)
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 String getTransactionAwareName()
getTransactionAwareName in interface co.cask.tephra.TransactionAwareCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.