From marianomontone at gmail.com Tue Oct 2 14:34:04 2007 From: marianomontone at gmail.com (Mariano Montone) Date: Tue, 2 Oct 2007 11:34:04 -0300 Subject: [elephant-devel] Best way of getting a collection size Message-ID: <2677cc980710020734n38f5a4a6j9559c5c622effe94@mail.gmail.com> Hello, I would like to know which is the best way to get the size of a persistent-collection (for example the number of instances of some class). I haven't be able to find a method. And uploading all the objects to memory to count them is not an option. Cheers, Mariano -------------- next part -------------- An HTML attachment was scrubbed... URL: From eslick at csail.mit.edu Tue Oct 2 16:00:22 2007 From: eslick at csail.mit.edu (Ian Eslick) Date: Tue, 2 Oct 2007 12:00:22 -0400 Subject: [elephant-devel] Best way of getting a collection size In-Reply-To: <2677cc980710020734n38f5a4a6j9559c5c622effe94@mail.gmail.com> References: <2677cc980710020734n38f5a4a6j9559c5c622effe94@mail.gmail.com> Message-ID: I'm not sure offhand. Different stores will have different low-level access to the data structure. Robert might be able to do this via a SQL query. Not sure about Henrik's Postmodern implementation. This probably isn't possible for the BDB data store. You can get the leaf count for a BDB Btree, but not for a subtree (we multiplex Elephant BTrees on a single, large BDB BTree). Perhaps we could provide a mixin class that automatically maintains this count on the lisp side for a user subclass of persistent- collection? Ian On Oct 2, 2007, at 10:34 AM, Mariano Montone wrote: > Hello, > I would like to know which is the best way to get the size > of a persistent-collection (for example the number of instances of > some class). I haven't be able to find a method. And uploading all > the objects to memory to count them is not an option. > > Cheers, Mariano > _______________________________________________ > elephant-devel site list > elephant-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/elephant-devel From marianomontone at gmail.com Tue Oct 2 16:46:52 2007 From: marianomontone at gmail.com (Mariano Montone) Date: Tue, 2 Oct 2007 13:46:52 -0300 Subject: [elephant-devel] Best way of getting a collection size In-Reply-To: References: <2677cc980710020734n38f5a4a6j9559c5c622effe94@mail.gmail.com> Message-ID: <2677cc980710020946i26ce566ma2233144faba061b@mail.gmail.com> > > Perhaps we could provide a mixin class that automatically maintains > this count on the lisp side for a user subclass of persistent- > collection? Ok. I may try that. It's astonishing for me that the BDB api does not provide such functionality. Thanks, Mariano -------------- next part -------------- An HTML attachment was scrubbed... URL: From eslick at csail.mit.edu Tue Oct 2 17:34:32 2007 From: eslick at csail.mit.edu (Ian Eslick) Date: Tue, 2 Oct 2007 13:34:32 -0400 Subject: [elephant-devel] Best way of getting a collection size In-Reply-To: <2677cc980710020946i26ce566ma2233144faba061b@mail.gmail.com> References: <2677cc980710020734n38f5a4a6j9559c5c622effe94@mail.gmail.com> <2677cc980710020946i26ce566ma2233144faba061b@mail.gmail.com> Message-ID: <590DC3FA-182A-4895-A831-236A069EA3E8@csail.mit.edu> > This probably isn't possible for the BDB data store. You can get the leaf count for a BDB > Btree, but not for a subtree (we multiplex Elephant BTrees on a single, large BDB BTree). It's not that BDB doesn't provide a count, it's that the way we use their DB doesn't make that count useful. We don't have a 1:1 mapping between lisp persistent-collections and BDB btrees, instead we have an N:1 lisp btree->BDB btree. I don't have time to go into all the good reasons why, but the problem is on our end of things. Ian On Oct 2, 2007, at 12:46 PM, Mariano Montone wrote: > Perhaps we could provide a mixin class that automatically maintains > this count on the lisp side for a user subclass of persistent- > collection? > > Ok. I may try that. It's astonishing for me that the BDB api does > not provide such functionality. > > Thanks, Mariano > _______________________________________________ > elephant-devel site list > elephant-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/elephant-devel From lists at infoway.net Tue Oct 2 19:49:16 2007 From: lists at infoway.net (lists at infoway.net) Date: Tue, 2 Oct 2007 15:49:16 -0400 Subject: [elephant-devel] Best way of getting a collection size In-Reply-To: <590DC3FA-182A-4895-A831-236A069EA3E8@csail.mit.edu> References: <2677cc980710020734n38f5a4a6j9559c5c622effe94@mail.gmail.com> <2677cc980710020946i26ce566ma2233144faba061b@mail.gmail.com> <590DC3FA-182A-4895-A831-236A069EA3E8@csail.mit.edu> Message-ID: Funny, but I will be coming across this same need very soon and, like Mariano, it would be great to get that information without having to traverse all the objects. I think the mixin class would be a great addition. Mariano, if you do give that a try, would you mind sharing it with the code and hopefully that will make it into future releases? Thanks On Oct 2, 2007, at 1:34 PM, Ian Eslick wrote: > > This probably isn't possible for the BDB data store. You can get > the leaf count for a BDB > > Btree, but not for a subtree (we multiplex Elephant BTrees on a > single, large BDB BTree). > > It's not that BDB doesn't provide a count, it's that the way we use > their DB doesn't make that count useful. We don't have a 1:1 > mapping between lisp persistent-collections and BDB btrees, instead > we have an N:1 lisp btree->BDB btree. I don't have time to go into > all the good reasons why, but the problem is on our end of things. > > Ian > > On Oct 2, 2007, at 12:46 PM, Mariano Montone wrote: > >> Perhaps we could provide a mixin class that automatically maintains >> this count on the lisp side for a user subclass of persistent- >> collection? >> >> Ok. I may try that. It's astonishing for me that the BDB api does >> not provide such functionality. >> >> Thanks, Mariano >> _______________________________________________ >> elephant-devel site list >> elephant-devel at common-lisp.net >> http://common-lisp.net/mailman/listinfo/elephant-devel > > _______________________________________________ > elephant-devel site list > elephant-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/elephant-devel From marianomontone at gmail.com Tue Oct 2 20:06:15 2007 From: marianomontone at gmail.com (Mariano Montone) Date: Tue, 2 Oct 2007 17:06:15 -0300 Subject: [elephant-devel] Best way of getting a collection size In-Reply-To: References: <2677cc980710020734n38f5a4a6j9559c5c622effe94@mail.gmail.com> <2677cc980710020946i26ce566ma2233144faba061b@mail.gmail.com> <590DC3FA-182A-4895-A831-236A069EA3E8@csail.mit.edu> Message-ID: <2677cc980710021306w18ceab6esb7a55fb87a4e027a@mail.gmail.com> 2007/10/2, lists at infoway.net : > > Funny, but I will be coming across this same need very soon and, like > Mariano, it would be great to get that information without having to > traverse all the objects. I think the mixin class would be a great > addition. Mariano, if you do give that a try, would you mind sharing > it with the code and hopefully that will make it into future releases? No problem, but don't expect that I try that too soon. I still consider myself kinda newbe in CL (although I have quite lots of experience programming) and I'm busy trying to asimilate CL + CLOS + UCW + Elephant. Besides, I haven't lurked through the Elephant architecture yet. Mariano -------------- next part -------------- An HTML attachment was scrubbed... URL: From eslick at csail.mit.edu Tue Oct 2 23:29:36 2007 From: eslick at csail.mit.edu (Ian Eslick) Date: Tue, 2 Oct 2007 19:29:36 -0400 Subject: [elephant-devel] Best way of getting a collection size In-Reply-To: <2677cc980710021306w18ceab6esb7a55fb87a4e027a@mail.gmail.com> References: <2677cc980710020734n38f5a4a6j9559c5c622effe94@mail.gmail.com> <2677cc980710020946i26ce566ma2233144faba061b@mail.gmail.com> <590DC3FA-182A-4895-A831-236A069EA3E8@csail.mit.edu> <2677cc980710021306w18ceab6esb7a55fb87a4e027a@mail.gmail.com> Message-ID: That part of it is actually easy, your mixin just need to provide before: or after: operators on (setf get-value) and remove-kv (I think). The challenge is not double counting replacement operations which may require an additional read, so good to keep this a mixin and only pay the cost when you need to. If any ideas for a more efficient solution comes up, please share them! Ian On Oct 2, 2007, at 4:06 PM, Mariano Montone wrote: > 2007/10/2, lists at infoway.net : > Funny, but I will be coming across this same need very soon and, like > Mariano, it would be great to get that information without having to > traverse all the objects. I think the mixin class would be a great > addition. Mariano, if you do give that a try, would you mind sharing > it with the code and hopefully that will make it into future releases? > > No problem, but don't expect that I try that too soon. I still > consider myself kinda newbe in CL (although I have quite lots of > experience programming) and I'm busy trying to asimilate CL + CLOS > + UCW + Elephant. Besides, I haven't lurked through the Elephant > architecture yet. > > Mariano > > > > _______________________________________________ > elephant-devel site list > elephant-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/elephant-devel From slobodan.blazeski at gmail.com Wed Oct 3 21:25:37 2007 From: slobodan.blazeski at gmail.com (Slobodan Blazeski) Date: Wed, 3 Oct 2007 23:25:37 +0200 Subject: [elephant-devel] add-to-root problem Message-ID: <20773b800710031425o219e315clf71efcacead71c6a@mail.gmail.com> I just installed elephant under lispworks windows with postgre as backened. Succesfully opened a store and I'm trying to fallow the tutorial. However I am unable to add elments to the root. Always get the same Error: #\something is not of type INTEGER like below: ELE-USER 45 : 4 > (add-to-root "my key" "my value") . Any ideas ? thanks Slobodan Error: #\Tab is not of type INTEGER. 1 (abort) Return to level 4. 2 Return to debug level 4. 3 Return to level 3. 4 Return to debug level 3. 5 Return to level 2. 6 Return to debug level 2. 7 Return to level 1. 8 Return to debug level 1. 9 Return to level 0. 10 Return to top loop level 0. Type :b for backtrace, :c