Skip to content

Commit

Permalink
update configuration due to upgrade to Spring Data Aerospike 4.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr committed Mar 19, 2024
1 parent 913364d commit ce8d635
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ public IndexesCacheHolder aerospikeIndexCache() {
public MappingAerospikeConverter mappingAerospikeConverter(AerospikeMappingContext aerospikeMappingContext,
AerospikeTypeAliasAccessor aerospikeTypeAliasAccessor,
AerospikeCustomConversions aerospikeCustomConversions,
AerospikeDataProperties aerospikeDataProperties) {
AerospikeDataProperties aerospikeDataProperties,
AerospikeDataSettings dataSettings) {
return new MappingAerospikeConverter(aerospikeMappingContext, aerospikeCustomConversions,
aerospikeTypeAliasAccessor, aerospikeDataSettings(aerospikeDataProperties));
aerospikeTypeAliasAccessor, aerospikeDataSettings(aerospikeDataProperties, dataSettings));
}

@Bean(name = "aerospikeTypeAliasAccessor")
Expand Down Expand Up @@ -98,16 +99,15 @@ public AerospikeExceptionTranslator aerospikeExceptionTranslator() {
return new DefaultAerospikeExceptionTranslator();
}

private AerospikeDataSettings aerospikeDataSettings(AerospikeDataProperties aerospikeDataProperties) {
AerospikeDataSettings.AerospikeDataSettingsBuilder builder = AerospikeDataSettings.builder();
configureDataSettings(builder, aerospikeDataProperties);
return builder.build();
private AerospikeDataSettings aerospikeDataSettings(AerospikeDataProperties aerospikeDataProperties,
AerospikeDataSettings dataSettings) {
return configureDataSettings(dataSettings, aerospikeDataProperties);
}

private void configureDataSettings(AerospikeDataSettings.AerospikeDataSettingsBuilder builder,
AerospikeDataProperties aerospikeDataProperties) {
builder.scansEnabled(aerospikeDataProperties.isScansEnabled());
builder.sendKey(aerospikeDataProperties.isSendKey());
builder.createIndexesOnStartup(aerospikeDataProperties.isCreateIndexesOnStartup());
private AerospikeDataSettings configureDataSettings(AerospikeDataSettings dataSettings,
AerospikeDataProperties aerospikeDataProperties) {
dataSettings.setScansEnabled(aerospikeDataProperties.isScansEnabled());
dataSettings.setCreateIndexesOnStartup(aerospikeDataProperties.isCreateIndexesOnStartup());
return dataSettings;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ public QueryEngine aerospikeQueryEngine(IAerospikeClient aerospikeClient,
@ConditionalOnMissingBean(name = "aerospikeIndexRefresher")
public IndexRefresher indexRefresher(IAerospikeClient aerospikeClient, IndexesCacheUpdater indexesCacheUpdater,
ServerVersionSupport serverVersionSupport,
AerospikeDataProperties aerospikeDataProperties) {
AerospikeDataProperties aerospikeDataProperties,
AerospikeDataSettings dataSettings) {
IndexRefresher refresher = new IndexRefresher(aerospikeClient, aerospikeClient.getInfoPolicyDefault(),
new InternalIndexOperations(new IndexInfoParser()), indexesCacheUpdater, serverVersionSupport);
refresher.refreshIndexes();
int refreshFrequency = aerospikeDataSettings(aerospikeDataProperties).getIndexCacheRefreshSeconds();
int refreshFrequency = aerospikeDataSettings(aerospikeDataProperties, dataSettings).getIndexCacheRefreshSeconds();
processCacheRefreshFrequency(refreshFrequency, refresher);
return refresher;
}
Expand All @@ -111,16 +112,15 @@ public AerospikePersistenceEntityIndexCreator aerospikePersistenceEntityIndexCre
aerospikeDataProperties.isCreateIndexesOnStartup(), aerospikeIndexResolver, template);
}

private AerospikeDataSettings aerospikeDataSettings(AerospikeDataProperties aerospikeDataProperties) {
AerospikeDataSettings.AerospikeDataSettingsBuilder builder = AerospikeDataSettings.builder();
configureDataSettings(builder, aerospikeDataProperties);
return builder.build();
private AerospikeDataSettings aerospikeDataSettings(AerospikeDataProperties aerospikeDataProperties,
AerospikeDataSettings dataSettings) {
return configureDataSettings(dataSettings, aerospikeDataProperties);
}

private void configureDataSettings(AerospikeDataSettings.AerospikeDataSettingsBuilder builder,
AerospikeDataProperties aerospikeDataProperties) {
builder.scansEnabled(aerospikeDataProperties.isScansEnabled());
builder.sendKey(aerospikeDataProperties.isSendKey());
builder.createIndexesOnStartup(aerospikeDataProperties.isCreateIndexesOnStartup());
private AerospikeDataSettings configureDataSettings(AerospikeDataSettings dataSettings,
AerospikeDataProperties aerospikeDataProperties) {
dataSettings.setScansEnabled(aerospikeDataProperties.isScansEnabled());
dataSettings.setCreateIndexesOnStartup(aerospikeDataProperties.isCreateIndexesOnStartup());
return dataSettings;
}
}

0 comments on commit ce8d635

Please sign in to comment.