public final class CachingMultiIndexReader extends org.apache.lucene.index.MultiReader implements HierarchyResolver, MultiIndexReader
Constructor and Description |
---|
CachingMultiIndexReader(org.apache.jackrabbit.core.query.lucene.ReadOnlyIndexReader[] subReaders,
org.apache.jackrabbit.core.query.lucene.DocNumberCache cache)
Creates a new
CachingMultiIndexReader based on sub readers. |
Modifier and Type | Method and Description |
---|---|
org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId |
createDocId(NodeId id)
Creates a document id for the given node identifier.
|
protected void |
doClose() |
int |
getDocumentNumber(org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId docId)
Returns the document number for the passed
docId . |
org.apache.lucene.index.IndexReader[] |
getIndexReaders() |
org.apache.jackrabbit.core.query.lucene.DocId |
getParentDocId(int n)
Returns the DocId of the parent of
n or DocId.NULL
if n does not have a parent (n is the root
node). |
int[] |
getParents(int n,
int[] docNumbers)
Returns the document number of the parent of
n or an empty
array if n does not have a parent (n is the
root node). |
void |
release()
Releases this index reader and potentially frees resources.
|
org.apache.lucene.index.TermDocs |
termDocs(org.apache.lucene.index.Term term) |
clone, clone, docFreq, doCommit, document, doDelete, doOpenIfChanged, doOpenIfChanged, doSetNorm, doUndeleteAll, getFieldInfos, getSequentialSubReaders, getTermFreqVector, getTermFreqVector, getTermFreqVector, getTermFreqVectors, getVersion, hasDeletions, hasNorms, isCurrent, isDeleted, isOptimized, maxDoc, norms, norms, numDocs, readerIndex, termDocs, termPositions, terms, terms
acquireWriteLock, addReaderClosedListener, close, commit, commit, decRef, deleteDocument, deleteDocuments, directory, document, doOpenIfChanged, doOpenIfChanged, ensureOpen, flush, flush, getCommitUserData, getCommitUserData, getCoreCacheKey, getCurrentVersion, getDeletesCacheKey, getIndexCommit, getRefCount, getTermInfosIndexDivisor, getUniqueTermCount, incRef, indexExists, lastModified, listCommits, numDeletedDocs, open, open, open, open, open, open, open, open, open, open, open, openIfChanged, openIfChanged, openIfChanged, openIfChanged, removeReaderClosedListener, reopen, reopen, reopen, reopen, setNorm, setNorm, termPositions, toString, tryIncRef, undeleteAll
public CachingMultiIndexReader(org.apache.jackrabbit.core.query.lucene.ReadOnlyIndexReader[] subReaders, org.apache.jackrabbit.core.query.lucene.DocNumberCache cache)
CachingMultiIndexReader
based on sub readers.subReaders
- the sub readers.cache
- the document number cache.public int[] getParents(int n, int[] docNumbers) throws IOException
n
or an empty
array if n
does not have a parent (n
is the
root node).getParents
in interface HierarchyResolver
n
- the document number.docNumbers
- an array for reuse. An implementation should use the
passed array as a container for the return value,
unless the length of the returned array is different
from docNumbers
. In which case an
implementation will create a new array with an
appropriate size.n
's parent.IOException
- if an error occurs while reading from the
index.public org.apache.jackrabbit.core.query.lucene.DocId getParentDocId(int n) throws IOException
n
or DocId.NULL
if n
does not have a parent (n
is the root
node).n
- the document number.n
's parent.IOException
- if an error occurs while reading from the index.public org.apache.lucene.index.TermDocs termDocs(org.apache.lucene.index.Term term) throws IOException
termDocs
in class org.apache.lucene.index.MultiReader
IOException
public final 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.protected void doClose() throws IOException
doClose
in class org.apache.lucene.index.MultiReader
IOException
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(NodeId id) throws IOException
createDocId
in interface MultiIndexReader
id
- the id of the node.null
if there is no node
with the given id
.IOException
- if an error occurs while reading from the index.public int getDocumentNumber(org.apache.jackrabbit.core.query.lucene.ForeignSegmentDocId docId)
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).Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.