Class: Riak::TimeSeries::Submission

Inherits:
Object
  • Object
show all
Defined in:
lib/riak/time_series/submission.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, table_name) ⇒ Submission

Initializes the submission object with a client and table name

Parameters:

  • client (Riak::Client)

    the client connected to the Riak TS cluster

  • table_name (String)

    the table name in the cluster



20
21
22
23
# File 'lib/riak/time_series/submission.rb', line 20

def initialize(client, table_name)
  @client = client
  @table_name = table_name
end

Instance Attribute Details

#clientRiak::Client (readonly)

Returns the client to write submissions to

Returns:



10
11
12
# File 'lib/riak/time_series/submission.rb', line 10

def client
  @client
end

#measurementsArray<Array<Object>>

Returns measurements to write to Riak TS

Returns:



6
7
8
# File 'lib/riak/time_series/submission.rb', line 6

def measurements
  @measurements
end

#table_nameString (readonly)

Returns the table name to write submissions to

Returns:

  • (String)

    the table name to write submissions to



14
15
16
# File 'lib/riak/time_series/submission.rb', line 14

def table_name
  @table_name
end

Instance Method Details

#write!Object

Write the submitted data to Riak.



26
27
28
29
30
# File 'lib/riak/time_series/submission.rb', line 26

def write!
  client.backend do |be|
    be.time_series_put_operator.put(table_name, measurements)
  end
end