Kevin Ross wrote:
Your classes would seem to be very useful in the case where the db engine implemented some sort of profiling, and wanted to add an index on the fly, correct?
Yes. That would be a use for this type of index. Though you could also do the same with a regular persistent index.
I developed these classes to run Xindice completely
in-memory (well, completely in VM at least :). Our application uses Xindice as a temporary
database exclusively because we have difficulty synchronizing content
the XML database with other parts of the app 100% at all times.
Using a temp DB makes it self-healing at each startup (at the expense
of startup speed). The XML DB is loaded from a RDBMS where the
data is persistent. Also, we cannot trust the robsutness of the
Xindice DB persistence (no transaction logging, roll-forward recovery, etc.). I'm not
complaining that these features are not present, merely stating a
fact. Xindice is still useful as we use it.
-Terry
Hi Terry,
I'm not a db guru by any means...but...tell me if my idea is correct. Your classes would seem to be very useful in the case where the db engine implemented some sort of profiling, and wanted to add an index on the fly, correct? This would be somewhat analogous to the way the hotspot VM goes native with heavily traveled byte code?
How do you specifically apply these classes in your applications?
I'm +1 for adding these to the main trunk. If there are no objections, I'll do so.
-Kevin Ross
-----Original Message-----
From: Terry Rosenbaum [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:26 AM
To: [EMAIL PROTECTED]
Subject: MemValueIndexer
Attached are a couple of classes that you may find useful. Not a major piece of work, but I'm donating these to the cause if anyone is interested in checking them in as part of Xindice.
Attachments:
1) MemValueIndexer.java
* Provides an in-memory implementation of Xindice Indexer * based upon the Java TreeSet class. This implementation * is not persistent. A MemValueIndexer is useful for indexing * of temporary Collections (e.g. those based on MemFiler). It is also * useful for temporary indexing of persistent Collections.
Note that this indexer stores values as Java objects. Comparisons are performed using Java comparison. This indexer correctly handles comparisons of signed values for numeric index types, etc. (unlike existing ValueIndexer).
2) SizeableMemFiler.java
A Filer which is a wrapper around the Java HashMap. Just like existing MemFiler except that the initial size of the HashMap is set via System property named "org.apache.xindice.core.filer.SizeableMemFiler.INITIAL_SIZE".
Using these 2 classes together, you can run Xindice as an in-memory database (non-persistent).