remove multiple entries from cache
778561Jul 26 2010 — edited Jul 27 2010Hi,
Is there an efficient way to remove multiple (potentially many) entries from the cache.
Currently i am doing it the way as the code shows. But this sounds to be slow.
Is there a way to remove entries from the coherence map without bring back all the keys and then issue cache.remove() for each key from the client?
KeyExtractor extractor=new KeyExtractor("getSomeAttribute");
Filter filter = new EqualsFilter(extractor, attributeValue);
Set keyCol = cache_.keySet(filter);
Iterator iter = keyCol.iterator();
while (iter.hasNext()) {
Object item = iter.next();
cache_.remove(item);
}
Appreciate your help.
Thanks in advance.