public class SearcherTaxonomyManager extends ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
NOTE: If you call DirectoryTaxonomyWriter.replaceTaxonomy(org.apache.lucene.store.Directory)
then you must
open a new SearcherTaxonomyManager
afterwards.
Modifier and Type | Class and Description |
---|---|
static class |
SearcherTaxonomyManager.SearcherAndTaxonomy
Holds a matched pair of
IndexSearcher and
TaxonomyReader |
ReferenceManager.RefreshListener
current
Constructor and Description |
---|
SearcherTaxonomyManager(Directory indexDir,
Directory taxoDir,
SearcherFactory searcherFactory)
Creates search and taxonomy readers over the corresponding directories.
|
SearcherTaxonomyManager(IndexReader reader,
DirectoryTaxonomyReader taxoReader,
SearcherFactory searcherFactory)
Creates this from already opened
IndexReader and DirectoryTaxonomyReader instances. |
SearcherTaxonomyManager(IndexWriter writer,
boolean applyAllDeletes,
SearcherFactory searcherFactory,
DirectoryTaxonomyWriter taxoWriter)
Expert: creates near-real-time searcher and taxonomy reader
from the corresponding writers, controlling whether deletes should be applied.
|
SearcherTaxonomyManager(IndexWriter writer,
SearcherFactory searcherFactory,
DirectoryTaxonomyWriter taxoWriter)
Creates near-real-time searcher and taxonomy reader
from the corresponding writers.
|
Modifier and Type | Method and Description |
---|---|
protected void |
decRef(SearcherTaxonomyManager.SearcherAndTaxonomy ref)
Decrement reference counting on the given reference.
|
protected int |
getRefCount(SearcherTaxonomyManager.SearcherAndTaxonomy reference)
Returns the current reference count of the given reference.
|
protected SearcherTaxonomyManager.SearcherAndTaxonomy |
refreshIfNeeded(SearcherTaxonomyManager.SearcherAndTaxonomy ref)
Refresh the given reference if needed.
|
protected boolean |
tryIncRef(SearcherTaxonomyManager.SearcherAndTaxonomy ref)
Try to increment reference counting on the given reference.
|
acquire, addListener, afterClose, afterMaybeRefresh, close, maybeRefresh, maybeRefreshBlocking, release, removeListener
public SearcherTaxonomyManager(IndexWriter writer, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter) throws java.io.IOException
java.io.IOException
public SearcherTaxonomyManager(IndexWriter writer, boolean applyAllDeletes, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter) throws java.io.IOException
java.io.IOException
public SearcherTaxonomyManager(Directory indexDir, Directory taxoDir, SearcherFactory searcherFactory) throws java.io.IOException
NOTE: you should only use this constructor if you commit and call
ReferenceManager.maybeRefresh()
in the same thread. Otherwise it could lead to an
unsync'd IndexSearcher
and TaxonomyReader
pair.
java.io.IOException
public SearcherTaxonomyManager(IndexReader reader, DirectoryTaxonomyReader taxoReader, SearcherFactory searcherFactory) throws java.io.IOException
IndexReader
and DirectoryTaxonomyReader
instances. Note that
the incoming readers will be closed when you call ReferenceManager.close()
.java.io.IOException
protected void decRef(SearcherTaxonomyManager.SearcherAndTaxonomy ref) throws java.io.IOException
ReferenceManager
decRef
in class ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
java.io.IOException
- if reference decrement on the given resource failed.protected boolean tryIncRef(SearcherTaxonomyManager.SearcherAndTaxonomy ref) throws java.io.IOException
ReferenceManager
tryIncRef
in class ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
java.io.IOException
protected SearcherTaxonomyManager.SearcherAndTaxonomy refreshIfNeeded(SearcherTaxonomyManager.SearcherAndTaxonomy ref) throws java.io.IOException
ReferenceManager
null
if no refresh
was needed, otherwise a new refreshed reference.refreshIfNeeded
in class ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
java.io.IOException
- if the refresh operation failedprotected int getRefCount(SearcherTaxonomyManager.SearcherAndTaxonomy reference)
ReferenceManager
getRefCount
in class ReferenceManager<SearcherTaxonomyManager.SearcherAndTaxonomy>
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.