Class SimpleFSLockFactory

java.lang.Object
com.graphhopper.storage.SimpleFSLockFactory
All Implemented Interfaces:
LockFactory

public class SimpleFSLockFactory extends Object implements LockFactory
Creates a write lock file. Influenced by Lucene code

Author:
Peter Karich
  • Constructor Details

    • SimpleFSLockFactory

      public SimpleFSLockFactory()
    • SimpleFSLockFactory

      public SimpleFSLockFactory(File dir)
  • Method Details

    • setLockDir

      public void setLockDir(File lockDir)
      Specified by:
      setLockDir in interface LockFactory
    • create

      public GHLock create(String fileName, boolean writeAccess)
      Description copied from interface: LockFactory
      This creates a file for write or read locks depending on the specified writeAccess property. Important note: even for read locks we need write access to the underlying filesystem in order to avoid writes from other processes.
      Specified by:
      create in interface LockFactory
    • forceRemove

      public void forceRemove(String fileName, boolean writeAccess)
      Description copied from interface: LockFactory
      Removes the specified lock. Note: on windows we cannot forcefully remove an unreleased native lock
      Specified by:
      forceRemove in interface LockFactory