SGF-357 - Optimize SimpleGemfireRepository.deleteAll() by using the new Region.removeAll() operation.

This commit is contained in:
John Blum
2015-04-13 19:31:52 -07:00
parent 8d424eee9b
commit 6a958da6b0
2 changed files with 29 additions and 26 deletions

View File

@@ -31,6 +31,7 @@ import com.gemstone.gemfire.cache.query.SelectResults;
* @see java.io.Serializable
* @see org.springframework.data.gemfire.GemfireTemplate
* @see org.springframework.data.gemfire.repository.GemfireRepository
* @see com.gemstone.gemfire.cache.Cache
* @see com.gemstone.gemfire.cache.Region
*/
public class SimpleGemfireRepository<T, ID extends Serializable> implements GemfireRepository<T, ID> {
@@ -243,10 +244,10 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
return (cacheTransactionManager != null && cacheTransactionManager.exists());
}
/* (non-Javadoc) */
@SuppressWarnings("unchecked")
void doRegionClear(final Region region) {
for (Object key : region.keySet()) {
region.remove(key);
}
region.removeAll(region.keySet());
}
/*