Skip to content

Commit

Permalink
FMWK-452 Update dependencies and version (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr committed May 29, 2024
1 parent 3ff86af commit 1a43ab6
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 34 deletions.
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down
22 changes: 11 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.aerospike</groupId>
<artifactId>spring-data-aerospike</artifactId>
<version>4.7.1</version>
<version>4.8.0</version>
<name>Spring Data Aerospike</name>
<organization>
<name>Aerospike Inc.</name>
Expand All @@ -16,31 +16,31 @@
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>3.2.4</version>
<version>3.3.0</version>
</parent>

<properties>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springdata.commons>3.2.4</springdata.commons>
<springdata.keyvalue>3.2.4</springdata.keyvalue>
<springdata.spring-boot>3.2.3</springdata.spring-boot>
<spring-boot-starter-test>3.2.3</spring-boot-starter-test>
<spring-cloud-starter-bootstrap>4.1.1</spring-cloud-starter-bootstrap>
<springdata.commons>3.3.0</springdata.commons>
<springdata.keyvalue>3.3.0</springdata.keyvalue>
<springdata.spring-boot>3.3.0</springdata.spring-boot>
<spring-boot-starter-test>3.3.0</spring-boot-starter-test>
<spring-cloud-starter-bootstrap>4.1.2</spring-cloud-starter-bootstrap>
<maven.javadoc.plugin>3.3.0</maven.javadoc.plugin>
<maven.gpg.plugin>1.6</maven.gpg.plugin>
<aerospike-client>7.2.1</aerospike-client>
<aerospike-reactor-client>7.1.0</aerospike-reactor-client>
<reactor-test>3.6.1</reactor-test>
<embedded-aerospike>3.1.5</embedded-aerospike>
<embedded-aerospike>3.1.6</embedded-aerospike>
<jodatime>2.12.7</jodatime>
<lombok>1.18.30</lombok>
<lombok>1.18.32</lombok>
<awaitility>4.2.1</awaitility>
<logback.test>1.5.3</logback.test>
<logback.test>1.5.6</logback.test>
<hibernate.validator>8.0.1.Final</hibernate.validator>
<netty.version>4.1.107.Final</netty.version>
<netty.version>4.1.110.Final</netty.version>
</properties>

<licenses>
Expand Down
2 changes: 1 addition & 1 deletion src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Spring Data Aerospike - Documentation
:doctype: book
:revnumber: 4.7.1
:revnumber: 4.8.0
:revdate: {localdate}
:toc:
:toc-placement!:
Expand Down
39 changes: 32 additions & 7 deletions src/main/asciidoc/reference/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ It has precedence over reading from application.properties. Here is an example:
@EnableAerospikeRepositories(basePackageClasses = TestRepository.class)
class ApplicationConfig extends AbstractAerospikeDataConfiguration {
@Override
public void configureDataSettings(AerospikeDataSettings aerospikeDataSettings) {
aerospikeDataSettings.setScansEnabled(false);
Expand Down Expand Up @@ -210,7 +209,6 @@ It has precedence over reading from application.properties. Here is an example:
@EnableAerospikeRepositories(basePackageClasses = TestRepository.class)
class ApplicationConfig extends AbstractAerospikeDataConfiguration {
@Override
public void configureDataSettings(AerospikeDataSettings aerospikeDataSettings) {
aerospikeDataSettings.setCreateIndexesOnStartup(true);
Expand Down Expand Up @@ -240,7 +238,6 @@ It has precedence over reading from application.properties. Here is an example:
@EnableAerospikeRepositories(basePackageClasses = TestRepository.class)
class ApplicationConfig extends AbstractAerospikeDataConfiguration {
@Override
public void configureDataSettings(AerospikeDataSettings aerospikeDataSettings) {
aerospikeDataSettings.setIndexCacheRefreshSeconds(3600);
Expand Down Expand Up @@ -270,7 +267,6 @@ It has precedence over reading from application.properties. Here is an example:
@EnableAerospikeRepositories(basePackageClasses = TestRepository.class)
class ApplicationConfig extends AbstractAerospikeDataConfiguration {
@Override
public void configureDataSettings(AerospikeDataSettings aerospikeDataSettings) {
aerospikeDataSettings.setServerVersionRefreshSeconds(3600);
Expand Down Expand Up @@ -300,7 +296,6 @@ It has precedence over reading from application.properties. Here is an example:
@EnableAerospikeRepositories(basePackageClasses = TestRepository.class)
class ApplicationConfig extends AbstractAerospikeDataConfiguration {
@Override
public void configureDataSettings(AerospikeDataSettings aerospikeDataSettings) {
aerospikeDataSettings.setQueryMaxRecords(10000L);
Expand Down Expand Up @@ -330,7 +325,6 @@ It has precedence over reading from application.properties. Here is an example:
@EnableAerospikeRepositories(basePackageClasses = TestRepository.class)
class ApplicationConfig extends AbstractAerospikeDataConfiguration {
@Override
public void configureDataSettings(AerospikeDataSettings aerospikeDataSettings) {
aerospikeDataSettings.setBatchWriteSize(100);
Expand Down Expand Up @@ -386,7 +380,6 @@ It has precedence over reading from application.properties. Here is an example:
@EnableAerospikeRepositories(basePackageClasses = TestRepository.class)
class ApplicationConfig extends AbstractAerospikeDataConfiguration {
@Override
public void configureDataSettings(AerospikeDataSettings aerospikeDataSettings) {
aerospikeDataSettings.setKeepOriginalKeyTypes(false);
Expand All @@ -396,3 +389,35 @@ 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 and does not allow comparing Maps,
so it is strongly recommended to change the default value only if required 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).
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public QueryEngine queryEngine(IAerospikeClient aerospikeClient,
QueryEngine queryEngine = new QueryEngine(aerospikeClient, statementBuilder, filterExpressionsBuilder,
settings.getDataSettings());
boolean scansEnabled = settings.getDataSettings().isScansEnabled();
log.debug("AerospikeDataSettings.scansEnabled: {}", scansEnabled);
log.info("AerospikeDataSettings.scansEnabled: {}", scansEnabled);
queryEngine.setScansEnabled(scansEnabled);
long queryMaxRecords = settings.getDataSettings().getQueryMaxRecords();
log.debug("AerospikeDataSettings.queryMaxRecords: {}", queryMaxRecords);
log.info("AerospikeDataSettings.queryMaxRecords: {}", queryMaxRecords);
queryEngine.setQueryMaxRecords(queryMaxRecords);
if (!settings.getDataSettings().isWriteSortedMaps()) {
log.info("AerospikeDataSettings.writeSortedMaps is set to false, " +
"Maps and POJOs will be written as unsorted Maps (degrades performance of Map-related operations ," +
"Maps and POJOs will be written as unsorted Maps (degrades performance of Map-related operations," +
" does not allow comparing Maps)");
}
return queryEngine;
Expand All @@ -78,7 +78,7 @@ public AerospikePersistenceEntityIndexCreator aerospikePersistenceEntityIndexCre
AerospikeIndexResolver aerospikeIndexResolver,
ObjectProvider<AerospikeTemplate> template, AerospikeSettings settings) {
boolean indexesOnStartup = settings.getDataSettings().isCreateIndexesOnStartup();
log.debug("AerospikeDataSettings.indexesOnStartup: {}", indexesOnStartup);
log.info("AerospikeDataSettings.indexesOnStartup: {}", indexesOnStartup);
return new AerospikePersistenceEntityIndexCreator(aerospikeMappingContext, indexesOnStartup,
aerospikeIndexResolver, template);
}
Expand All @@ -91,7 +91,7 @@ public IndexRefresher indexRefresher(IAerospikeClient aerospikeClient, IndexesCa
refresher.refreshIndexes();
int refreshFrequency = settings.getDataSettings().getIndexCacheRefreshSeconds();
processCacheRefreshFrequency(refreshFrequency, refresher);
log.debug("AerospikeDataSettings.indexCacheRefreshSeconds: {}", refreshFrequency);
log.info("AerospikeDataSettings.indexCacheRefreshSeconds: {}", refreshFrequency);
return refresher;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@ public ReactorQueryEngine reactorQueryEngine(IAerospikeReactorClient aerospikeRe
filterExpressionsBuilder, settings.getDataSettings());
boolean scansEnabled = settings.getDataSettings().isScansEnabled();
queryEngine.setScansEnabled(scansEnabled);
log.debug("AerospikeDataSettings.scansEnabled: {}", scansEnabled);
log.info("AerospikeDataSettings.scansEnabled: {}", scansEnabled);
long queryMaxRecords = settings.getDataSettings().getQueryMaxRecords();
log.debug("AerospikeDataSettings.queryMaxRecords: {}", queryMaxRecords);
log.info("AerospikeDataSettings.queryMaxRecords: {}", queryMaxRecords);
queryEngine.setQueryMaxRecords(queryMaxRecords);
if (!settings.getDataSettings().isWriteSortedMaps()) {
log.info("AerospikeDataSettings.writeSortedMaps is set to false, " +
"Maps and POJOs will be written as unsorted Maps (degrades performance of Map-related operations," +
" does not allow comparing Maps)");
}
return queryEngine;
}

Expand Down Expand Up @@ -110,7 +115,7 @@ public ReactiveAerospikePersistenceEntityIndexCreator aerospikePersistenceEntity
AerospikeIndexResolver aerospikeIndexResolver,
ObjectProvider<ReactiveAerospikeTemplate> template, AerospikeSettings settings) {
boolean indexesOnStartup = settings.getDataSettings().isCreateIndexesOnStartup();
log.debug("AerospikeDataSettings.indexesOnStartup: {}", indexesOnStartup);
log.info("AerospikeDataSettings.indexesOnStartup: {}", indexesOnStartup);
return new ReactiveAerospikePersistenceEntityIndexCreator(aerospikeMappingContext,
indexesOnStartup, aerospikeIndexResolver, template);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ 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 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)
boolean writeSortedMaps = true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 1a43ab6

Please sign in to comment.