Lucene.Net
3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
|
Implements LockFactory using native OS file locks. Note that because this LockFactory relies on java.nio.* APIs for locking, any problems with those APIs will cause locking to fail. Specifically, on certain NFS environments the java.nio.* locks will fail (the lock can incorrectly be double acquired) whereas SimpleFSLockFactory worked perfectly in those same environments. For NFS based access to an index, it's recommended that you try SimpleFSLockFactory first and work around the one limitation that a lock file could be left when the JVM exits abnormally. More...
Inherits Lucene.Net.Store.FSLockFactory.
Public Member Functions | |
NativeFSLockFactory () | |
Create a NativeFSLockFactory instance, with null (unset) lock directory. When you pass this factory to a FSDirectory subclass, the lock directory is automatically set to the directory itsself. Be sure to create one instance for each directory your create! | |
NativeFSLockFactory (System.String lockDirName) | |
Create a NativeFSLockFactory instance, storing lock files into the specified lockDirName: | |
NativeFSLockFactory (System.IO.DirectoryInfo lockDir) | |
Create a NativeFSLockFactory instance, storing lock files into the specified lockDir: | |
override Lock | MakeLock (System.String lockName) |
Return a new Lock instance identified by lockName. | |
override void | ClearLock (System.String lockName) |
Attempt to clear (forcefully unlock and remove) the specified lock. Only call this at a time when you are certain this lock is no longer in use. | |
Additional Inherited Members | |
Properties inherited from Lucene.Net.Store.FSLockFactory | |
virtual DirectoryInfo | LockDir [get, set] |
Gets the lock directory. | |
Implements LockFactory using native OS file locks. Note that because this LockFactory relies on java.nio.* APIs for locking, any problems with those APIs will cause locking to fail. Specifically, on certain NFS environments the java.nio.* locks will fail (the lock can incorrectly be double acquired) whereas SimpleFSLockFactory worked perfectly in those same environments. For NFS based access to an index, it's recommended that you try SimpleFSLockFactory first and work around the one limitation that a lock file could be left when the JVM exits abnormally.
The primary benefit of NativeFSLockFactory is that lock files will be properly removed (by the OS) if the JVM has an abnormal exit.
Note that, unlike SimpleFSLockFactory, the existence of leftover lock files in the filesystem on exiting the JVM is fine because the OS will free the locks held against these files even though the files still remain.
If you suspect that this or any other LockFactory is not working properly in your environment, you can easily test it by using VerifyingLockFactory, LockVerifyServer and LockStressTest.
Definition at line 54 of file NativeFSLockFactory.cs.
Lucene.Net.Store.NativeFSLockFactory.NativeFSLockFactory | ( | ) |
Create a NativeFSLockFactory instance, with null (unset) lock directory. When you pass this factory to a FSDirectory subclass, the lock directory is automatically set to the directory itsself. Be sure to create one instance for each directory your create!
Definition at line 62 of file NativeFSLockFactory.cs.
Lucene.Net.Store.NativeFSLockFactory.NativeFSLockFactory | ( | System.String | lockDirName | ) |
Create a NativeFSLockFactory instance, storing lock files into the specified lockDirName:
lockDirName | where lock files are created. |
Definition at line 72 of file NativeFSLockFactory.cs.
Lucene.Net.Store.NativeFSLockFactory.NativeFSLockFactory | ( | System.IO.DirectoryInfo | lockDir | ) |
Create a NativeFSLockFactory instance, storing lock files into the specified lockDir:
lockDir | where lock files are created. |
Definition at line 82 of file NativeFSLockFactory.cs.
|
virtual |
Attempt to clear (forcefully unlock and remove) the specified lock. Only call this at a time when you are certain this lock is no longer in use.
lockName | name of the lock to be cleared. |
Implements Lucene.Net.Store.LockFactory.
Definition at line 97 of file NativeFSLockFactory.cs.
|
virtual |
Return a new Lock instance identified by lockName.
lockName | name of the lock to be created. |
Implements Lucene.Net.Store.LockFactory.
Definition at line 87 of file NativeFSLockFactory.cs.