Class SimpleFSLockFactory.SimpleFSLock

java.lang.Object
org.apache.lucene.store.Lock
org.apache.lucene.store.SimpleFSLockFactory.SimpleFSLock
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
SimpleFSLockFactory

static final class SimpleFSLockFactory.SimpleFSLock extends Lock
  • Field Details

    • path

      private final Path path
    • creationTime

      private final FileTime creationTime
    • closed

      private volatile boolean closed
  • Constructor Details

  • Method Details

    • ensureValid

      public void ensureValid() throws IOException
      Description copied from class: Lock
      Best effort check that this lock is still valid. Locks could become invalidated externally for a number of reasons, for example if a user deletes the lock file manually or when a network filesystem is in use.
      Specified by:
      ensureValid in class Lock
      Throws:
      IOException - if the lock is no longer valid.
    • close

      public void close() throws IOException
      Description copied from class: Lock
      Releases exclusive access.

      Note that exceptions thrown from close may require human intervention, as it may mean the lock was no longer valid, or that fs permissions prevent removal of the lock file, or other reasons.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class Lock
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object