I was looking over at the map-inverted-index code and I see that it calls map-btree method, which in turns calls map-btree-from-start or map-btree-from-end functions. These last two functions seem to use the cursor API. <br>
<br>So the question I have is, are the intentions to "hide" the cursor API and access them via these higher level functions or are the intentions to make them disappear altogether and replace their functionality with the query system?<br>
<br>JD<br><br><div class="gmail_quote">On Fri, Feb 6, 2009 at 5:03 PM, Ian Eslick <span dir="ltr"><<a href="mailto:eslick@media.mit.edu">eslick@media.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Cursors are nice low level tools, for sure.  They also allows for more<br>
complex iteration over the index than the pure mapping function.  I'm<br>
hoping that we can hide most of these cases in the query system,<br>
eventually.  For 1.0 at least we'll be leaving them in and simply<br>
encourage most people to use the higher level abstractions.<br>
<br>
However, for this example you can hack it up with map-inverted-index<br>
<br>
(defun get-min-log-value (type) ;; type = { :min | :max }<br>
    (map-inverted-index<br>
       (lambda (x)<br>
        (return-from get-min-log-value x))<br>
       'log 'timestamp :from-end (when :max t)))<br>
<br>
Ian<br>
<br>
<br>
<br>
<br>
On Feb 6, 2009, at 4:21 PM, John wrote:<br>
<br>
> As we're still learning Elephant, we are not currently using<br>
> cursors. However, one thing I'm thinking is that we will definitely<br>
> have the following scenario:<br>
><br>
> We define a class for storing log information, which is timestamped<br>
> and we create an index on the timestamp. The purpose for this is so<br>
> that we could "easily" get the MIN and MAX timestamp from a list of<br>
> a few million objects. Without looking at the implementation of<br>
> cursors and just looking at the documentation, I think it would be<br>
> easier (and possibly more efficient) to set a cursor on the index<br>
> and get cursor-first and cursor-last, instead of having to map-index<br>
> and the entire set of millions of objects.<br>
><br>
> Would that qualify as a reasonable need of cursors?<br>
><br>
> Thanks<br>
> JD<br>
><br>
> On Thu, Feb 5, 2009 at 8:44 AM, Ian Eslick <<a href="mailto:eslick@media.mit.edu">eslick@media.mit.edu</a>><br>
> wrote:<br>
> Would map functions, as described by leslie, accomplish the same thing<br>
> with a little rewrite?<br>
><br>
> I would say that we want some way for users of a current store in<br>
> elephant-unstable to migrate to elephant-1.0 - we do have a solid set<br>
> of postmodern users.  I'd be surprised if anyone is still using the<br>
> original 0.9.1 - but let's give it a few days and see if anyone<br>
> shouts.<br>
><br>
> If you like I can look at migration in 0.9.1, but it will be a little<br>
> bit before I can get to it.<br>
><br>
> Would it make sense to include gp-export into elephant proper or make<br>
> it an easy option to load/use?  The online migration is a bit of a<br>
> pain to maintain over certain changes to the way the stores work; it<br>
> would be nice if we had a path that was less prone to error to bypass<br>
> code for complex backwards compatibility in the future if needed.<br>
><br>
> Ian<br>
><br>
> On Feb 5, 2009, at 6:36 AM, Alex Mizrahi wrote:<br>
><br>
> > IE> How many people currently directly use the Btree/cursor<br>
> interface?<br>
> ><br>
> > we use cursors to iterate through multiple sequences in order,<br>
> e.g. we<br>
> > want, say 10 latest items that satisfy certain criteria, and<br>
> > candidates<br>
> > come from different indices.<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > elephant-devel site list<br>
> > <a href="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</a><br>
> > <a href="http://common-lisp.net/mailman/listinfo/elephant-devel" target="_blank">http://common-lisp.net/mailman/listinfo/elephant-devel</a><br>
><br>
><br>
> _______________________________________________<br>
> elephant-devel site list<br>
> <a href="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</a><br>
> <a href="http://common-lisp.net/mailman/listinfo/elephant-devel" target="_blank">http://common-lisp.net/mailman/listinfo/elephant-devel</a><br>
><br>
> _______________________________________________<br>
> elephant-devel site list<br>
> <a href="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</a><br>
> <a href="http://common-lisp.net/mailman/listinfo/elephant-devel" target="_blank">http://common-lisp.net/mailman/listinfo/elephant-devel</a><br>
<br>
<br>
_______________________________________________<br>
elephant-devel site list<br>
<a href="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</a><br>
<a href="http://common-lisp.net/mailman/listinfo/elephant-devel" target="_blank">http://common-lisp.net/mailman/listinfo/elephant-devel</a><br>
</blockquote></div><br>