public class StreamingResultSetListener extends Object implements ResultSetListener, ResultSetAware
The resultset protocol is constructed as if it were random access. Some kind of sources, like an iterable, is not random access. The consumer of such a resultset knows that, and won't try to access the resultset randomly. However, it could ask for some data which is already sent, because of retries caused by network issues.
| Constructor and Description |
|---|
StreamingResultSetListener(Iterable<String> items,
int size) |
StreamingResultSetListener(Iterator<String> items,
int size) |
| Modifier and Type | Method and Description |
|---|---|
Iterator<String> |
getItems() |
List<String> |
getLastChunk() |
int |
getLastFrom() |
int |
getLastTo() |
List<String> |
getResult(int from,
int to)
get a single page of results.
|
ResultSet |
getResultSet() |
int |
getSize()
get number of elements.
|
protected void |
reset() |
void |
setItems(Iterator<String> items) |
void |
setLastChunk(List<String> lastChunk) |
void |
setLastFrom(int lastFrom) |
void |
setLastTo(int lastTo) |
void |
setResultSet(ResultSet resultSet)
sets the resultset instance.
|
void |
setSize(int size) |
protected void reset()
public List<String> getResult(int from, int to)
TypedResultSetListenergetResult in interface TypedResultSetListener<String>from - from 1to - last includedpublic int getSize()
TypedResultSetListenergetSize in interface TypedResultSetListener<String>public void setSize(int size)
public int getLastFrom()
public void setLastFrom(int lastFrom)
public int getLastTo()
public void setLastTo(int lastTo)
public ResultSet getResultSet()
public void setResultSet(ResultSet resultSet)
ResultSetAwaresetResultSet in interface ResultSetAwareresultSet - the resultset instanceCopyright © 2017. All rights reserved.