Package org.infinispan.lucene.readlocks
Several implementations for a SegmentReadLocker, pick one depending on your use case.
Lucene's default IndexDeletionPolicy could remove a segment while it's still used by another IndexReader;
this is not an issue on a local filesystem, but could happen on Infinispan.
To prevent deletion of in-use segments a read-lock is acquired when a segment is opened.
-
Interface Summary Interface Description SegmentReadLocker SegmentReadLocker implementations have to make sure that segments are not deleted while they are being used by an IndexReader. -
Class Summary Class Description DistributedSegmentReadLocker DistributedSegmentReadLocker stores reference counters in the cache to keep track of the number of clients still needing to be able to read a segment.LocalLockMergingSegmentReadLocker LocalLockMergingSegmentReadLocker decorates theDistributedSegmentReadLocker
to minimize remote operations in case several IndexReaders are opened on the same Infinispan basedDirectory
.NoopSegmentReadLocker NoopSegmentReadLocker ignores requests to apply a readlock, but also ignores requests to delete files.