From: Kevin D. <ke...@tr...> - 2008-01-23 22:07:49
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD> <BODY leftMargin=1 topMargin=1 rightMargin=1><FONT face=Arial size=2> <DIV>Just make sure you delete the records from the BTree when you delete them from the record manager :-)</DIV> <DIV> </DIV> <DIV>For these situations, we actually store the key in the btree as:</DIV> <DIV> </DIV> <DIV>[timestamp][recid]</DIV> <DIV> </DIV> <DIV>and the value as a null value. that way we don't have to worry about key collision if two transactions hit at the exact same time stamp.</DIV> <DIV> </DIV> <DIV>I have a class around here somehwere that allows you to easily implement a multi-keyed index like the above using longs or strings. If it's of interest, let me know and I'll send it to you directly.</DIV> <DIV> </DIV> <DIV>- K<BR></DIV> <DIV> </DIV></FONT> <DIV style="FONT-SIZE: x-small; FONT-FAMILY: Tahoma"> <DIV>----------------------- <B>Original Message</B> -----------------------</DIV> <DIV> </DIV> <DIV><B>From:</B> "Alex Boisvert" <A href="mailto:boi...@in..."><FONT color=#0000ff><boi...@in...></FONT></A></DIV> <DIV><B>To:</B> "NAVEEN UPADHYAY" <A href="mailto:nav...@gm..."><FONT color=#0000ff><nav...@gm...></FONT></A></DIV> <DIV><B>Cc:</B> <A href="mailto:jdb...@li..."><FONT color=#0000ff>jdb...@li...,</FONT></A> Kevin Day <A href="mailto:ke...@tr..."><FONT color=#0000ff><ke...@tr...></FONT></A></DIV> <DIV><B>Date:</B> Wed, 23 Jan 2008 05:32:38 -0800</DIV> <DIV><B>Subject: <U>Re: [Jdbm-developer] Need help on .db file optimisation | JDBM</U></B></DIV> <DIV> </DIV></DIV>Naveen,<BR><BR>You can delete/remove whatever you are putting into the database. It's up to your application code to do that. <BR><BR>For example, if you are recording events, simply tag the events with a timestamp, create an index (btree) on the timestamp and delete old events when you reach a given threshold. You can collect statistics on a sample set of records to determine your average space requirement and then extrapolate to obtain your upper limit based on your file system limitations (2G), minus some conservative margin. <BR><BR>regards,<BR>alex<BR><BR><BR><BR> <DIV><SPAN class=gmail_quote>On 1/22/08, <B class=gmail_sendername>NAVEEN UPADHYAY</B> <<A href="mailto:nav...@gm...">nav...@gm...</A>> wrote: </SPAN> <BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Thanks Alex,Kevin for your responses ;^) <BR> The proposed solutions seem to be quite good. <BR>Only thing i have is my main concern is to purge old data with these .db files and<B> NOT </B>their corruption beyond 2gb.<BR>My only aim is to keep the size of the file always within a limit. <BR>For my driver only the recent data is of use..<BR>So all that i am looking for is a way to purge old data<BR><BR>Will throwing IOExceptions work? <BR>Please suggest some solutions...<BR>Thanks in advance,<BR><SPAN class=sg>Naveen<BR><BR></SPAN> <DIV class=gmail_quote> <DIV><SPAN class=e id=q_117a46b0294fd8b6_3>On Jan 23, 2008 5:02 AM, Alex Boisvert <<A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:boi...@in..." target=_blank> boi...@in...</A>> wrote:<BR></SPAN></DIV> <BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> <DIV><SPAN class=e id=q_117a46b0294fd8b6_5> <DIV>On 1/22/08, <B class=gmail_sendername>Kevin Day</B> <<A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:ke...@tr..." target=_blank>ke...@tr...</A>> wrote:</DIV> <DIV> <DIV><SPAN class=gmail_quote></SPAN> <BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> <DIV><FONT face=Arial size=2> <DIV>Another option would be to have an OOSProvider that could be configured with an instrumentable version for testing (this would be more akin to dependency injection)... It feels weird to add code to the runtime implementation of a class that forces it to fail... </DIV> <DIV> </DIV> <DIV>Any preference? (although I love Brian's idea of using a thumb drive - or maybe even a RAM disk - it's just hard to enforce that stuff in a test suite :-) )</DIV></FONT></DIV></BLOCKQUOTE> <DIV><BR></DIV></DIV></DIV>I understand the weird feeling and I don't have a strong preference. I think the OOSProvider solution is going to involve more code to achieve the same goal. If the abstraction isn't needed in the first place, I don't think it's worth the added complexity, meaning adding 4-5 more classes for this test alone. <BR><FONT color=#888888><BR>alex<BR><BR></FONT><BR></SPAN></DIV><SPAN class=q>-------------------------------------------------------------------------<BR>This SF.net email is sponsored by: Microsoft<BR>Defy all challenges. Microsoft(R) Visual Studio 2008.<BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/" target=_blank>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/</A><BR>_______________________________________________<BR>Jdbm-developer mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Jdb...@li...urcefor ge.net" target=_blank>Jdb...@li... </A><BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/jdbm-developer" target=_blank>https://lists.sourceforge.net/lists/listinfo/jdbm-developer</A><BR><BR></SPAN></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></DIV><BR> <STYLE type=text/css> P, UL, OL, DL, DIR, MENU, PRE { margin: 0 auto;}</STYLE> <FONT face=Tahoma size=2> <DIV>-------------------------------------------------------------------------<BR>This SF.net email is sponsored by: Microsoft<BR>Defy all challenges. Microsoft(R) Visual Studio 2008.<BR>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/<BR><BR></DIV></FONT> <STYLE type=text/css> P, UL, OL, DL, DIR, MENU, PRE { margin: 0 auto;}</STYLE> <FONT face=Tahoma size=2> <DIV>_______________________________________________<BR>Jdbm-developer mailing list<BR>Jdb...@li...<BR>https://lists.sourceforge.net/lists/listinfo/jdbm-developer<BR><BR><BR></DIV></FONT></BODY></HTML> |