Class: Riak::Client::BeefcakeProtobuffsBackend::TimeSeriesListOperator

Inherits:
Operator
  • Object
show all
Defined in:
lib/riak/client/beefcake/time_series_list_operator.rb

Instance Attribute Summary

Attributes inherited from Operator

#backend

Instance Method Summary collapse

Constructor Details

#initialize(backend, convert_timestamp) ⇒ TimeSeriesListOperator

Returns a new instance of TimeSeriesListOperator.



24
25
26
27
# File 'lib/riak/client/beefcake/time_series_list_operator.rb', line 24

def initialize(backend, convert_timestamp)
  super(backend)
  @convert_timestamp = convert_timestamp
end

Instance Method Details

#list(table_name, block, options = { }) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/riak/client/beefcake/time_series_list_operator.rb', line 29

def list(table_name, block, options = {  })
  request = TsListKeysReq.new options.merge(table: table_name)

  return streaming_list_keys(request, &block) unless block.nil?

  Riak::TimeSeries::Collection.new.tap do |key_buffer|
    streaming_list_keys(request) do |key_row|
      key_buffer << key_row
    end
  end
end