Class: Aerospike::ScanPolicy

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

Overview

Container object for scan policy command.

Instance Attribute Summary collapse

Attributes inherited from Policy

#consistency_level, #fail_on_filtered_out, #max_retries, #predexp, #priority, #sleep_between_retries, #timeout

Instance Method Summary collapse

Constructor Details

#initialize(opt = {}) ⇒ ScanPolicy



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
# File 'lib/aerospike/policy/scan_policy.rb', line 32

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

  @max_retries = 0

  # Percent of data to scan. Valid integer range is 1 to 100.
  # Default is 100.
  @scan_percent = opt[:scan_percent] || 100

  # Issue scan requests in parallel or serially.
  @concurrent_nodes = opt.fetch(:concurrent_nodes) { true }

  # Indicates if bin data is retrieved. If false, only record digests (and
  # user keys if stored on the server) are retrieved.
  # Default is true.
  @include_bin_data = opt.fetch(:include_bin_data) { true }

  # Terminate scan if cluster in fluctuating state.
  # Default is true.
  @fail_on_cluster_change = opt.fetch(:fail_on_cluster_change) { true }

  @socket_timeout = opt[:socket_timeout] || 10000

  # Number of records to place in queue before blocking. Records received
  # from multiple server nodes will be placed in a queue. A separate thread
  # consumes these records in parallel. If the queue is full, the producer
  # threads will block until records are consumed.
  # Default is 5000.
  @record_queue_size = opt[:record_queue_size] || 5000

  self
end

Instance Attribute Details

#concurrent_nodesObject

Returns the value of attribute concurrent_nodes.



26
27
28
# File 'lib/aerospike/policy/scan_policy.rb', line 26

def concurrent_nodes
  @concurrent_nodes
end

#fail_on_cluster_changeObject

Returns the value of attribute fail_on_cluster_change.



28
29
30
# File 'lib/aerospike/policy/scan_policy.rb', line 28

def fail_on_cluster_change
  @fail_on_cluster_change
end

#include_bin_dataObject

Returns the value of attribute include_bin_data.



27
28
29
# File 'lib/aerospike/policy/scan_policy.rb', line 27

def include_bin_data
  @include_bin_data
end

#record_queue_sizeObject

Returns the value of attribute record_queue_size.



30
31
32
# File 'lib/aerospike/policy/scan_policy.rb', line 30

def record_queue_size
  @record_queue_size
end

#scan_percentObject

Returns the value of attribute scan_percent.



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

def scan_percent
  @scan_percent
end

#socket_timeoutObject

Returns the value of attribute socket_timeout.



29
30
31
# File 'lib/aerospike/policy/scan_policy.rb', line 29

def socket_timeout
  @socket_timeout
end