<div dir="ltr"><div><div><div><div><div>Hi Etienne<br><br></div>I was going to suggest using a combiner - the combiner would process the mapper results from just one node, so you should need at most double the memory on that node. I guess we could reduce the memory requirements even more if the combiner could run concurrently with the mapper... Vladimir, does it sound like a reasonable feature request?<br>

<br></div>I&#39;m afraid in your situation using a cache store wouldn&#39;t help, as the intermediate values for the same key are stored as a list in a single entry. So if all cars are red, there would be just one intermediate key in the intermediate cache, and there would be nothing to evict to the cache store. Vladimir, do you think we could somehow &quot;chunk&quot; the intermediary values into multiple entries grouped by the intermediary key, to support this scenario?<br>

<br></div>For reference, though, a limited version of what you&#39;re asking for is already available. You can change the configuration of the intermediary cache by defining a &quot;__tmpMapReduce&quot; cache in your configuration. That configuration will be used for all M/R tasks, whether they use the shared intermediate cache or they create their own.<br>

<br></div>Cheers<br></div>Dan<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 10:18 AM, Etienne Riviere <span dir="ltr">&lt;<a href="mailto:etienne.riviere@unine.ch" target="_blank">etienne.riviere@unine.ch</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Radim,<br>
<br>
I might misunderstand your suggestion but many M/R jobs actually require to run the two phases one after the other, and henceforth to store the intermediate results somewhere. While some may slightly reduce intermediate memory usage by using a combiner function (e.g., the word-count example), I don&rsquo;t see how we can avoid intermediate storage altogether.<br>


<br>
Thanks,<br>
Etienne (leads project &mdash; as Evangelos who initiated the thread)<br>
<div class="HOEnZb"><div class="h5"><br>
On 17 Feb 2014, at 08:48, Radim Vansa &lt;<a href="mailto:rvansa@redhat.com">rvansa@redhat.com</a>&gt; wrote:<br>
<br>
&gt; I think that the intermediate cache is not required at all. The M/R<br>
&gt; algorithm itself can (and should!) run with memory occupied by the<br>
&gt; result of reduction. The current implementation with Map first and<br>
&gt; Reduce after that will always have these problems, using a cache for<br>
&gt; temporary caching the result is only a workaround.<br>
&gt;<br>
&gt; The only situation when temporary cache could be useful is when the<br>
&gt; result grows linearly (or close to that or even more) with the amount of<br>
&gt; reduced entries. This would be the case for groupBy producing Map&lt;Color,<br>
&gt; List&lt;Entry&gt;&gt; from all entries in cache. Then the task does not scale and<br>
&gt; should be redesigned anyway, but flushing the results into cache backed<br>
&gt; by cache store could help.<br>
&gt;<br>
&gt; Radim<br>
&gt;<br>
&gt; On 02/14/2014 04:54 PM, Vladimir Blagojevic wrote:<br>
&gt;&gt; Tristan,<br>
&gt;&gt;<br>
&gt;&gt; Actually they are not addressed in this pull request but the feature<br>
&gt;&gt; where custom output cache is used instead of results being returned is<br>
&gt;&gt; next in the implementation pipeline.<br>
&gt;&gt;<br>
&gt;&gt; Evangelos, indeed, depending on a reducer function all intermediate<br>
&gt;&gt; KOut/VOut pairs might be moved to a single node. How would custom cache<br>
&gt;&gt; help in this case?<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt; Vladimir<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 2/14/2014, 10:16 AM, Tristan Tarrant wrote:<br>
&gt;&gt;&gt; Hi Evangelos,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; you might be interested in looking into a current pull request which<br>
&gt;&gt;&gt; addresses some (all?) of these issues<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href="https://github.com/infinispan/infinispan/pull/2300" target="_blank">https://github.com/infinispan/infinispan/pull/2300</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Tristan<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 14/02/2014 16:10, Evangelos Vazaios wrote:<br>
&gt;&gt;&gt;&gt; Hello everyone,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I started using the MapReduce implementation of Infinispan and I came<br>
&gt;&gt;&gt;&gt; across some possible limitations. Thus, &nbsp;I want to make some suggestions<br>
&gt;&gt;&gt;&gt; about the MapReduce (MR) implementation of Infinispan.<br>
&gt;&gt;&gt;&gt; Depending on the algorithm, &nbsp;there might be some memory problems,<br>
&gt;&gt;&gt;&gt; especially for intermediate results.<br>
&gt;&gt;&gt;&gt; An example of such a case is &nbsp;group by. Suppose that we have a cluster<br>
&gt;&gt;&gt;&gt; of 2 nodes with 2 GB &nbsp;available. Let a distributed cache, where simple<br>
&gt;&gt;&gt;&gt; car objects (id,brand,colour) are stored and the total size of data is<br>
&gt;&gt;&gt;&gt; 3.5GB. If all objects have the same colour , then all 3.5 GB would go to<br>
&gt;&gt;&gt;&gt; only one reducer, as a result an OutOfMemoryException will be thrown.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; To overcome these limitations, I propose to add as parameter the name of<br>
&gt;&gt;&gt;&gt; the intermediate cache to be used. This will enable the creation of a<br>
&gt;&gt;&gt;&gt; custom configured cache that deals with the memory limitations.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Another feature that I would like to have is to set the name of the<br>
&gt;&gt;&gt;&gt; output cache. The reasoning behind this is similar to the one mentioned<br>
&gt;&gt;&gt;&gt; above.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I wait for your thoughts on these two suggestions.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Regards,<br>
&gt;&gt;&gt;&gt; Evangelos<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Radim Vansa &lt;<a href="mailto:rvansa@redhat.com">rvansa@redhat.com</a>&gt;<br>
&gt; JBoss DataGrid QA<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
<br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br></div>