Class TableFindCursor<T,R>
java.lang.Object
com.datastax.astra.internal.command.AbstractCursor<T,R>
com.datastax.astra.client.tables.cursor.TableFindCursor<T,R>
- Type Parameters:
T
- working bean of parent tableR
- working bean returned for the find
Implementation of a cursor across the find items
-
Field Summary
Fields inherited from class com.datastax.astra.internal.command.AbstractCursor
buffer, consumed, currentPage, recordType, state
-
Constructor Summary
ConstructorsConstructorDescriptionTableFindCursor
(Table<T> dataSource, Filter filter, TableFindOptions options, Class<R> rowType) Cursor to iterate on the result of a query. -
Method Summary
Modifier and TypeMethodDescriptionclone()
void
Fetches the next batch of documents into the buffer.Immutable methods that return a new Cursor instance.Retrieve keyspace name.Creates a newTableFindCursor
that includes similarity scores in the results.Creates a newTableFindCursor
that includes sort vector metadata in the results.limit
(int newLimit) Creates a newTableFindCursor
with a specified limit on the number of results.project
(Projection... newProjection) Creates a newTableFindCursor
with an updated projection.skip
(int newSkip) Creates a newTableFindCursor
that skips a specified number of results.Creates a newTableFindCursor
with a specified sort order.Methods inherited from class com.datastax.astra.internal.command.AbstractCursor
checkIdleState, close, consumeBuffer, getBufferedSize, getSortVector, hasNext, iterator, next, rewind, stream, toList
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TableFindCursor
public TableFindCursor(Table<T> dataSource, Filter filter, TableFindOptions options, Class<R> rowType) Cursor to iterate on the result of a query.- Parameters:
dataSource
- source tablefilter
- current filteroptions
- options of the find operationrowType
- row type returned with the cursor
-
-
Method Details
-
clone
-
filter
Immutable methods that return a new Cursor instance.- Parameters:
newFilter
- a new filter- Returns:
- a new cursor
-
project
Creates a newTableFindCursor
with an updated projection.- Parameters:
newProjection
- the new projection to apply- Returns:
- a new
TableFindCursor
instance with the specified projection
-
sort
Creates a newTableFindCursor
with a specified sort order.- Parameters:
sort
- the sort criteria to apply- Returns:
- a new
TableFindCursor
instance with the specified sort order
-
limit
Creates a newTableFindCursor
with a specified limit on the number of results.- Parameters:
newLimit
- the maximum number of results to retrieve- Returns:
- a new
TableFindCursor
instance with the specified limit
-
skip
Creates a newTableFindCursor
that skips a specified number of results.- Parameters:
newSkip
- the number of results to skip- Returns:
- a new
TableFindCursor
instance with the specified skip value
-
includeSimilarity
Creates a newTableFindCursor
that includes similarity scores in the results.- Returns:
- a new
TableFindCursor
instance with similarity scores included
-
includeSortVector
Creates a newTableFindCursor
that includes sort vector metadata in the results.- Returns:
- a new
TableFindCursor
instance with sort vector metadata included
-
fetchNextBatch
public void fetchNextBatch()Fetches the next batch of documents into the buffer. This method handles paging, using the page state from the previous batch to fetch the next one.- Specified by:
fetchNextBatch
in classAbstractCursor<T,
R>
-
getKeyspace
Retrieve keyspace name.- Returns:
- keyspace name
-