diff --git a/README.adoc b/README.adoc index c9697be28..ac43e1f12 100644 --- a/README.adoc +++ b/README.adoc @@ -56,6 +56,8 @@ Data Aerospike - Projections] [width="100%",cols="<24%,<14%,<18%,<26%,<18%",options="header",] |=== |Spring Data Aerospike |Spring Boot |Aerospike Client |Aerospike Reactor Client |Aerospike Server +|4.8.x |3.3.x |7.2.x |7.1.x |5.2.x.x + + |4.7.x |3.2.x |7.2.x |7.1.x |5.2.x.x + |4.6.x |3.2.x |7.2.x |7.1.x |5.2.x.x + diff --git a/pom.xml b/pom.xml index d527d9dc5..390efdbf8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.aerospike spring-data-aerospike - 4.7.1 + 4.8.0 Spring Data Aerospike Aerospike Inc. @@ -16,7 +16,7 @@ org.springframework.data.build spring-data-parent - 3.2.4 + 3.3.0 @@ -24,23 +24,23 @@ ${java.version} ${java.version} UTF-8 - 3.2.4 - 3.2.4 - 3.2.3 - 3.2.3 + 3.3.0 + 3.3.0 + 3.3.0 + 3.3.0 4.1.1 3.3.0 1.6 7.2.1 7.1.0 3.6.1 - 3.1.5 + 3.1.6 2.12.7 - 1.18.30 + 1.18.32 4.2.1 - 1.5.3 + 1.5.6 8.0.1.Final - 4.1.107.Final + 4.1.110.Final diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc index f9dfeecf9..4fdd4e915 100644 --- a/src/main/asciidoc/index.adoc +++ b/src/main/asciidoc/index.adoc @@ -1,6 +1,6 @@ = Spring Data Aerospike - Documentation :doctype: book -:revnumber: 4.7.1 +:revnumber: 4.8.0 :revdate: {localdate} :toc: :toc-placement!: diff --git a/src/main/asciidoc/reference/configuration.adoc b/src/main/asciidoc/reference/configuration.adoc index 18be5b007..bf0d7b8db 100644 --- a/src/main/asciidoc/reference/configuration.adoc +++ b/src/main/asciidoc/reference/configuration.adoc @@ -396,3 +396,34 @@ class ApplicationConfig extends AbstractAerospikeDataConfiguration { *Default*: `false` (store keys only as `String`). +[[configuration.write-sorted-maps]] +=== writeSortedMaps + +[source,properties] +---- +# application.properties +spring-data-aerospike.data.writeSortedMaps=true +---- + +Define how Maps and POJOs are written: `true` - as sorted maps (`TreeMap`, default), `false` - as unsorted (`HashMap`). + +Writing as unsorted maps (`false`) degrades performance of Map-related operations, to be used only during upgrade from older versions of Spring Data Aerospike. + +NOTE: Another way of defining the parameter is overriding the `configureDataSettings()` method. +It has precedence over reading from application.properties. Here is an example: + +[source,java] +---- +// overriding method +@EnableAerospikeRepositories(basePackageClasses = TestRepository.class) +class ApplicationConfig extends AbstractAerospikeDataConfiguration { + + + @Override + public void configureDataSettings(AerospikeDataSettings aerospikeDataSettings) { + aerospikeDataSettings.setWriteSortedMaps(true); + } +} +---- + +*Default*: `true` (write Maps and POJOs as sorted maps). diff --git a/src/main/java/org/springframework/data/aerospike/config/AerospikeDataSettings.java b/src/main/java/org/springframework/data/aerospike/config/AerospikeDataSettings.java index b13d70b39..36976a70c 100644 --- a/src/main/java/org/springframework/data/aerospike/config/AerospikeDataSettings.java +++ b/src/main/java/org/springframework/data/aerospike/config/AerospikeDataSettings.java @@ -37,6 +37,7 @@ public class AerospikeDataSettings { // Define how @Id fields (primary keys) and Map keys are stored: false - always as String, // true - preserve original type if supported boolean keepOriginalKeyTypes = false; - // Define how Maps are written: true - as TreeMaps (default), false - as HashMaps + // Define how Maps and POJOs are written: true - as sorted maps (TreeMaps, default), false - as unsorted (HashMaps) + // Writing as unsorted maps (false) degrades performance of Map-related operations, to be used only during upgrade boolean writeSortedMaps = true; } diff --git a/src/main/java/org/springframework/data/aerospike/repository/query/CriteriaDefinition.java b/src/main/java/org/springframework/data/aerospike/repository/query/CriteriaDefinition.java index 03c1a66a5..480402e45 100644 --- a/src/main/java/org/springframework/data/aerospike/repository/query/CriteriaDefinition.java +++ b/src/main/java/org/springframework/data/aerospike/repository/query/CriteriaDefinition.java @@ -45,11 +45,29 @@ enum AerospikeNullQueryCriterion { } enum AerospikeMetadata { - SINCE_UPDATE_TIME, // Exp.sinceUpdate(), milliseconds - LAST_UPDATE_TIME, // Exp.lastUpdate(), nanoseconds since epoch - VOID_TIME, // Exp.voidTime(), nanoseconds since epoch - TTL, // Exp.ttl(), integer seconds - RECORD_SIZE_ON_DISK, // Exp.deviceSize(), bytes - RECORD_SIZE_IN_MEMORY // Exp.memorySize(), bytes + /** + * Exp.sinceUpdate(), milliseconds + */ + SINCE_UPDATE_TIME, + /** + * Exp.lastUpdate(), nanoseconds since epoch + */ + LAST_UPDATE_TIME, + /** + * Exp.voidTime(), nanoseconds since epoch + */ + VOID_TIME, + /** + * Exp.ttl(), integer seconds + */ + TTL, + /** + * Exp.recordSize() (Exp.deviceSize() for Server ver. < 7.0), bytes + */ + RECORD_SIZE_ON_DISK, + /** + * Exp.recordSize() (Exp.memorySize() for Server ver. < 7.0), bytes + */ + RECORD_SIZE_IN_MEMORY } }