|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.IndexReader org.apache.lucene.index.FilterIndexReader org.apache.jackrabbit.core.query.lucene.JackrabbitIndexReader
public final class JackrabbitIndexReader
JackrabbitIndexReader
wraps an index reader and
releases
the underlying reader
when a client calls IndexReader.close()
on this reader. This allows reusing
of the underlying index reader instance.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.lucene.index.FilterIndexReader |
---|
org.apache.lucene.index.FilterIndexReader.FilterTermDocs, org.apache.lucene.index.FilterIndexReader.FilterTermEnum, org.apache.lucene.index.FilterIndexReader.FilterTermPositions |
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader |
---|
org.apache.lucene.index.IndexReader.FieldOption |
Field Summary |
---|
Fields inherited from class org.apache.lucene.index.FilterIndexReader |
---|
in |
Fields inherited from class org.apache.lucene.index.IndexReader |
---|
hasChanges |
Constructor Summary | |
---|---|
JackrabbitIndexReader(org.apache.lucene.index.IndexReader in)
Creates a new JackrabbitIndexReader . |
Method Summary | |
---|---|
org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId |
createDocId(UUID uuid)
Creates a document id for the given uuid . |
protected void |
doClose()
Calls release on the underlying MultiIndexReader instead of
closing it. |
int |
getDocumentNumber(org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId docId)
Returns the document number for the passed docId . |
org.apache.lucene.index.IndexReader[] |
getIndexReaders()
|
int |
getParent(int n)
Returns the document number of the parent of n or
-1 if n does not have a parent (n
is the root node). |
void |
release()
Releases this index reader and potentially frees resources. |
Methods inherited from class org.apache.lucene.index.FilterIndexReader |
---|
directory, docFreq, doCommit, document, doDelete, doSetNorm, doUndeleteAll, getFieldNames, getTermFreqVector, getTermFreqVector, getTermFreqVector, getTermFreqVectors, getVersion, hasDeletions, hasNorms, isCurrent, isDeleted, isOptimized, maxDoc, norms, norms, numDocs, termDocs, termPositions, terms, terms |
Methods inherited from class org.apache.lucene.index.IndexReader |
---|
acquireWriteLock, close, commit, decRef, deleteDocument, deleteDocuments, document, ensureOpen, flush, getCurrentVersion, getCurrentVersion, getCurrentVersion, getTermInfosIndexDivisor, incRef, indexExists, indexExists, indexExists, isLocked, isLocked, lastModified, lastModified, lastModified, main, open, open, open, open, reopen, setNorm, setNorm, setTermInfosIndexDivisor, termDocs, termPositions, undeleteAll, unlock |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JackrabbitIndexReader(org.apache.lucene.index.IndexReader in)
JackrabbitIndexReader
. The passed index reader
must also implement the interfaces HierarchyResolver
and
MultiIndexReader
.
in
- the underlying index reader.
IllegalArgumentException
- if in
does not implement
HierarchyResolver
and
MultiIndexReader
.Method Detail |
---|
protected void doClose() throws IOException
MultiIndexReader
instead of
closing it.
doClose
in class org.apache.lucene.index.FilterIndexReader
IOException
- if an error occurs while releaseing the underlying
index reader.public int getParent(int n) throws IOException
n
or
-1
if n
does not have a parent (n
is the root node).
getParent
in interface HierarchyResolver
n
- the document number.
n
's parent.
IOException
- if an error occurs while reading from the index.public org.apache.lucene.index.IndexReader[] getIndexReaders()
getIndexReaders
in interface MultiIndexReader
IndexReader
s that are contained in this
MultiIndexReader
.public org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId createDocId(UUID uuid) throws IOException
uuid
.
createDocId
in interface MultiIndexReader
uuid
- the uuid of the node.
null
if there is no node
with the given uuid
.
IOException
- if an error occurs while reading from the index.public int getDocumentNumber(org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId docId) throws IOException
docId
. If the id
is invalid -1
is returned.
getDocumentNumber
in interface MultiIndexReader
docId
- the document id to resolve.
-1
if it is invalid (e.g.
does not exist).
IOException
- if an error occurs while reading from the index.public void release() throws IOException
IndexReader.close()
this method
does not necessarily close the index reader, but gives the implementation
the opportunity to do reference counting.
release
in interface ReleaseableIndexReader
IOException
- if an error occurs while releasing the index reader.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |