Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
A straightforward implementation of FSDirectory using java.io.RandomAccessFile. However, this class has poor concurrent performance (multiple threads will bottleneck) as it synchronizes when multiple threads read from the same file. It's usually better to use NIOFSDirectory or MMapDirectory instead. More...
Inherits Lucene.Net.Store.FSDirectory.
Classes | |
class | SimpleFSIndexInput |
class | SimpleFSIndexOutput |
Public Member Functions | |
SimpleFSDirectory (System.IO.DirectoryInfo path, LockFactory lockFactory) | |
Create a new SimpleFSDirectory for the named location. | |
SimpleFSDirectory (System.IO.DirectoryInfo path) | |
Create a new SimpleFSDirectory for the named location and the default lock factory. | |
override IndexOutput | CreateOutput (System.String name) |
Creates an IndexOutput for the file with the given name. | |
override IndexInput | OpenInput (System.String name, int bufferSize) |
Creates an IndexInput for the file with the given name. | |
Public Member Functions inherited from Lucene.Net.Store.FSDirectory | |
override System.String[] | ListAll () |
Lists all files (not subdirectories) in the directory. | |
override bool | FileExists (System.String name) |
Returns true iff a file with the given name exists. | |
override long | FileModified (System.String name) |
Returns the time the named file was last modified. | |
override void | TouchFile (System.String name) |
Set the modified time of an existing file to now. | |
override long | FileLength (System.String name) |
Returns the length in bytes of a file in the directory. | |
override void | DeleteFile (System.String name) |
Removes an existing file in the directory. | |
override void | Sync (System.String name) |
Ensure that any writes to this file are moved to stable storage. Lucene uses this to properly commit changes to the index, to prevent a machine/OS crash from corrupting the index. | |
override IndexInput | OpenInput (System.String name) |
Returns a stream reading an existing file. | |
override string | GetLockId () |
Return a string identifier that uniquely differentiates this Directory instance from other Directory instances. This ID should be the same if two Directory instances (even in different JVMs and/or on different machines) are considered "the same index". This is how locking "scopes" to the right index. | |
override System.String | ToString () |
For debug output. | |
Public Member Functions inherited from Lucene.Net.Store.Directory | |
virtual Lock | MakeLock (System.String name) |
Construct a Lock. | |
virtual void | ClearLock (System.String name) |
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. | |
void | Close () |
void | Dispose () |
Closes the store. | |
virtual void | SetLockFactory (LockFactory lockFactory) |
Set the LockFactory that this Directory instance should use for its locking implementation. Each * instance of LockFactory should only be used for one directory (ie, do not share a single instance across multiple Directories). | |
override string | ToString () |
void | EnsureOpen () |
<throws> AlreadyClosedException if this Directory is closed </throws> | |
Additional Inherited Members | |
Static Public Member Functions inherited from Lucene.Net.Store.FSDirectory | |
static FSDirectory | Open (string path) |
Creates an FSDirectory instance, trying to pick the best implementation given the current environment. The directory returned uses the NativeFSLockFactory. | |
static FSDirectory | Open (System.IO.DirectoryInfo path) |
Creates an FSDirectory instance, trying to pick the best implementation given the current environment. The directory returned uses the NativeFSLockFactory. | |
static FSDirectory | Open (System.IO.DirectoryInfo path, LockFactory lockFactory) |
Just like Open(System.IO.DirectoryInfo), but allows you to also specify a custom LockFactory. | |
static System.String[] | ListAll (System.IO.DirectoryInfo dir) |
Lists all files (not subdirectories) in the directory. This method never returns null (throws System.IO.IOException instead). | |
static long | FileModified (System.IO.FileInfo directory, System.String name) |
Returns the time the named file was last modified. | |
Static Public Attributes inherited from Lucene.Net.Store.FSDirectory | |
static readonly int | DEFAULT_READ_CHUNK_SIZE = Constants.JRE_IS_64BIT ? int.MaxValue: 100 * 1024 * 1024 |
Default read chunk size. This is a conditional default: on 32bit JVMs, it defaults to 100 MB. On 64bit JVMs, it's Integer.MAX_VALUE . | |
Protected Member Functions inherited from Lucene.Net.Store.FSDirectory | |
override void | Dispose (bool disposing) |
Properties inherited from Lucene.Net.Store.FSDirectory | |
virtual DirectoryInfo | Directory [get] |
int | ReadChunkSize [get, set] |
The maximum number of bytes to read at once from the underlying file during IndexInput.ReadBytes(byte[],int,int). | |
A straightforward implementation of FSDirectory using java.io.RandomAccessFile. However, this class has poor concurrent performance (multiple threads will bottleneck) as it synchronizes when multiple threads read from the same file. It's usually better to use NIOFSDirectory or MMapDirectory instead.
Definition at line 30 of file SimpleFSDirectory.cs.
Lucene.Net.Store.SimpleFSDirectory.SimpleFSDirectory | ( | System.IO.DirectoryInfo | path, |
LockFactory | lockFactory | ||
) |
Create a new SimpleFSDirectory for the named location.
path | the path of the directory |
lockFactory | the lock factory to use, or null for the default. |
<throws> IOException </throws>
Definition at line 40 of file SimpleFSDirectory.cs.
Lucene.Net.Store.SimpleFSDirectory.SimpleFSDirectory | ( | System.IO.DirectoryInfo | path | ) |
Create a new SimpleFSDirectory for the named location and the default lock factory.
path | the path of the directory |
<throws> IOException </throws>
Definition at line 51 of file SimpleFSDirectory.cs.
|
virtual |
Creates an IndexOutput for the file with the given name.
Implements Lucene.Net.Store.Directory.
Definition at line 56 of file SimpleFSDirectory.cs.
|
virtual |
Creates an IndexInput for the file with the given name.
Reimplemented from Lucene.Net.Store.Directory.
Definition at line 63 of file SimpleFSDirectory.cs.