diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeCommonDataConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeCommonDataConfiguration.java index 49ee135..a23bacf 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeCommonDataConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeCommonDataConfiguration.java @@ -144,6 +144,7 @@ private AerospikeDataSettings configureDataSettings(AerospikeDataSettings dataSe AerospikeDataProperties aerospikeDataProperties) { dataSettings.setScansEnabled(aerospikeDataProperties.isScansEnabled()); dataSettings.setCreateIndexesOnStartup(aerospikeDataProperties.isCreateIndexesOnStartup()); + dataSettings.setWriteSortedMaps(aerospikeDataProperties.isWriteSortedMaps()); return dataSettings; } } diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataConfiguration.java index 07828f1..6e32cd1 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataConfiguration.java @@ -123,6 +123,7 @@ private AerospikeDataSettings configureDataSettings(AerospikeDataSettings dataSe AerospikeDataProperties aerospikeDataProperties) { dataSettings.setScansEnabled(aerospikeDataProperties.isScansEnabled()); dataSettings.setCreateIndexesOnStartup(aerospikeDataProperties.isCreateIndexesOnStartup()); + dataSettings.setWriteSortedMaps(aerospikeDataProperties.isWriteSortedMaps()); return dataSettings; } } diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataProperties.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataProperties.java index 485cc65..a1974f0 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataProperties.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataProperties.java @@ -90,4 +90,11 @@ public class AerospikeDataProperties { * true - preserve original type if supported */ private boolean keepOriginalKeyTypes = false; + + /** + * Define how Maps and POJOs are written: true - as sorted maps (TreeMaps, default), false - as unsorted (HashMaps) + * Writing unsorted maps (false) degrades performance of Map-related operations and does not allow comparing Maps, + * strongly recommended not to use except during upgrade from older versions of Spring Data Aerospike (if required) + */ + private boolean writeSortedMaps = true; }