Skip to content

Commit

Permalink
Merge pull request #120 from aerospike/CLIENT-1529_Policy_cleanse
Browse files Browse the repository at this point in the history
[Client-1529] Deprecate unsupported policies
  • Loading branch information
vmsachin committed Jun 23, 2023
2 parents 68b17fa + f1d39e1 commit 8883080
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
1 change: 0 additions & 1 deletion examples/scan_serial.rb
Expand Up @@ -44,7 +44,6 @@ def run_example(client)
# the load on the server.
policy = ScanPolicy.new
policy.max_retries = 1
policy.priority = Priority::LOW

node_list = client.nodes
begin_time = Time.now
Expand Down
6 changes: 4 additions & 2 deletions lib/aerospike/policy/policy.rb
Expand Up @@ -51,8 +51,10 @@ def initialize(opt = {})
# Default: false
@fail_on_filtered_out = opt[:fail_on_filtered_out] || false

# Priority of request relative to other transactions.
# Currently, only used for scans.
# [: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.
Expand Down
6 changes: 5 additions & 1 deletion lib/aerospike/policy/priority.rb
@@ -1,5 +1,5 @@
# encoding: utf-8
# Copyright 2014-2020 Aerospike, Inc.
# Copyright 2014-2023 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.


#[:nodoc:]
# DEPRECATED
# TODO: Remove this module on the next major release
module Aerospike

module Priority
Expand Down
11 changes: 8 additions & 3 deletions lib/aerospike/policy/scan_policy.rb
Expand Up @@ -48,16 +48,21 @@ def initialize(opt={})
# Default is 100.
@scan_percent = opt[:scan_percent] || 100

# Issue scan requests in parallel or serially.
# [: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 }

# Terminate scan if cluster in fluctuating state.
# Default is 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
1 change: 0 additions & 1 deletion spec/aerospike/policy/policy_spec.rb
Expand Up @@ -25,7 +25,6 @@
policy = described_class.new

expect(policy.class).to eq described_class
expect(policy.priority).to eq Aerospike::Priority::DEFAULT
expect(policy.timeout).to eq 0
expect(policy.max_retries).to eq 2
expect(policy.sleep_between_retries).to eq 0.5
Expand Down
1 change: 0 additions & 1 deletion spec/aerospike/policy/write_policy_spec.rb
Expand Up @@ -24,7 +24,6 @@
policy = described_class.new

expect(policy.class).to eq described_class
expect(policy.priority).to eq Aerospike::Priority::DEFAULT
expect(policy.timeout).to eq 1
expect(policy.max_retries).to eq 2
expect(policy.sleep_between_retries).to eq 0.5
Expand Down

0 comments on commit 8883080

Please sign in to comment.