Package com.graphhopper.storage
Class NativeFSLockFactory
java.lang.Object
com.graphhopper.storage.NativeFSLockFactory
- All Implemented Interfaces:
LockFactory
Creates a write lock file. Influenced by Lucene code
- Author:
- Peter Karich
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis creates a file for write or read locks depending on the specified writeAccess property.void
forceRemove
(String fileName, boolean writeAccess) Removes the specified lock.static void
void
setLockDir
(File lockDir)
-
Constructor Details
-
NativeFSLockFactory
public NativeFSLockFactory() -
NativeFSLockFactory
-
-
Method Details
-
main
- Throws:
IOException
-
setLockDir
- Specified by:
setLockDir
in interfaceLockFactory
-
create
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 interfaceLockFactory
-
forceRemove
Description copied from interface:LockFactory
Removes the specified lock. Note: on windows we cannot forcefully remove an unreleased native lock- Specified by:
forceRemove
in interfaceLockFactory
-