Filter filter =
Set entries = CacheFactory.getCache(cacheName).entrySet(filter);
The filters' should be constructed optimally and if the queries are spanning 100+ nodes then try using the PartitionedFilter for executing such queries. The Paritition filter limits the scope of another filter to those entries that have keys that belong to the specified partition set. This approach may complicate the client code, but can dramatically reduce the memory footprint used by the requestor.
Another approach to using PartitionedFilter is PartitionedIterator as below
PartitionedIterator iter = new PartitionedIterator(cache, filter, setPartitions,PartitionedIterator.OPT_ENTRIES | PartitionedIterator.OPT_BY_MEMBER);
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry) iter.next();
}
}
No comments:
Post a Comment