Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr committed Jun 20, 2024
1 parent ac3fff2 commit ea4a654
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/asciidoc/reference/caching.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ public class AerospikeConfiguration {
public AerospikeClient aerospikeClient() {
ClientPolicy clientPolicy = new ClientPolicy();
clientPolicy.failIfNotConnected = true;
return new AerospikeClient(clientPolicy, aerospikeConfigurationProperties.getHost(), aerospikeConfigurationProperties.getPort());
return new AerospikeClient(clientPolicy, aerospikeConfigurationProperties.getHost(),
aerospikeConfigurationProperties.getPort());
}
@Bean
public AerospikeCacheManager cacheManager(AerospikeClient aerospikeClient) {
public CacheManager cacheManager(IAerospikeClient aerospikeClient,
MappingAerospikeConverter aerospikeConverter,
AerospikeCacheKeyProcessor cacheKeyProcessor) {
AerospikeCacheConfiguration defaultConfiguration = new AerospikeCacheConfiguration("test");
return new AerospikeCacheManager(aerospikeClient, mappingAerospikeConverter, defaultConfiguration);
return new AerospikeCacheManager(aerospikeClient, mappingAerospikeConverter, defaultConfiguration,
cacheKeyProcessor);
}
}
----
Expand All @@ -96,7 +100,7 @@ The heart of the cache layer, to define an AerospikeCacheManager you need:
. aerospikeConverter (MappingAerospikeConverter).
. defaultCacheConfiguration (AerospikeCacheConfiguration), a default cache configuration that applies when creating new caches.
Cache configuration contains a namespace, a set (null by default meaning write directly to the namespace w/o specifying a set) and an expirationInSeconds (AKA TTL, default is 0 meaning use Aerospike server’s default).
. Optional: initalPerCacheConfiguration (Map<String, AerospikeCacheConfiguration>), You can also specify a map of cache names and matching configuration, it will create the caches with the given matching configuration at the application startup.
. Optional: initialPerCacheConfiguration (Map<String, AerospikeCacheConfiguration>), You can also specify a map of cache names and matching configuration, it will create the caches with the given matching configuration at the application startup.

NOTE: A cache name is only a link to the cache configuration.

Expand Down

0 comments on commit ea4a654

Please sign in to comment.