Skip to content

Conversation

davidartplus
Copy link
Collaborator

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.

David Guzman added 2 commits August 25, 2020 16:35
@jijisv
Copy link
Collaborator

jijisv commented Aug 25, 2020

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> {
Copy link
Collaborator

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);
Copy link
Collaborator

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);
Copy link
Collaborator

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..

Copy link
Collaborator Author

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());
Copy link
Collaborator

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(), ...

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, thanks.

Copy link
Member

@johnmcclean johnmcclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jijisv jijisv merged commit 85c07d5 into master Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants