Method: Aerospike::Statement#initialize

Defined in:
lib/aerospike/query/statement.rb

#initialize(namespace, set_name, bin_names = []) ⇒ Statement

Returns a new instance of Statement.

[View source]

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/aerospike/query/statement.rb', line 26

def initialize(namespace, set_name, bin_names=[])
  # Namespace determines query Namespace
  @namespace = namespace

  # SetName determines query Set name (Optional)
  @set_name = set_name

  # IndexName determines query index name (Optional)
  # If not set, the server will determine the index from the filter's bin name.
  @index_name = nil

  # BinNames detemines bin names (optional)
  @bin_names = bin_names

  # Filters determine query filters (Optional)
  # Currently, only one filter is allowed by the server on a secondary index lookup.
  # If multiple filters are necessary, see QueryFilter example for a workaround.
  # QueryFilter demonstrates how to add additional filters in an user-defined
  # aggregation function.
  @filters = []

  @package_name  = nil
  @function_name = nil
  @function_args = nil
  @operations = nil


  # Limit returned records per second (rps) rate for each server.
  # Will not apply rps limit if records_per_second is zero.
  # Currently only applicable to a query without a defined filter (scan).
  # Default is 0
  @records_per_second = 0

  # TaskId determines query task id. (Optional)
  @task_id = rand(RAND_MAX)

  # determines if the query should return data
  @return_data = true
end