class Cassandra::Results::Paged
Attributes
paging_state[R]
Public Class Methods
new(payload, warnings, rows, paging_state, trace_id, keyspace, statement, options, hosts, consistency, retries, client, futures_factory)
click to toggle source
# File lib/cassandra/result.rb 110 def initialize(payload, 111 warnings, 112 rows, 113 paging_state, 114 trace_id, 115 keyspace, 116 statement, 117 options, 118 hosts, 119 consistency, 120 retries, 121 client, 122 futures_factory) 123 @payload = payload 124 @warnings = warnings 125 @rows = rows 126 @paging_state = paging_state 127 @trace_id = trace_id 128 @keyspace = keyspace 129 @statement = statement 130 @options = options 131 @hosts = hosts 132 @consistency = consistency 133 @retries = retries 134 @client = client 135 @futures = futures_factory 136 end
Public Instance Methods
each(&block)
click to toggle source
# File lib/cassandra/result.rb 149 def each(&block) 150 if block_given? 151 @rows.each(&block) 152 self 153 else 154 @rows.each 155 end 156 end
empty?()
click to toggle source
Returns whether or not there are any rows in this result set
# File lib/cassandra/result.rb 139 def empty? 140 @rows.empty? 141 end
inspect()
click to toggle source
@private
# File lib/cassandra/result.rb 185 def inspect 186 "#<Cassandra::Result:0x#{object_id.to_s(16)} " \ 187 "@rows=#{@rows.inspect} " \ 188 "@last_page=#{@paging_state.nil?}>" 189 end
last_page?()
click to toggle source
Returns true when there are no more pages to load.
# File lib/cassandra/result.rb 161 def last_page? 162 @paging_state.nil? 163 end
next_page(options = nil)
click to toggle source
Returns the next page or nil when there is no next page.
@return [Cassandra::Result]
# File lib/cassandra/result.rb 168 def next_page(options = nil) 169 next_page_async(options).get 170 end
next_page_async(options = nil)
click to toggle source
# File lib/cassandra/result.rb 172 def next_page_async(options = nil) 173 return @futures.value(nil) if @paging_state.nil? 174 175 options = @options.override(options, paging_state: @paging_state) 176 177 if @statement.is_a?(Statements::Simple) 178 @client.query(@statement, options) 179 else 180 @client.execute(@statement, options) 181 end 182 end
size()
click to toggle source
Returns count of underlying rows
# File lib/cassandra/result.rb 144 def size 145 @rows.size 146 end
Also aliased as: length