Class RowSet
Represents the result of a query returned by the server.
The retrieval of the rows of a RowSet is generally paged (a first page of result is fetched and the next one is only fetched once all the results of the first page have been consumed). The size of the pages can be configured either globally through SetPageSize(Int32) or per-statement with SetPageSize(Int32). Though new pages are automatically and transparently fetched when needed, it is possible to force the retrieval of the next page early through FetchMoreResults() and FetchMoreResultsAsync().
The RowSet dequeues Row items while iterated. After a full enumeration of this instance, following enumerations will be empty, as all rows have been dequeued.
Inheritance
Implements
Inherited Members
Namespace: Dse
Assembly: Dse.dll
Syntax
public class RowSet : IEnumerable<Row>, IEnumerable, IDisposable
Remarks
RowSet paging is not available with the version 1 of the native protocol. If the protocol version 1 is in use, a RowSet is always fetched in it's entirely and it's up to the client to make sure that no query can yield ResultSet that won't hold in memory.
Constructors
RowSet()
Creates a new instance of RowSet.
Declaration
public RowSet()
Properties
AutoPage
Determines if when dequeuing, it will automatically fetch the following result pages.
Declaration
protected bool AutoPage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Columns
Gets or sets the columns in the RowSet
Declaration
public virtual CqlColumn[] Columns { get; set; }
Property Value
Type | Description |
---|---|
CqlColumn[] |
Info
Gets the execution info of the query
Declaration
public virtual ExecutionInfo Info { get; set; }
Property Value
Type | Description |
---|---|
ExecutionInfo |
IsFullyFetched
Whether all results from this result set has been fetched from the database.
Declaration
public virtual bool IsFullyFetched { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
PagingState
Gets or sets the paging state of the query for the RowSet. When set it states that there are more pages.
Declaration
public virtual byte[] PagingState { get; protected set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
RowQueue
Gets or set the internal row list. It contains the rows of the latest query page.
Declaration
protected virtual ConcurrentQueue<Row> RowQueue { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Concurrent.ConcurrentQueue<Row> |
Methods
Dispose()
For backward compatibility only
Declaration
[Obsolete("Explicitly releasing the RowSet resources is not required. It will be removed in future versions.", false)]
public void Dispose()
FetchMoreResults()
Forces the fetching the next page of results for this RowSet.
Declaration
public void FetchMoreResults()
FetchMoreResultsAsync()
Asynchronously retrieves the next page of results for this RowSet.
The Task will be completed once the internal queue is filled with the new Row instances.
Declaration
public Task FetchMoreResultsAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
GetAvailableWithoutFetching()
The number of rows available in this row set that can be retrieved without blocking to fetch.
Declaration
public int GetAvailableWithoutFetching()
Returns
Type | Description |
---|---|
System.Int32 |
GetEnumerator()
Declaration
public virtual IEnumerator<Row> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<Row> |
GetRows()
For backward compatibility: It is possible to iterate using the RowSet as it is enumerable.
Obsolete: Note that it will be removed in future versions
Declaration
public IEnumerable<Row> GetRows()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Row> |
IsExhausted()
Returns whether this ResultSet has more results. It has side-effects, if the internal queue has been consumed it will page for more results.
Declaration
public virtual bool IsExhausted()
Returns
Type | Description |
---|---|
System.Boolean |
See Also
PageNext()
Gets the next results and add the rows to the current RowSet queue.
Declaration
protected virtual void PageNext()
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |