From 69db9587540a11dfeccff0f5ff50fb67ead0756c Mon Sep 17 00:00:00 2001 From: Eugene R Date: Mon, 14 Aug 2023 12:10:10 +0300 Subject: [PATCH] FMWK-222 Add the sendKey property to all Policy classes (#206) --- .../aerospike/AerospikeAutoConfiguration.java | 2 +- .../autoconfigure/aerospike/AerospikeProperties.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeAutoConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeAutoConfiguration.java index ab34ed1..23528e3 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeAutoConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeAutoConfiguration.java @@ -108,7 +108,6 @@ private WritePolicy setupWritePolicy(AerospikeProperties properties) { WritePolicy policy = new WritePolicy(); setGeneralPolicyProperties(policy, writePolicyDefault); whenPresent(writePolicyDefault.durableDelete, p -> policy.durableDelete = p); - whenPresent(writePolicyDefault.sendKey, p -> policy.sendKey = p); return policy; } @@ -147,6 +146,7 @@ private void setGeneralPolicyProperties(Policy policy, AerospikeProperties.Polic whenPresent(policyDefault.timeoutDelay, p -> policy.timeoutDelay = (int) p.toMillis()); whenPresent(policyDefault.maxRetries, p -> policy.maxRetries = p); whenPresent(policyDefault.sleepBetweenRetries, p -> policy.sleepBetweenRetries = (int) p.toMillis()); + whenPresent(policyDefault.sendKey, p -> policy.sendKey = p); } private void whenPresent(T param, Consumer consumer) { diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeProperties.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeProperties.java index 3d1be9c..10ff6c1 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeProperties.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeProperties.java @@ -146,6 +146,11 @@ public abstract static class PolicyDefault { * Time to sleep between retries. */ public Duration sleepBetweenRetries; + + /** + * If the key is sent on a write, the key will be stored with the record on the server. + */ + public Boolean sendKey; } /** @@ -191,11 +196,6 @@ public static class ReadPolicyDefault extends PolicyDefault { @Data public static class WritePolicyDefault extends PolicyDefault { - /** - * If the key is sent on a write, the key will be stored with the record on the server. - */ - public Boolean sendKey; - /** * If the transaction results in a record deletion, leave a tombstone for the record. */ @@ -212,10 +212,12 @@ public static class BatchPolicyDefault extends PolicyDefault { * Number of concurrent synchronous batch request threads to server nodes. */ public Integer maxConcurrentThreads; + /** * Allow batch to be processed immediately in the server's receiving thread. */ public Boolean allowInline; + /** * Send set name for every key in the batch. */