T - public abstract class ScanCursor<T> extends Object implements Cursor<T>
Cursor implementation continuously loading additional results from Redis server until
reaching its starting point zero. ScanCursor has to be initialized (open() prior to usage.| Constructor and Description |
|---|
ScanCursor()
|
ScanCursor(long cursorId)
Crates new
ScanCursor with ScanOptions.NONE |
ScanCursor(long cursorId,
ScanOptions options)
Crates new
ScanCursor |
ScanCursor(ScanOptions options)
Crates new
ScanCursor with id=0. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
doClose()
Customization hook for cleaning up resources on when calling
close(). |
protected void |
doOpen(long cursorId)
Customization hook when calling
open(). |
protected abstract ScanIteration<T> |
doScan(long cursorId,
ScanOptions options)
Performs the actual scan command using the native client implementation.
|
long |
getCursorId()
Get the reference cursor.
|
long |
getPosition() |
boolean |
hasNext() |
boolean |
isClosed() |
protected boolean |
isOpen() |
protected boolean |
isReady() |
protected T |
moveNext(Iterator<T> source)
Fetch the next item from the underlying
Iterable. |
T |
next() |
ScanCursor<T> |
open()
Initialize the
Cursor prior to usage. |
void |
remove() |
public ScanCursor()
public ScanCursor(ScanOptions options)
ScanCursor with id=0.options - public ScanCursor(long cursorId)
ScanCursor with ScanOptions.NONEcursorId - public ScanCursor(long cursorId,
ScanOptions options)
ScanCursorcursorId - options - Defaulted to ScanOptions.NONE if nulled.protected abstract ScanIteration<T> doScan(long cursorId, ScanOptions options)
null.cursorId - options - public final ScanCursor<T> open()
Cursor prior to usage.protected void doOpen(long cursorId)
open().cursorId - public long getCursorId()
CursorgetCursorId in interface Cursor<T>protected T moveNext(Iterator<T> source)
Iterable.source - public final void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected void doClose()
close().public boolean isClosed()
protected final boolean isReady()
protected final boolean isOpen()
public long getPosition()
getPosition in interface Cursor<T>