[core-dev] Fun with Databases

Roger Kapsi <[email protected]> Fri, 16 Jul 2004 23:46:54 +0200
Newsgroups gmane.network.gnutella.limewire.core.devel
Message-ID <[email protected]>
Hi

NOTE:
This program is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The above statement is serious! :) This patch is not meant for being 
integrated into LimeWire (not yet).

OK, the Database...

I chose Sleepycat's Berkeley DB Java Edition (in short JE). It is a 
native Java DB (i.e. no SQL and such) based on BTrees, free for OS 
projects and has some very cool features like

- ACID transactions
- recovery
- auto commit
- an abstraction layer on top of collections (which I didn't use though)
- etc. etc.

The following classes were modified to use JE instead of their own 
storage files.

UrnCache.java
CreationTimeCache.java
TigerTreeCache.java

I think the most interesting is CreationTimeCache with a 
SecondaryDatabase and all the benefits you get from a DB...

What you need:

1) Java 1.4.2
2) je.jar from
    http://www.sleepycat.com/products/je.shtml
3) apply the patches
4) add je.jar to your run script classpath and run it
5) have fun :)

cu
  Roger

_______________________________________________
core-dev mailing list
[email protected]
http://www.limewire.org/mailman/listinfo/core-dev
dbfun.zip (application/zip, 11.7 KB) - not displayed