<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 29 Sep 2009, at 09:57, Mircea Markus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>Again, this is a feature from Coherence[1].</div><div><br></div><div>Basic idea is to execute a query against the cache, and hold the result object. This result object will always have up to date query result; this means that whenever something is modified in the cache the result itself is updated.</div></div></blockquote><div><br></div><div>So I'm guessing a use case could be something like putting objects into one node in a cluster and then running a query on a separate node?</div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div> Advantage: if one performs the same query very often(e.g.&nbsp;several times every millisecond) the response will be fast and the system will not be overloaded.&nbsp;</div><div>E.g.&nbsp;</div><div><pre xml:space="preserve" class="oac_no_warn">Filter filter = new AndFilter(new EqualsFilter("getTrader", traderid),
                              new EqualsFilter("getStatus", Status.OPEN));</pre><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn">ContinuousQueryCache cacheOpenTrades = new ContinuousQueryCache(cache, filter);</pre><pre xml:space="preserve" class="oac_no_warn"><br></pre><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn">Iterator iter = cacheOpenTrades.entrySet().iterator(); //*this entrySet call will be instant!*</pre><pre xml:space="preserve" class="oac_no_warn"><br></pre><pre xml:space="preserve" class="oac_no_warn">FOr a full list of scenario in which this can be used take a look at [1].</pre><pre xml:space="preserve" class="oac_no_warn">Shall we consider adding something similar?</pre></pre></pre></pre></div></div></blockquote><div>I guess it would depend if we were thinking of keeping those iterators. There was the debate about pagination vs iterators so I guess it would depend on what happens with the debate.</div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn"><br></pre><pre xml:space="preserve" class="oac_no_warn">Cheers,</pre><pre xml:space="preserve" class="oac_no_warn">Mircea</pre></pre></pre><pre xml:space="preserve" class="oac_no_warn"><pre xml:space="preserve" class="oac_no_warn"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></span></font></pre><pre xml:space="preserve" class="oac_no_warn"><br></pre><pre xml:space="preserve" class="oac_no_warn">[1] <a href="http://download.oracle.com/docs/cd/E14526_01/coh.350/e14509/continuousquery.htm#BABBEIAH">http://download.oracle.com/docs/cd/E14526_01/coh.350/e14509/continuousquery.htm#BABBEIAH</a></pre></pre></pre></div></div>_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/infinispan-dev</blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Navin Surtani</div><div><br></div><div>Intern Infinispan</div><div>Intern JBoss Cache Searchable</div></div></span> </div><br></body></html>