Class FDBDirectoryWrapper
java.lang.Object
com.apple.foundationdb.record.lucene.directory.FDBDirectoryWrapper
- All Implemented Interfaces:
AutoCloseable
Wrapper containing an
FDBDirectory and cached accessor objects (like IndexWriters). This object
is designed to be held by the FDBDirectoryManager, with one object cached per open directory. Because the
FDBDirectory contains cached information from FDB, it is important for cache coherency that all writers
(etc.) accessing that directory go through the same wrapper object so that they share a common cache.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFDBDirectoryWrapper(IndexMaintainerState state, FDBDirectory directory, Tuple key, int mergeDirectoryCount, AgilityContext agilityContext, LuceneAnalyzerWrapper analyzerWrapper, Exception exceptionAtCreation) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected FDBDirectorycreateFDBDirectory(IndexMaintainerState state, Tuple key, AgilityContext agilityContext, int blockCacheMaximumSize) protected FDBDirectorycreateFDBDirectory(Subspace subspace, Map<String, String> options, FDBDirectorySharedCacheManager sharedCacheManager, Tuple sharedCacheKey, boolean useCompoundFile, AgilityContext agilityContext, int blockCacheMaximumSize) org.apache.lucene.index.IndexReaderAnIndexReaderfor searching this directory.org.apache.lucene.index.IndexWriterorg.apache.lucene.index.DirectoryReaderGet aDirectoryReaderwrapped around thegetWriter()to be able to get segments associated with documents.void
-
Field Details
-
USE_COMPOUND_FILE
public static final boolean USE_COMPOUND_FILE- See Also:
-
-
Constructor Details
-
FDBDirectoryWrapper
public FDBDirectoryWrapper(@Nonnull IndexMaintainerState state, @Nonnull FDBDirectory directory, @Nonnull Tuple key, int mergeDirectoryCount, @Nonnull AgilityContext agilityContext, @Nonnull LuceneAnalyzerWrapper analyzerWrapper, @Nullable Exception exceptionAtCreation)
-
-
Method Details
-
createFDBDirectory
@Nonnull protected FDBDirectory createFDBDirectory(IndexMaintainerState state, Tuple key, AgilityContext agilityContext, int blockCacheMaximumSize) -
getDirectory
-
getReader
AnIndexReaderfor searching this directory. This will wrapgetWriter()if the writer has already been instantiated, but otherwise, will just create a reader against this directory. This object should be closed by callers.- Throws:
IOException
-
getWriterReader
Get aDirectoryReaderwrapped around thegetWriter()to be able to get segments associated with documents. This resource will be closed whenthisis closed, and should not be closed by callers- Throws:
IOException
-
getWriter
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
mergeIndex
- Throws:
IOException
-