Class FDBDirectoryManager
java.lang.Object
com.apple.foundationdb.record.lucene.directory.FDBDirectoryManager
- All Implemented Interfaces:
AutoCloseable
A transaction-scoped manager of
FDBDirectory objects. For a single transaction, all FDBDirectory
objects should be created through this manager. This allows for cached data (like the block cache or file
list cache) for a single directory to persist across different operations (e.g., different queries) conducted
in the same transaction.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected FDBDirectoryWrappercreateNewDirectoryWrapper(IndexMaintainerState state, Tuple key, int mergeDirectoryCount, AgilityContext agilityContext, int blockCacheMaximumSize) getDirectory(Tuple groupingKey, Integer partitionId) org.apache.lucene.index.IndexReadergetIndexReader(Tuple groupingKey, Integer partitionId) org.apache.lucene.index.IndexWritergetIndexWriter(Tuple groupingKey, Integer partitionId) static FDBDirectoryManagergetManager(IndexMaintainerState state) protected static FDBDirectoryManagergetOrCreateManager(IndexMaintainerState state, Supplier<FDBDirectoryManager> managerSupplier) org.apache.lucene.index.DirectoryReadergetWriterReader(Tuple groupingKey, Integer partititonId) voidinvalidatePrefix(Tuple prefix) Invalidate directories from the cache if their grouping key begins with a specified prefix.mergeIndex(LucenePartitioner partitioner) voidmergeIndexWithContext(Tuple groupingKey, Integer partitionId, AgilityContext agilityContext) static CompletableFuture<Optional<Tuple>>nextTuple(FDBRecordContext context, Subspace subspace, KeyRange range, Optional<Tuple> lastTuple, ScanProperties scanProperties, int groupingCount)
-
Field Details
-
writerAnalyzer
-
exceptionAtCreation
-
-
Constructor Details
-
FDBDirectoryManager
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
getAnalyzerSelector
-
mergeIndex
-
mergeIndexWithContext
public void mergeIndexWithContext(@Nonnull Tuple groupingKey, @Nullable Integer partitionId, @Nonnull AgilityContext agilityContext) -
nextTuple
public static CompletableFuture<Optional<Tuple>> nextTuple(@Nonnull FDBRecordContext context, @Nonnull Subspace subspace, @Nonnull KeyRange range, @Nonnull Optional<Tuple> lastTuple, @Nonnull ScanProperties scanProperties, int groupingCount) -
invalidatePrefix
Invalidate directories from the cache if their grouping key begins with a specified prefix.- Parameters:
prefix- the prefix of grouping keys to remove from the cache
-
createNewDirectoryWrapper
@Nonnull protected FDBDirectoryWrapper createNewDirectoryWrapper(IndexMaintainerState state, Tuple key, int mergeDirectoryCount, AgilityContext agilityContext, int blockCacheMaximumSize) -
getDirectory
@Nonnull public FDBDirectory getDirectory(@Nullable Tuple groupingKey, @Nullable Integer partitionId) -
getIndexReader
public org.apache.lucene.index.IndexReader getIndexReader(@Nullable Tuple groupingKey, @Nullable Integer partitionId) throws IOException - Throws:
IOException
-
getIndexWriter
@Nonnull public org.apache.lucene.index.IndexWriter getIndexWriter(@Nullable Tuple groupingKey, @Nullable Integer partitionId) throws IOException - Throws:
IOException
-
getWriterReader
public org.apache.lucene.index.DirectoryReader getWriterReader(@Nullable Tuple groupingKey, @Nullable Integer partititonId) throws IOException - Throws:
IOException
-
getManager
-
getOrCreateManager
@Nonnull protected static FDBDirectoryManager getOrCreateManager(@Nonnull IndexMaintainerState state, Supplier<FDBDirectoryManager> managerSupplier)
-