Class: Cassandra::Result
- Inherits:
-
Object
- Object
- Cassandra::Result
- Includes:
- Enumerable
- Defined in:
- lib/cassandra/result.rb
Instance Method Summary collapse
-
#each {|row| ... } ⇒ Enumerator, self
(also: #rows, #each_row)
Returns Enumerator if no block given.
-
#empty? ⇒ Boolean
Whether it has any rows.
-
#execution_info ⇒ Cassandra::Execution::Info
Query execution information, such as number of retries and all tried hosts, etc.
-
#last_page? ⇒ Boolean
Whether no more pages are available.
-
#next_page(options = nil) ⇒ Cassandra::Result?
Loads next page synchronously.
-
#next_page_async(options = nil) ⇒ Cassandra::Future<Cassandra::Result, nil>
Loads next page asynchronously.
-
#paging_state ⇒ String?
Exposes current paging state for stateless pagination.
-
#size ⇒ Integer
(also: #length)
Rows count.
Instance Method Details
#each {|row| ... } ⇒ Enumerator, self Also known as: rows, each_row
Returns Enumerator if no block given
40 41 |
# File 'lib/cassandra/result.rb', line 40 def each end |
#empty? ⇒ Boolean
Returns whether it has any rows.
30 31 |
# File 'lib/cassandra/result.rb', line 30 def empty? end |
#execution_info ⇒ Cassandra::Execution::Info
Query execution information, such as number of retries and all tried hosts, etc.
25 26 27 |
# File 'lib/cassandra/result.rb', line 25 def execution_info @info ||= Execution::Info.new(@keyspace, @statement, @options, @hosts, @consistency, @retries, @trace_id ? Execution::Trace.new(@trace_id, @client) : nil) end |
#last_page? ⇒ Boolean
Returns whether no more pages are available.
46 47 |
# File 'lib/cassandra/result.rb', line 46 def last_page? end |
#next_page(options = nil) ⇒ Cassandra::Result?
:paging_state
option will be ignored.
Loads next page synchronously
59 60 |
# File 'lib/cassandra/result.rb', line 59 def next_page( = nil) end |
#next_page_async(options = nil) ⇒ Cassandra::Future<Cassandra::Result, nil>
:paging_state
option will be ignored.
Loads next page asynchronously
73 74 |
# File 'lib/cassandra/result.rb', line 73 def next_page_async( = nil) end |
#paging_state ⇒ String?
Although this feature exists to allow web applications to store paging state in an HTTP cookie, it is not safe to expose without encrypting or otherwise securing it. Paging state contains information internal to the Apache Cassandra cluster, such as partition key and data. Additionally, if a paging state is sent with CQL statement, different from the original, the behavior of Cassandra is undefined and will likely cause a server process of the coordinator of such request to abort.
Exposes current paging state for stateless pagination.
90 91 |
# File 'lib/cassandra/result.rb', line 90 def paging_state end |
#size ⇒ Integer Also known as: length
Returns rows count.
34 35 |
# File 'lib/cassandra/result.rb', line 34 def size end |