Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMWK-630 Add unique bean names for index creators #811

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public AerospikeTemplate aerospikeTemplate(IAerospikeClient aerospikeClient,
AerospikeExceptionTranslator aerospikeExceptionTranslator,
QueryEngine queryEngine, IndexRefresher indexRefresher,
ServerVersionSupport serverVersionSupport,
AerospikeSettings settings) {
AerospikeSettings settings)
{
return new AerospikeTemplate(aerospikeClient, settings.getDataSettings().getNamespace(),
mappingAerospikeConverter, aerospikeMappingContext, aerospikeExceptionTranslator, queryEngine,
indexRefresher, serverVersionSupport);
Expand All @@ -55,7 +56,8 @@ public AerospikeTemplate aerospikeTemplate(IAerospikeClient aerospikeClient,
@Bean(name = "aerospikeQueryEngine")
public QueryEngine queryEngine(IAerospikeClient aerospikeClient,
StatementBuilder statementBuilder,
FilterExpressionsBuilder filterExpressionsBuilder, AerospikeSettings settings) {
FilterExpressionsBuilder filterExpressionsBuilder, AerospikeSettings settings)
{
QueryEngine queryEngine = new QueryEngine(aerospikeClient, statementBuilder, filterExpressionsBuilder,
settings.getDataSettings());
boolean scansEnabled = settings.getDataSettings().isScansEnabled();
Expand All @@ -72,11 +74,12 @@ public QueryEngine queryEngine(IAerospikeClient aerospikeClient,
return queryEngine;
}

@Bean
@Bean(name = "aerospikePersistenceEntityIndexCreator")
public AerospikePersistenceEntityIndexCreator aerospikePersistenceEntityIndexCreator(
ObjectProvider<AerospikeMappingContext> aerospikeMappingContext,
AerospikeIndexResolver aerospikeIndexResolver,
ObjectProvider<AerospikeTemplate> template, AerospikeSettings settings) {
ObjectProvider<AerospikeTemplate> template, AerospikeSettings settings)
{
boolean indexesOnStartup = settings.getDataSettings().isCreateIndexesOnStartup();
log.info("AerospikeDataSettings.indexesOnStartup: {}", indexesOnStartup);
return new AerospikePersistenceEntityIndexCreator(aerospikeMappingContext, indexesOnStartup,
Expand All @@ -85,7 +88,8 @@ public AerospikePersistenceEntityIndexCreator aerospikePersistenceEntityIndexCre

@Bean(name = "aerospikeIndexRefresher")
public IndexRefresher indexRefresher(IAerospikeClient aerospikeClient, IndexesCacheUpdater indexesCacheUpdater,
ServerVersionSupport serverVersionSupport, AerospikeSettings settings) {
ServerVersionSupport serverVersionSupport, AerospikeSettings settings)
{
IndexRefresher refresher = new IndexRefresher(aerospikeClient, aerospikeClient.getInfoPolicyDefault(),
new InternalIndexOperations(new IndexInfoParser()), indexesCacheUpdater, serverVersionSupport);
refresher.refreshIndexes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public ReactiveAerospikeTemplate reactiveAerospikeTemplate(MappingAerospikeConve
ReactorQueryEngine reactorQueryEngine,
ReactorIndexRefresher reactorIndexRefresher,
ServerVersionSupport serverVersionSupport,
AerospikeSettings settings) {
AerospikeSettings settings)
{
return new ReactiveAerospikeTemplate(aerospikeReactorClient, settings.getDataSettings().getNamespace(),
mappingAerospikeConverter, aerospikeMappingContext, aerospikeExceptionTranslator,
reactorQueryEngine, reactorIndexRefresher, serverVersionSupport);
Expand All @@ -65,7 +66,8 @@ public ReactiveAerospikeTemplate reactiveAerospikeTemplate(MappingAerospikeConve
public ReactorQueryEngine reactorQueryEngine(IAerospikeReactorClient aerospikeReactorClient,
StatementBuilder statementBuilder,
FilterExpressionsBuilder filterExpressionsBuilder,
AerospikeSettings settings) {
AerospikeSettings settings)
{
ReactorQueryEngine queryEngine = new ReactorQueryEngine(aerospikeReactorClient, statementBuilder,
filterExpressionsBuilder, settings.getDataSettings());
boolean scansEnabled = settings.getDataSettings().isScansEnabled();
Expand All @@ -85,7 +87,8 @@ public ReactorQueryEngine reactorQueryEngine(IAerospikeReactorClient aerospikeRe
@Bean(name = "reactiveAerospikeIndexRefresher")
public ReactorIndexRefresher reactorIndexRefresher(IAerospikeReactorClient aerospikeReactorClient,
IndexesCacheUpdater indexesCacheUpdater,
ServerVersionSupport serverVersionSupport) {
ServerVersionSupport serverVersionSupport)
{
ReactorIndexRefresher refresher = new ReactorIndexRefresher(aerospikeReactorClient,
aerospikeReactorClient.getInfoPolicyDefault(),
new InternalIndexOperations(new IndexInfoParser()), indexesCacheUpdater, serverVersionSupport);
Expand All @@ -105,11 +108,12 @@ protected ClientPolicy getClientPolicy() {
return clientPolicy;
}

@Bean
public ReactiveAerospikePersistenceEntityIndexCreator aerospikePersistenceEntityIndexCreator(
@Bean(name = "reactiveAerospikePersistenceEntityIndexCreator")
public ReactiveAerospikePersistenceEntityIndexCreator aerospikeReactivePersistenceEntityIndexCreator(
ObjectProvider<AerospikeMappingContext> aerospikeMappingContext,
AerospikeIndexResolver aerospikeIndexResolver,
ObjectProvider<ReactiveAerospikeTemplate> template, AerospikeSettings settings) {
ObjectProvider<ReactiveAerospikeTemplate> template, AerospikeSettings settings)
{
boolean indexesOnStartup = settings.getDataSettings().isCreateIndexesOnStartup();
log.info("AerospikeDataSettings.indexesOnStartup: {}", indexesOnStartup);
return new ReactiveAerospikePersistenceEntityIndexCreator(aerospikeMappingContext,
Expand Down
Loading