Class NativeFSLockFactory

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

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

Author:
Peter Karich
  • Constructor Details

    • NativeFSLockFactory

      public NativeFSLockFactory()
    • NativeFSLockFactory

      public NativeFSLockFactory(File dir)
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException
    • 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