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 System.IO.FileInfo.Create() . More...
Inherits Lucene.Net.Store.FSLockFactory.
Public Member Functions | |
SimpleFSLockFactory () | |
Create a SimpleFSLockFactory 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! | |
SimpleFSLockFactory (System.IO.DirectoryInfo lockDir) | |
Instantiate using the provided directory (as a File instance). | |
SimpleFSLockFactory (System.String lockDirName) | |
Instantiate using the provided directory name (String). | |
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 System.IO.FileInfo.Create() .
NOTE: the javadocs for File.createNewFile
contain a vague yet spooky warning about not using the API for file locking. This warning was added due to this bug, and in fact the only known problem with using this API for locking is that the Lucene write lock may not be released when the JVM exits abnormally.
When this happens, a LockObtainFailedException is hit when trying to create a writer, in which case you need to explicitly clear the lock file first. You can either manually remove the file, or use the Lucene.Net.Index.IndexWriter.Unlock(Directory) API. But, first be certain that no writer is in fact writing to the index otherwise you can easily corrupt your index.
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 53 of file SimpleFSLockFactory.cs.
Lucene.Net.Store.SimpleFSLockFactory.SimpleFSLockFactory | ( | ) |
Create a SimpleFSLockFactory 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 SimpleFSLockFactory.cs.
Lucene.Net.Store.SimpleFSLockFactory.SimpleFSLockFactory | ( | System.IO.DirectoryInfo | lockDir | ) |
Instantiate using the provided directory (as a File instance).
lockDir | where lock files should be created. |
Definition at line 69 of file SimpleFSLockFactory.cs.
Lucene.Net.Store.SimpleFSLockFactory.SimpleFSLockFactory | ( | System.String | lockDirName | ) |
Instantiate using the provided directory name (String).
lockDirName | where lock files should be created. |
Definition at line 77 of file SimpleFSLockFactory.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 91 of file SimpleFSLockFactory.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 82 of file SimpleFSLockFactory.cs.