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()voidFetches the next batch of documents into the buffer.Immutable methods that return a new Cursor instance.Retrieve keyspace name.Creates a newTableFindCursorthat includes similarity scores in the results.Creates a newTableFindCursorthat includes sort vector metadata in the results.limit(int newLimit) Creates a newTableFindCursorwith a specified limit on the number of results.project(Projection... newProjection) Creates a newTableFindCursorwith an updated projection.skip(int newSkip) Creates a newTableFindCursorthat skips a specified number of results.Creates a newTableFindCursorwith a specified sort order.Methods inherited from class com.datastax.astra.internal.command.AbstractCursor
checkIdleState, close, consumeBuffer, getBufferedSize, getSortVector, hasNext, iterator, next, rewind, stream, toListMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 newTableFindCursorwith an updated projection.- Parameters:
newProjection- the new projection to apply- Returns:
- a new
TableFindCursorinstance with the specified projection
-
sort
Creates a newTableFindCursorwith a specified sort order.- Parameters:
sort- the sort criteria to apply- Returns:
- a new
TableFindCursorinstance with the specified sort order
-
limit
Creates a newTableFindCursorwith a specified limit on the number of results.- Parameters:
newLimit- the maximum number of results to retrieve- Returns:
- a new
TableFindCursorinstance with the specified limit
-
skip
Creates a newTableFindCursorthat skips a specified number of results.- Parameters:
newSkip- the number of results to skip- Returns:
- a new
TableFindCursorinstance with the specified skip value
-
includeSimilarity
Creates a newTableFindCursorthat includes similarity scores in the results.- Returns:
- a new
TableFindCursorinstance with similarity scores included
-
includeSortVector
Creates a newTableFindCursorthat includes sort vector metadata in the results.- Returns:
- a new
TableFindCursorinstance 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:
fetchNextBatchin classAbstractCursor<T,R>
-
getKeyspace
Retrieve keyspace name.- Returns:
- keyspace name
-