class Aerospike::BatchRead

Constants

DEFAULT_BATCH_READ_POLICY

Attributes

bin_names[RW]

Bins to retrieve for this key. bin_names are mutually exclusive with {BatchRead#ops}.

ops[RW]

Optional operations for this key. ops are mutually exclusive with {BatchRead#bin_names}. A bin_name can be emulated with {Operation#get(bin_name)}

policy[RW]

Optional read policy.

read_all_bins[RW]

If true, ignore bin_names and read all bins. If false and bin_names are set, read specified bin_names. If false and bin_names are not set, read record header (generation, expiration) only.

Public Class Methods

ops(key, ops, opt = {}) click to toggle source

Initialize batch key and read operations.

# File lib/aerospike/batch_read.rb, line 59
def self.ops(key, ops, opt = {})
  br = BatchRead.new(key)
  br.policy = create_policy(opt, BatchReadPolicy, DEFAULT_BATCH_READ_POLICY)
  br.ops = ops
  br.read_all_bins = false
  br
end
read_all_bins(key, opt = {}) click to toggle source

Initialize batch key and read_all_bins indicator.

# File lib/aerospike/batch_read.rb, line 51
def self.read_all_bins(key, opt = {})
  br = BatchRead.new(key)
  br.policy = create_policy(opt, BatchReadPolicy, DEFAULT_BATCH_READ_POLICY)
  br.read_all_bins = true
  br
end
read_bins(key, bin_names, opt = {}) click to toggle source

Initialize batch key and bins to retrieve.

# File lib/aerospike/batch_read.rb, line 42
def self.read_bins(key, bin_names, opt = {})
  br = BatchRead.new(key)
  br.policy = BatchRecord.create_policy(opt, BatchReadPolicy, DEFAULT_BATCH_READ_POLICY)
  br.bin_names = bin_names
  br.read_all_bins = false
  br
end