|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.search.reader.SharingBufferReaderProvider
public class SharingBufferReaderProvider
This ReaderProvider
shares IndexReaders as long as they are "current";
main difference with SharedReaderProvider is the way to update the Readers when needed:
this uses IndexReader.reopen() which should improve performance on larger indexes
as it shares buffers with previous IndexReader generation for the segments which didn't change.
Nested Class Summary | |
---|---|
protected class |
SharingBufferReaderProvider.PerDirectoryLatestReader
An instance for each DirectoryProvider, establishing the association between "current" ReaderUsagePair for a DirectoryProvider and it's lock. |
protected class |
SharingBufferReaderProvider.ReaderUsagePair
Container for the couple IndexReader,UsageCounter. |
Field Summary | |
---|---|
protected java.util.Map<org.apache.lucene.index.IndexReader,SharingBufferReaderProvider.ReaderUsagePair> |
allReaders
contains all Readers (most current per Directory and all unclosed old readers) |
protected java.util.Map<org.apache.lucene.store.Directory,SharingBufferReaderProvider.PerDirectoryLatestReader> |
currentReaders
contains last updated Reader; protected by lockOnOpenLatest (in the values) |
Constructor Summary | |
---|---|
SharingBufferReaderProvider()
|
Method Summary | |
---|---|
void |
closeReader(org.apache.lucene.index.IndexReader multiReader)
Close a reader previously opened by ReaderProvider.openReader(org.hibernate.search.store.DirectoryProvider...) . |
void |
destroy()
Called when a SearchFactory is destroyed. |
void |
initialize(java.util.Properties props,
SearchFactoryImplementor searchFactoryImplementor)
Inialize the reader provider before its use. |
org.apache.lucene.index.IndexReader |
openReader(DirectoryProvider... directoryProviders)
Open a read-only reader on all the listed directory providers. |
protected org.apache.lucene.index.IndexReader |
readerFactory(org.apache.lucene.store.Directory directory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Map<org.apache.lucene.index.IndexReader,SharingBufferReaderProvider.ReaderUsagePair> allReaders
protected final java.util.Map<org.apache.lucene.store.Directory,SharingBufferReaderProvider.PerDirectoryLatestReader> currentReaders
Constructor Detail |
---|
public SharingBufferReaderProvider()
Method Detail |
---|
public void closeReader(org.apache.lucene.index.IndexReader multiReader)
ReaderProvider
ReaderProvider.openReader(org.hibernate.search.store.DirectoryProvider...)
.
The closing can be virtual.
closeReader
in interface ReaderProvider
public void initialize(java.util.Properties props, SearchFactoryImplementor searchFactoryImplementor)
ReaderProvider
initialize
in interface ReaderProvider
public void destroy()
ReaderProvider
SearchFactory
is destroyed. This method typically releases resources.
It is guaranteed to be executed after readers are released by queries (assuming no user error).
destroy
in interface ReaderProvider
public org.apache.lucene.index.IndexReader openReader(DirectoryProvider... directoryProviders)
ReaderProvider
ReaderProvider.closeReader(IndexReader)
.
The opening can be virtual.
openReader
in interface ReaderProvider
protected org.apache.lucene.index.IndexReader readerFactory(org.apache.lucene.store.Directory directory) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |