K - key typeV - value typepublic class DataGridChunkedCollectionReader<K,V> extends ChunkedCollectionReader<K,Iterable<V>,com.scaleoutsoftware.soss.hserver.interop.ChunkDescriptor>
ChunkedCollectionReader implementation used by a reducer to read key-value chunks.| Modifier and Type | Method and Description |
|---|---|
static <KEY,VALUE> |
getGridReader(DataGridReaderParameters params)
Instantiates a grid reader with the specified
DataGridReaderParameters. |
K |
getKey()
Gets the current key.
|
Iterable<V> |
getValue()
Gets the current value.
|
void |
prepareChunk(com.scaleoutsoftware.soss.hserver.interop.ChunkDescriptor chunkDescriptor,
DataInputStream dataInput,
ByteBuffer buffer,
int chunkIndex)
This method is called once before the chunk is served.
|
boolean |
readNext()
Reads the next entry from the chunks.
|
Future<Object> |
scheduleAsyncRead(Callable<Object> readOperation) |
getMaxWaitingTime, getTotalWaitingTime, startReadingpublic void prepareChunk(com.scaleoutsoftware.soss.hserver.interop.ChunkDescriptor chunkDescriptor,
DataInputStream dataInput,
ByteBuffer buffer,
int chunkIndex)
throws IOException
ChunkedCollectionReaderprepareChunk in class ChunkedCollectionReader<K,Iterable<V>,com.scaleoutsoftware.soss.hserver.interop.ChunkDescriptor>chunkDescriptor - Chunk identifierdataInput - A DataInputStream view of the chunkbuffer - A ByteBuffer view of the chunkchunkIndex - The index of the chunk in the chunk sequenceIOException - If a reading error occurredpublic boolean readNext()
throws IOException,
TimeoutException
ChunkedCollectionReaderreadNext in class ChunkedCollectionReader<K,Iterable<V>,com.scaleoutsoftware.soss.hserver.interop.ChunkDescriptor>true if the object was read successfully, false if there are no more objects to be read.IOException - if there was a ScaleOut hServer access errorTimeoutException - if the read timed outpublic K getKey()
ChunkedCollectionReaderChunkedCollectionReader.readNext().getKey in class ChunkedCollectionReader<K,Iterable<V>,com.scaleoutsoftware.soss.hserver.interop.ChunkDescriptor>public Iterable<V> getValue()
ChunkedCollectionReaderChunkedCollectionReader.readNext().getValue in class ChunkedCollectionReader<K,Iterable<V>,com.scaleoutsoftware.soss.hserver.interop.ChunkDescriptor>public static <KEY,VALUE> DataGridChunkedCollectionReader<KEY,VALUE> getGridReader(DataGridReaderParameters params) throws IOException
DataGridReaderParameters.KEY - Key typeVALUE - Value typeparams - Parameters for a data grid reader.IOException - If a read error occurred.Copyright (C) 2007-2014 ScaleOut Software, Inc.