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

Improve GemfireCache.clear() to take GemFire Cache and Region type into consideration [DATAGEODE-265] #313

Open
spring-projects-issues opened this issue Nov 4, 2019 · 3 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Nov 4, 2019

John Blum opened DATAGEODE-265 and commented

Currently, when a developer uses Spring's Cache Abstraction with Apache Geode as the "caching provider", to enable caching in his/her @Service components, if the developer includes a @Service method to evict all entries, like so...

@CacheEvict(cacheNames="...", allEntries=true)
public void wipeCaches() {
  logger.info("Wiped all Caches");
  ...
}

SDG's current implementation of Cache.clear() will fail with an UnsupportedOperationException on a PARTITION Region. This is because Map.clear() is not supported on PARTITION Regions.

Additionally, clear() would not work if the Region is a client Region.

This JIRA was created to add more intelligence to SDG's GemfireCache.clear() operation


Reference URL: https://jira.spring.io/browse/SGF-557

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 4, 2019

John Blum commented

A nice alternative would be for Apache Geode to include support for Map.clear() on PARTITION Regions, just like for REPLICATE Regions. Effectively, [o.a.g.c.Region.clear()](https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/Region.html#clear--) could just call [o.a.g.c.Region.removeAll()](https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/Region.html#removeAll-java.util.Collection-) when the Region is PARTITION

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 4, 2019

John Blum commented

See GEODE-788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.