From 9310a36e275952049f979c85ca85ee2a9ba54d92 Mon Sep 17 00:00:00 2001 From: roimenashe Date: Wed, 19 May 2021 12:28:19 +0300 Subject: [PATCH] Revert removal of deprecated properties - these properties are still relevant in Aerospike Client 4.4.x. (should be removed in 3.0.0). --- .../config/ReadPolicyFactoryBean.java | 10 ++++++++++ .../config/ScanPolicyFactoryBean.java | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/aerospike/config/ReadPolicyFactoryBean.java b/src/main/java/org/springframework/data/aerospike/config/ReadPolicyFactoryBean.java index 3836ed1d9..6d4ec14a4 100644 --- a/src/main/java/org/springframework/data/aerospike/config/ReadPolicyFactoryBean.java +++ b/src/main/java/org/springframework/data/aerospike/config/ReadPolicyFactoryBean.java @@ -15,6 +15,7 @@ */ package org.springframework.data.aerospike.config; +import com.aerospike.client.policy.Priority; import org.springframework.beans.factory.FactoryBean; import com.aerospike.client.policy.Policy; @@ -72,6 +73,15 @@ public void setSleepBetweenRetries(int sleepBetweenRetries){ this.policy.sleepBetweenRetries = sleepBetweenRetries; } + /** + * Configures the priority of request relative to other transactions. + * Currently, only used for scans. + * @param priority The priority configuration value. + */ + public void setPriority(Priority priority){ + this.policy.priority = priority; + } + /* * (non-Javadoc) * @see org.springframework.beans.factory.FactoryBean#getObject() diff --git a/src/main/java/org/springframework/data/aerospike/config/ScanPolicyFactoryBean.java b/src/main/java/org/springframework/data/aerospike/config/ScanPolicyFactoryBean.java index 97a8621c7..2473aaeaf 100644 --- a/src/main/java/org/springframework/data/aerospike/config/ScanPolicyFactoryBean.java +++ b/src/main/java/org/springframework/data/aerospike/config/ScanPolicyFactoryBean.java @@ -42,7 +42,15 @@ public ScanPolicyFactoryBean() { public void setConcurrentNodes(boolean concurrentNodes){ this.policy.concurrentNodes = concurrentNodes; } - + + /** + * Configures termination of scan if cluster in fluctuating state. + * @param failOnClusterChange The failOnClusterChange configuration value. + */ + public void setFailOnClusterChange(boolean failOnClusterChange){ + this.policy.failOnClusterChange = failOnClusterChange; + } + /** * Indicates if bin data is retrieved. If false, only record digests are retrieved. * @param includeBinData The includeBinData configuration value. @@ -65,6 +73,15 @@ public void setMaxConcurrentNodes(int maxConcurrentNodes){ this.policy.maxConcurrentNodes = maxConcurrentNodes; } + /** + * Configure the percent of data to scan. Valid integer range is 1 to 100. + * Default is 100. + * @param scanPercent The scanPercent configuration value. + */ + public void setScanPercent(int scanPercent){ + this.policy.scanPercent = scanPercent; + } + /* * (non-Javadoc) * @see org.springframework.beans.factory.FactoryBean#getObject()