public abstract class AbstractPayloadTable extends Object implements PayloadTable
PayloadTable.PayloadTable.Entry| Constructor and Description |
|---|
AbstractPayloadTable() |
| Modifier and Type | Method and Description |
|---|---|
co.cask.cdap.api.dataset.lib.CloseableIterator<PayloadTable.Entry> |
fetch(TopicMetadata metadata,
long transactionWritePointer,
MessageId messageId,
boolean inclusive,
int limit)
Fetches entries from the payload table under the given topic, starting from the given
MessageId. |
protected abstract void |
persist(Iterator<RawPayloadTableEntry> tableEntries)
Store the
RawPayloadTableEntrys persistently. |
protected abstract co.cask.cdap.api.dataset.lib.CloseableIterator<RawPayloadTableEntry> |
read(byte[] startRow,
byte[] stopRow,
int limit)
Read the
RawPayloadTableEntrys given a key range. |
void |
store(Iterator<? extends PayloadTable.Entry> entries)
Stores a list of entries to the payload table under the given topic.
|
protected abstract void persist(Iterator<RawPayloadTableEntry> tableEntries) throws IOException
RawPayloadTableEntrys persistently.tableEntries - Iterator of RawPayloadTableEntrysIOException - thrown if there was an error while storing the entriesprotected abstract co.cask.cdap.api.dataset.lib.CloseableIterator<RawPayloadTableEntry> read(byte[] startRow, byte[] stopRow, int limit) throws IOException
RawPayloadTableEntrys given a key range.startRow - start row prefixstopRow - stop row prefixlimit - maximum number of messages to readCloseableIterator of RawPayloadTableEntrysIOException - thrown if there was an error while trying to read the entries from the tablepublic void store(Iterator<? extends PayloadTable.Entry> entries) throws IOException
PayloadTablestore in interface PayloadTableentries - a list of entries to store. This method guarantees each PayloadTable.Entry will be consumed right away,
hence it is safe for the Iterator to reuse the same PayloadTable.Entry instanceIOExceptionpublic co.cask.cdap.api.dataset.lib.CloseableIterator<PayloadTable.Entry> fetch(TopicMetadata metadata, long transactionWritePointer, MessageId messageId, boolean inclusive, int limit) throws IOException
PayloadTableMessageId.fetch in interface PayloadTablemetadata - TopicMetadata of the topic to fetch fromtransactionWritePointer - transaction write pointermessageId - message Id to start frominclusive - true to include the entry identified by the given MessageId as the first messagelimit - maximum number of entries to fetchCloseableIterator of entriesIOExceptionCopyright © 2017 Cask Data, Inc. Licensed under the Apache License, Version 2.0.