[infinispan-dev] Map/Reduce or other batch processing on CacheLoader stored entries
Sanne Grinovero
sanne at infinispan.org
Fri May 25 06:31:32 EDT 2012
On 25 May 2012 10:57, Manik Surtani <manik at jboss.org> wrote:
> #processEntriesWith(Processor p)
>
> Processor extends Lifecycle { // Lifecycle for start() and stop() methods…
> void process(CacheEntry e);
> void process(Collection<CacheEntry> e);
> boolean processMoreEntries();
> }
why the LifeCycle start/stop ?
I expect to use it as a one-off, not as something which is
"permanently hooked": looks like you' re thinking about a different
problem?
The use case I'm thinkin of is when we need to iterate on all entries
in the cachestore, such as :
- Map/Reduce
- evaluating the average value of some attribute
- word counting
- MassIndexer
In all the use cases I'm having in mind, you want to process all
entries, and only once.
So #processMoreEntries would be redundant, and I think we should
choose just one between CacheEntry or Collection<CacheEntry>.. let's
go with the simple CacheEntry ?
Should be able to avoid creation of short lived collections, and when
passing collections one would likely need to iterate on each element
anyway to route the invocation so some internal process(CacheEntry e);
-- Sanne
More information about the infinispan-dev
mailing list