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.



10
11
12
13
# File 'lib/riak/client/beefcake/time_series_list_operator.rb', line 10

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

Instance Method Details

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



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/riak/client/beefcake/time_series_list_operator.rb', line 15

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