public abstract class AbstractMessageTable extends Object implements MessageTable
MessageTable.MessageTable.Entry| Constructor and Description |
|---|
AbstractMessageTable() |
| Modifier and Type | Method and Description |
|---|---|
co.cask.cdap.api.dataset.lib.CloseableIterator<MessageTable.Entry> |
fetch(TopicMetadata metadata,
long startTime,
int limit,
org.apache.tephra.Transaction transaction)
Fetches message table entries in the given topic that were publish on or after the given start time.
|
co.cask.cdap.api.dataset.lib.CloseableIterator<MessageTable.Entry> |
fetch(TopicMetadata metadata,
MessageId messageId,
boolean inclusive,
int limit,
org.apache.tephra.Transaction transaction)
Fetches message table entries in the given topic, starting from the given
MessageId. |
protected abstract void |
persist(Iterator<RawMessageTableEntry> entries)
Store the
RawMessageTableEntrys persistently. |
protected abstract co.cask.cdap.api.dataset.lib.CloseableIterator<RawMessageTableEntry> |
read(byte[] startRow,
byte[] stopRow)
Read the
RawMessageTableEntrys given a key range. |
protected abstract void |
rollback(byte[] startKey,
byte[] stopKey,
byte[] txWritePointer)
Rollback the transactionally published messages in the Table in the given key range.
|
void |
rollback(TopicMetadata metadata,
RollbackDetail rollbackDetail)
Rollback entries stored earlier, as deleted, under the given topic based on the given information.
|
void |
store(Iterator<? extends MessageTable.Entry> entries)
Stores a list of entries to the message table under the given topic.
|
protected abstract void persist(Iterator<RawMessageTableEntry> entries) throws IOException
RawMessageTableEntrys persistently.entries - Iterator of RawMessageTableEntrysIOException - thrown if there was an error while storing the entriesprotected abstract void rollback(byte[] startKey,
byte[] stopKey,
byte[] txWritePointer)
throws IOException
startKey - start row to delete (inclusive)stopKey - stop row to delete (exclusive)txWritePointer - transaction write pointer for messages that are being roll backedIOException - thrown if there was an error while trying to delete the entriesprotected abstract co.cask.cdap.api.dataset.lib.CloseableIterator<RawMessageTableEntry> read(byte[] startRow, byte[] stopRow) throws IOException
RawMessageTableEntrys given a key range.startRow - start row prefixstopRow - stop row prefixCloseableIterator of RawMessageTableEntrysIOException - throw if there was an error while trying to read the entries from the tablepublic co.cask.cdap.api.dataset.lib.CloseableIterator<MessageTable.Entry> fetch(TopicMetadata metadata, long startTime, int limit, @Nullable org.apache.tephra.Transaction transaction) throws IOException
MessageTablefetch in interface MessageTablemetadata - metadata of the topic to fetch fromstartTime - the publish time to start fromlimit - maximum number of messages to fetchtransaction - an optional Transaction to use for fetchingCloseableIterator of MessageTable.Entry.IOExceptionpublic co.cask.cdap.api.dataset.lib.CloseableIterator<MessageTable.Entry> fetch(TopicMetadata metadata, MessageId messageId, boolean inclusive, int limit, @Nullable org.apache.tephra.Transaction transaction) throws IOException
MessageTableMessageId.fetch in interface MessageTablemetadata - TopicMetadata of the the topic to fetch frommessageId - the message id to start fetching frominclusive - indicate whether to include the given MessageId as the first message (if still available)
or not.limit - maximum number of messages to fetchtransaction - an optional Transaction to use for fetchingCloseableIterator of MessageTable.Entry.IOExceptionpublic void store(Iterator<? extends MessageTable.Entry> entries) throws IOException
MessageTablestore in interface MessageTableentries - a list of entries to store. This method guarantees each MessageTable.Entry will be consumed right away,
hence it is safe for the Iterator to reuse the same MessageTable.Entry instance.IOExceptionpublic void rollback(TopicMetadata metadata, RollbackDetail rollbackDetail) throws IOException
MessageTablerollback in interface MessageTablemetadata - TopicMetadata of the topic to rollback fromrollbackDetail - RollbackDetail information required to rollback entriesIOExceptionCopyright © 2017 Cask Data, Inc. Licensed under the Apache License, Version 2.0.