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(int) or per-statement with SetPageSize(int). 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.
Inherited Members
Namespace: Cassandra
Assembly: Cassandra.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 |
---|---|
bool |
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 |
---|---|
bool |
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
int |
GetEnumerator()
Declaration
public virtual IEnumerator<Row> GetEnumerator()
Returns
Type | Description |
---|---|
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 |
---|---|
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 |
---|---|
bool |
See Also
PageNext()
Gets the next results and add the rows to the current RowSet queue.
Declaration
protected virtual void PageNext()