Class: Cassandra::Result

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/cassandra/result.rb

Instance Method Summary collapse

Instance Method Details

#each {|row| ... } ⇒ Enumerator, self Also known as: rows, each_row

Returns Enumerator if no block given

Yield Parameters:

  • row (Hash)

    current row

Returns:

  • (Enumerator, self)

    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.

Returns:

  • (Boolean)

    whether it has any rows



30
31
# File 'lib/cassandra/result.rb', line 30

def empty?
end

#execution_infoCassandra::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.

Returns:

  • (Boolean)

    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?

Note:

:paging_state option will be ignored.

Loads next page synchronously

Parameters:

  • options (Hash) (defaults to: nil)

    additional options, just like the ones for Session#execute

Returns:

See Also:



59
60
# File 'lib/cassandra/result.rb', line 59

def next_page(options = nil)
end

#next_page_async(options = nil) ⇒ Cassandra::Future<Cassandra::Result, nil>

Note:

:paging_state option will be ignored.

Loads next page asynchronously

Parameters:

Returns:

See Also:



73
74
# File 'lib/cassandra/result.rb', line 73

def next_page_async(options = nil)
end

#paging_stateString?

Note:

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.

Returns:

  • (String, nil)

    current paging state as a String or nil.

See Also:



90
91
# File 'lib/cassandra/result.rb', line 90

def paging_state
end

#sizeInteger Also known as: length

Returns rows count.

Returns:

  • (Integer)

    rows count



34
35
# File 'lib/cassandra/result.rb', line 34

def size
end