| Constructor and Description |
|---|
MessageFetcher() |
| Modifier and Type | Method and Description |
|---|---|
abstract co.cask.cdap.api.dataset.lib.CloseableIterator<RawMessage> |
fetch()
Returns a
CloseableIterator that iterates over messages fetched from the messaging system. |
protected int |
getLimit() |
protected byte[] |
getStartOffset() |
protected Long |
getStartTime() |
protected org.apache.tephra.Transaction |
getTransaction() |
protected boolean |
isIncludeStart() |
MessageFetcher |
setLimit(int limit)
Sets the maximum limit on number of messages to be fetched.
|
MessageFetcher |
setStartMessage(byte[] startOffset,
boolean inclusive)
Setup the message fetching starting point based on the given message id.
|
MessageFetcher |
setStartTime(long startTime)
Setup the message fetching start time (publish time).
|
MessageFetcher |
setTransaction(org.apache.tephra.Transaction transaction)
Sets the transaction to use for fetching.
|
public MessageFetcher setStartMessage(byte[] startOffset, boolean inclusive)
setStartTime(long) method.startOffset - the message id to start fetching from.inclusive - if true, it will include the message identified by the given message id as the
first message (if still available in the system); otherwise it won't be included.public MessageFetcher setStartTime(long startTime)
setStartMessage(byte[], boolean) method.startTime - timestamp in millisecondspublic MessageFetcher setTransaction(org.apache.tephra.Transaction transaction)
transaction - the transaction to use for reading messagespublic MessageFetcher setLimit(int limit)
Integer.MAX_VALUE.limit - maximum number of messages to be fetched@Nullable protected byte[] getStartOffset()
protected boolean isIncludeStart()
@Nullable protected org.apache.tephra.Transaction getTransaction()
protected int getLimit()
public abstract co.cask.cdap.api.dataset.lib.CloseableIterator<RawMessage> fetch() throws co.cask.cdap.api.messaging.TopicNotFoundException, IOException
CloseableIterator that iterates over messages fetched from the messaging system.co.cask.cdap.api.messaging.TopicNotFoundException - if the topic does not existIOException - if it fails to create the iteratorCopyright © 2017 Cask Data, Inc. Licensed under the Apache License, Version 2.0.