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 |
isFinished(long cursorId)
Check whether
cursorId is finished. |
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitspliterator, streamforEachRemainingpublic ScanCursor()
public ScanCursor(ScanOptions options)
ScanCursor with id=0.options - the scan options to apply.public ScanCursor(long cursorId)
ScanCursor with ScanOptions.NONEcursorId - the cursor Id.public ScanCursor(long cursorId,
@Nullable
ScanOptions options)
ScanCursorcursorId - the cursor Id.options - Defaulted to ScanOptions.NONE if null.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 - protected boolean isFinished(long cursorId)
cursorId is finished.cursorId - the cursor Idpublic long getCursorId()
CursorgetCursorId in interface Cursor<T>protected T moveNext(Iterator<T> source)
Iterable.source - public final void close()
close in interface Closeableclose in interface AutoCloseableclose in interface CloseableIterator<T>protected void doClose()
close().public boolean isClosed()
protected final boolean isReady()
protected final boolean isOpen()
public long getPosition()
getPosition in interface Cursor<T>Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.