public interface MessageReadSet
Modifier and Type | Method and Description |
---|---|
int |
count() |
void |
doPrefetch(int index,
long relativeOffset,
long size)
Do data prefetch from store.
|
StoreKey |
getKeyAt(int index)
Returns the key of the ith message
|
long |
sizeInBytes(int index)
Returns the size of the ith message
|
void |
writeTo(AsyncWritableChannel channel,
Callback<java.lang.Long> callback)
This method is intend to write prefetched data from
MessageReadSet to AsyncWritableChannel . |
long |
writeTo(int index,
java.nio.channels.WritableByteChannel channel,
long relativeOffset,
long maxSize)
Write the message referred by the index in this set to the given channel from the given relative offset
up to maxSize.
|
long writeTo(int index, java.nio.channels.WritableByteChannel channel, long relativeOffset, long maxSize) throws java.io.IOException
index
- the index of the message in the set that needs to be writtenchannel
- the channel into which the data needs to be written torelativeOffset
- The relative offset into the message from which the write needs to startmaxSize
- The max size that needs to be written from the given messagejava.io.IOException
void writeTo(AsyncWritableChannel channel, Callback<java.lang.Long> callback)
MessageReadSet
to AsyncWritableChannel
. Data
should be ready in memory(no blocking call) before write to AsyncWritableChannel
asynchronously. Callback is
called when the entire batch of writes succeeds or fails.channel
- the channel into which the data needs to be written tocallback
- The callback when data is fully wrote to the channel.int count()
long sizeInBytes(int index)
index
- The index into the message setStoreKey getKeyAt(int index)
index
- The index into the message setvoid doPrefetch(int index, long relativeOffset, long size) throws java.io.IOException
index
- The index into the message setrelativeOffset
- The relativeOffset to start withsize
- The size requested to doPrefetch.java.io.IOException