Skip to content

Commit

Permalink
Use IAerospikeReactorClient where possible instead of AerospikeReacto…
Browse files Browse the repository at this point in the history
…rClient (#477)

Co-authored-by: Eugene R <reugpro@gmail.com>
  • Loading branch information
echatman-ias and reugn authored Jan 30, 2023
1 parent 07094ef commit 7ac1734
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ public class ReactiveRepositoryExample {
@Autowired
ReactiveAerospikeOperations aerospikeOperations;
@Autowired
AerospikeReactorClient client;
IAerospikeReactorClient client;
public RepositoryExample(ApplicationContext ctx) {
aerospikeOperations = ctx.getBean(ReactiveAerospikeTemplate.class);
repository = (ReactivePersonRepository) ctx.getBean("reactivePersonRepository");
client = ctx.getBean(AerospikeReactorClient.class);
client = ctx.getBean(IAerospikeReactorClient.class);
}
protected void setUp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.aerospike.client.async.EventLoops;
import com.aerospike.client.policy.ClientPolicy;
import com.aerospike.client.reactor.AerospikeReactorClient;
import com.aerospike.client.reactor.IAerospikeReactorClient;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -49,14 +50,14 @@ public abstract class AbstractReactiveAerospikeDataConfiguration extends Aerospi
public ReactiveAerospikeTemplate reactiveAerospikeTemplate(MappingAerospikeConverter mappingAerospikeConverter,
AerospikeMappingContext aerospikeMappingContext,
AerospikeExceptionTranslator aerospikeExceptionTranslator,
AerospikeReactorClient aerospikeReactorClient,
IAerospikeReactorClient aerospikeReactorClient,
ReactorQueryEngine reactorQueryEngine, ReactorIndexRefresher reactorIndexRefresher) {
return new ReactiveAerospikeTemplate(aerospikeReactorClient, nameSpace(), mappingAerospikeConverter, aerospikeMappingContext,
aerospikeExceptionTranslator, reactorQueryEngine, reactorIndexRefresher);
}

@Bean(name = "reactiveAerospikeQueryEngine")
public ReactorQueryEngine reactorQueryEngine(AerospikeReactorClient aerospikeReactorClient,
public ReactorQueryEngine reactorQueryEngine(IAerospikeReactorClient aerospikeReactorClient,
StatementBuilder statementBuilder,
FilterExpressionsBuilder filterExpressionsBuilder) {
ReactorQueryEngine queryEngine = new ReactorQueryEngine(aerospikeReactorClient, statementBuilder, filterExpressionsBuilder, aerospikeReactorClient.getQueryPolicyDefault());
Expand All @@ -65,15 +66,15 @@ public ReactorQueryEngine reactorQueryEngine(AerospikeReactorClient aerospikeRea
}

@Bean(name = "reactiveAerospikeIndexRefresher")
public ReactorIndexRefresher reactorIndexRefresher(AerospikeReactorClient aerospikeReactorClient, IndexesCacheUpdater indexesCacheUpdater) {
public ReactorIndexRefresher reactorIndexRefresher(IAerospikeReactorClient aerospikeReactorClient, IndexesCacheUpdater indexesCacheUpdater) {
ReactorIndexRefresher refresher = new ReactorIndexRefresher(aerospikeReactorClient, aerospikeReactorClient.getInfoPolicyDefault(),
new InternalIndexOperations(new IndexInfoParser()), indexesCacheUpdater);
refresher.refreshIndexes().block();
return refresher;
}

@Bean(name = "aerospikeReactorClient")
public AerospikeReactorClient aerospikeReactorClient(IAerospikeClient aerospikeClient) {
public IAerospikeReactorClient aerospikeReactorClient(IAerospikeClient aerospikeClient) {
return new AerospikeReactorClient(aerospikeClient);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.aerospike.client.query.IndexCollectionType;
import com.aerospike.client.query.IndexType;
import com.aerospike.client.query.KeyRecord;
import com.aerospike.client.reactor.AerospikeReactorClient;
import com.aerospike.client.reactor.IAerospikeReactorClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.aerospike.convert.AerospikeWriteData;
Expand Down Expand Up @@ -63,11 +62,11 @@
@Slf4j
public class ReactiveAerospikeTemplate extends BaseAerospikeTemplate implements ReactiveAerospikeOperations {

private final AerospikeReactorClient reactorClient;
private final IAerospikeReactorClient reactorClient;
private final ReactorQueryEngine queryEngine;
private final ReactorIndexRefresher reactorIndexRefresher;

public ReactiveAerospikeTemplate(AerospikeReactorClient reactorClient,
public ReactiveAerospikeTemplate(IAerospikeReactorClient reactorClient,
String namespace,
MappingAerospikeConverter converter,
AerospikeMappingContext mappingContext,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.springframework.data.aerospike;

import com.aerospike.client.reactor.AerospikeReactorClient;
import com.aerospike.client.reactor.IAerospikeReactorClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.aerospike.config.CommonTestConfig;
Expand All @@ -22,7 +22,7 @@ public abstract class BaseReactiveIntegrationTests extends BaseIntegrationTests
@Autowired
protected ReactiveAerospikeTemplate reactiveTemplate;
@Autowired
protected AerospikeReactorClient reactorClient;
protected IAerospikeReactorClient reactorClient;

protected <T> T findById(Serializable id, Class<T> type) {
return reactiveTemplate.findById(id, type).block();
Expand Down

0 comments on commit 7ac1734

Please sign in to comment.