Interface Reader<T extends PersistentData>
- Type Parameters:
T
- the type ofPersistentData
to read
- All Superinterfaces:
AutoCloseable
Reader interface for reading from a data store.
Implementations of this interface should be thread-safe and should properly handle multiple concurrent readers.
-
Method Summary
Modifier and TypeMethodDescriptionFetches a set of transactions from the data store.takeNext()
Reads the next transaction set from the data store.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
takeNext
Reads the next transaction set from the data store.- Returns:
- a
TransactionSet
containing the transactions that were read, or an empty set if there isn't more data available. - Throws:
Exception
- if an error occurs while reading the data.
-
takeData
Fetches a set of transactions from the data store.
This method retrieves transactions of data limited by the batch size. The transactions retrieved will have a timestamp less than or equal to the maximum timestamp provided. If the maximum timestamp is null, the method will retrieve the oldest limited by the batch size.- Parameters:
maximumTimestamp
- The maximum timestamp for the data in the returned transaction sets. Can be null.batchSize
- The maximum number of data contained within the transaction set to return.- Returns:
- a
TransactionSet
containing the transactions that were read, or an empty set if there isn't more data available. - Throws:
Exception
- if an error occurs while reading the data.
-