class Riak::TimeSeries::List
A request to list keys in a Riak
Time Series collection. Very expensive, not recommended for use in production.
Attributes
@!attribute [r] client @return [Riak::Client] the Riak
client to use for the list keys operation
@!attribute [r] results @return [Riak::TimeSeries::Collection<Riak::TimeSeries::Row>] each key
as a row in a collection; nil if keys were streamed to a block
@!attribute [r] table_name
@return [String] the table name to list keys in
@!attribute [rw] timeout @return [Integer] how many milliseconds Riak
should wait for listing
Public Class Methods
Initializes but does not issue the list keys operation
@param [Riak::Client] client the Riak
Client
to list keys with @param [String] table_name
the table name to list keys in
# File lib/riak/time_series/list.rb, line 29 def initialize(client, table_name) @client = client @table_name = table_name @timeout = nil end
Public Instance Methods
Issue the list keys request. Takes a block for streaming results, or sets the results
read-only attribute iff no block is given.
@yieldparam key [Riak::TimeSeries::Row] a listed key
# File lib/riak/time_series/list.rb, line 39 def issue!(&block) list_keys_warning(caller) options = { timeout: self.timeout } potential_results = nil client.backend do |be| op = be.time_series_list_operator(client.convert_timestamp) potential_results = op.list(table_name, block, options) end return @results = potential_results unless block_given? true end
Private Instance Methods
# File lib/riak/time_series/list.rb, line 57 def list_keys_warning(bound_caller) return if Riak.disable_list_keys_warnings backtrace = bound_caller.join("\n ") warn(t('time_series.list_keys'), backtrace: backtrace) end