Class: Aerospike::BatchPolicy

Inherits:
Policy
  • Object
show all
Defined in:
lib/aerospike/policy/batch_policy.rb

Overview

Container object for batch policy command.

Instance Attribute Summary collapse

Attributes inherited from Policy

#consistency_level, #fail_on_filtered_out, #filter_exp, #max_retries, #predexp, #priority, #replica, #sleep_between_retries, #socket_timeout, #timeout, #use_compression

Instance Method Summary collapse

Constructor Details

#initialize(opt = {}) ⇒ BatchPolicy

Returns a new instance of BatchPolicy.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/aerospike/policy/batch_policy.rb', line 27

def initialize(opt={})
  super(opt)

  # Use old batch direct protocol where batch reads are handled by direct
  # low-level batch server database routines. The batch direct protocol can
  # be faster when there is a single namespace. But there is one important
  # drawback: The batch direct protocol will not proxy to a different
  # server node when the mapped node has migrated a record to another node
  # (resulting in not found record). This can happen after a node has been
  # added/removed from the cluster and there is a lag between records being
  # migrated and client partition map update (once per second). The batch
  # index protocol will perform this record proxy when necessary.
  #
  # Default: false (use new batch index protocol if server supports it)
  @use_batch_direct = opt.fetch(:use_batch_direct) { false }

  self
end

Instance Attribute Details

#use_batch_directObject

Returns the value of attribute use_batch_direct.



25
26
27
# File 'lib/aerospike/policy/batch_policy.rb', line 25

def use_batch_direct
  @use_batch_direct
end