Class NoopSegmentReadLocker

  • All Implemented Interfaces:
    SegmentReadLocker

    public class NoopSegmentReadLocker
    extends Object
    implements SegmentReadLocker
    NoopSegmentReadLocker ignores requests to apply a readlock, but also ignores requests to delete files. It might be a good choice for read-only indexes, or cases in which leaving unused segments in the index is not considered a problem.
    Since:
    4.1
    Author:
    Sanne Grinovero
    • Constructor Detail

      • NoopSegmentReadLocker

        public NoopSegmentReadLocker()
    • Method Detail

      • acquireReadLock

        public boolean acquireReadLock​(String filename)
        doesn't do anything and returns true
        Specified by:
        acquireReadLock in interface SegmentReadLocker
        Parameters:
        filename - of the file to acquire the lock at
        Returns:
        true if the lock was acquired, false if the implementation detects the file does not exist, or that it's being deleted by some other thread.
        See Also:
        Directory.openInput(java.lang.String, org.apache.lucene.store.IOContext)
      • deleteOrReleaseReadLock

        public void deleteOrReleaseReadLock​(String filename)
        doesn't do anything
        Specified by:
        deleteOrReleaseReadLock in interface SegmentReadLocker
        Parameters:
        filename - of the file to release or delete
        See Also:
        Directory.deleteFile(String)