|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlux.CachingDocReader
public class CachingDocReader
Reads, parses and caches XML documents from a Lucene index. Assigns Lucene docIDs as Saxon document numbers. This reader is intended to survive for a single query only, and is *not thread-safe*. TODO: a nice optimization would be to maintain a global cache, shared across threads, with some tunable resource-based eviction policy. Not threadsafe.
| Constructor Summary | |
|---|---|
CachingDocReader(net.sf.saxon.s9api.DocumentBuilder builder,
net.sf.saxon.Configuration config,
IndexConfiguration indexConfig)
Create a CachingDocReader that will use the provided objects to read and parse XML documents. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears all cached documents. |
net.sf.saxon.s9api.XdmNode |
get(int docID,
org.apache.lucene.index.IndexReader reader)
Reads the document with the given id. |
long |
getBuildTime()
|
int |
getCacheHits()
|
int |
getCacheMisses()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachingDocReader(net.sf.saxon.s9api.DocumentBuilder builder,
net.sf.saxon.Configuration config,
IndexConfiguration indexConfig)
builder - will be used to construct XML documents as XdmNodesconfig - assigns the proper document ID to each constructed documentindexConfig - supplies the names of the xml storage and uri fields| Method Detail |
|---|
public net.sf.saxon.s9api.XdmNode get(int docID,
org.apache.lucene.index.IndexReader reader)
throws IOException
IndexReader.
docID - the id of the document to readreader - the Lucene index reader
IOException - if there is some sort of low-level problem with the index
LuxException - if there is an error building the document that has been
retrievedpublic int getCacheHits()
public int getCacheMisses()
public long getBuildTime()
public void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||