-
Notifications
You must be signed in to change notification settings - Fork 211
Cache cleanup #427
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
Cache cleanup #427
Conversation
if we are changing the plugin name, we should consider changing the package name as well. |
|
||
|
||
@Slf4j | ||
public class TransientElasticacheDataConnection<V> implements DistributedCacheManager<V> { | ||
public class ElasticacheConnection<K, V> implements DistributedCache<K, V> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MemcachedCacheImpl
may be a better name IMO.
try { | ||
log.info("Creating Memcached Data connection for elasticache cluster: {}", hostname); | ||
return new TransientElasticacheDataConnection(createMemcachedClient(), retryAfterSecs, maxRetries); | ||
return new ElasticacheConnection(createMemcachedClient(), retryAfterSecs, maxRetries); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DistributedCache
and its impl support generics and we are loosing the type info here..
@@ -9,6 +9,6 @@ | |||
|
|||
@Override | |||
public Set<Class> springClasses() { | |||
return SetX.of(ConfigureElasticache.class); | |||
return SetX.of(ElasticacheConfig.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we will have to add DistributedCacheFactory.class
also here..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
public <K, V> DistributedCache<K, V> create() { | ||
try { | ||
log.info("Creating Memcached Data connection for elasticache cluster: {}", config.getHostname()); | ||
return new MemcachedCacheImpl(createMemcachedClient(), config.getRetryAfterSecs(), config.getMaxRetries()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess
return new MemcachedCacheImpl<K, V>(createMemcachedClient(), ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the compiler can deduce the types <K, V> from the return type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
besides, the IDE suggests it's not relevant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.