Interface Cursor<T>
- Type Parameters:
T-
- All Superinterfaces:
AutoCloseable,Closeable,CloseableIterator<T>,Iterator<T>
- All Known Implementing Classes:
ConvertingCursor,KeyBoundCursor,ScanCursor
Cursor abstraction to scan over the keyspace or elements within a data structure using a variant of a
SCAN
command.
Using a Java 8 java.util.stream.Stream allows to apply additional
filters and
limits to the underlying Cursor.
Make sure to close the cursor when done as this allows implementations to clean up
any resources they need to keep open to iterate over elements (eg. by using a try-with-resource statement).
- Since:
- 1.4
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Methods inherited from interface org.springframework.data.util.CloseableIterator
close, spliterator, streamMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
getCursorId
long getCursorId()Get the reference cursor.
NOTE: the id might change while iterating items.- Returns:
-
isClosed
boolean isClosed()- Returns:
trueif cursor closed.
-
getPosition
long getPosition()- Returns:
- the current position of the cursor.
-