Interface RowSource
- All Known Implementing Classes:
PartitionHandle,QueryResultHandle
-
Method Summary
Modifier and TypeMethodDescriptiondefault QueryResultCallsbufferRows(Consumer)with default options.default QueryResultbufferRows(Consumer<RowOptions> options) Fetches result rows and buffers them in memory.longrowCount()Returns the number of result rows.default QueryMetadatastreamRows(Consumer<Row> rowAction) CallsstreamRows(Consumer, Consumer)with default options.streamRows(Consumer<Row> rowAction, Consumer<RowOptions> options) Fetches result rows and passes them to the givenrowActioncallback, one by one as they arrive from the server.
-
Method Details
-
rowCount
long rowCount()Returns the number of result rows. -
streamRows
CallsstreamRows(Consumer, Consumer)with default options. -
streamRows
Fetches result rows and passes them to the givenrowActioncallback, one by one as they arrive from the server.The callback action is guaranteed to execute in the same thread (or virtual thread) that called this method. If the callback throws an exception, the exception is re-thrown by this method.
Prefer this over
bufferRows()when it's unknown whether the rows fit in memory.- Parameters:
options- A callback for specifying custom options.- Throws:
QueryException- if the server response indicates an error occurred.InvalidCredentialException- if the server rejects the user credentials.AnalyticsTimeoutException- if the streaming does not complete before the timeout expires.CancellationException- if the calling thread is interrupted.RuntimeException- if the row action callback throws an exception.
-
bufferRows
CallsbufferRows(Consumer)with default options. -
bufferRows
Fetches result rows and buffers them in memory. Returns aQueryResultholding the rows and metadata.If it's unknown whether the results rows fit in memory, use
streamRows(java.util.function.Consumer<com.couchbase.analytics.client.java.Row>)instead.- Parameters:
options- A callback for specifying custom options.- Throws:
QueryException- if the server response indicates an error occurred.InvalidCredentialException- if the server rejects the user credentials.AnalyticsTimeoutException- if the result rows cannot be fetched before the timeout expires.CancellationException- if the calling thread is interrupted.RuntimeException- if the row action callback throws an exception.
-