Skip to content

Commit

Permalink
[CLIENT-1592] deprecated policies
Browse files Browse the repository at this point in the history
  • Loading branch information
vmsachin committed Jun 22, 2023
1 parent e7cf654 commit 82eeb82
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/aerospike/policy/policy.rb
Expand Up @@ -21,7 +21,7 @@ module Aerospike

# Container object for client policy command.
class Policy
attr_accessor :filter_exp, :timeout, :max_retries, :sleep_between_retries, :consistency_level,
attr_accessor :filter_exp, :priority, :timeout, :max_retries, :sleep_between_retries, :consistency_level,
:predexp, :fail_on_filtered_out, :replica, :use_compression, :socket_timeout

alias total_timeout timeout
Expand Down Expand Up @@ -51,6 +51,12 @@ def initialize(opt = {})
# Default: false
@fail_on_filtered_out = opt[:fail_on_filtered_out] || false

# [:nodoc:]
# DEPRECATED
# The Aerospike server does not support this policy anymore
# TODO: Remove for next major release
@priority = opt[:priority] || Priority::DEFAULT

# Set optional predicate expression filters in postfix notation.
# Predicate expression filters are applied on the query results on the server.
# Predicate expression filters may occur on any bin in the record.
Expand Down
16 changes: 15 additions & 1 deletion lib/aerospike/policy/scan_policy.rb
Expand Up @@ -23,8 +23,10 @@ module Aerospike
class ScanPolicy < Policy

attr_accessor :max_records
attr_accessor :scan_percent
attr_accessor :concurrent_nodes
attr_accessor :include_bin_data
attr_accessor :fail_on_cluster_change
attr_accessor :socket_timeout
attr_accessor :record_queue_size
attr_accessor :records_per_second
Expand All @@ -42,14 +44,26 @@ def initialize(opt={})
# Default: 0 (do not limit record count)
@max_records = opt.fetch(:max_records) { 0 }

# Issue scan requests in parallel or serially.
# Percent of data to scan. Valid integer range is 1 to 100.
# Default is 100.
@scan_percent = opt[:scan_percent] || 100

# [:nodoc:]
# DEPRECATED
# The Aerospike server does not support this policy anymore
# TODO: Remove for next major release
@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 }

# [:nodoc:]
# DEPRECATED
# The Aerospike server does not support this policy anymore
# TODO: Remove for next major release
@fail_on_cluster_change = opt.fetch(:fail_on_cluster_change) { true }

# Determines network timeout for each attempt.
#
Expand Down

0 comments on commit 82eeb82

Please sign in to comment.