Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
A memory-resident Directory implementation. Locking implementation is by default the SingleInstanceLockFactory but can be changed with Directory.SetLockFactory. More...
Inherits Lucene.Net.Store.Directory.
Public Member Functions | |
RAMDirectory () | |
Constructs an empty Directory. | |
RAMDirectory (Directory dir) | |
Creates a new RAMDirectory instance from a different Directory implementation. This can be used to load a disk-based index into memory. This should be used only with indices that can fit into memory. Note that the resulting RAMDirectory instance is fully independent from the original Directory (it is a complete copy). Any subsequent changes to the original Directory will not be visible in the RAMDirectory instance. | |
override System.String[] | ListAll () |
Returns an array of strings, one for each file in the directory. | |
override bool | FileExists (System.String name) |
Returns true iff the named file exists in this directory. | |
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. | |
long | SizeInBytes () |
Return total size in bytes of all files in this directory. This is currently quantized to RAMOutputStream.BUFFER_SIZE. | |
override void | DeleteFile (System.String name) |
Removes an existing file in the directory. | |
override IndexOutput | CreateOutput (System.String name) |
Creates a new, empty file in the directory with the given name. Returns a stream writing this file. | |
override IndexInput | OpenInput (System.String name) |
Returns a stream reading an existing file. | |
Public Member Functions inherited from Lucene.Net.Store.Directory | |
virtual 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. | |
virtual IndexInput | OpenInput (System.String name, int bufferSize) |
Returns a stream reading an existing file, with the specified read buffer size. The particular Directory implementation may ignore the buffer size. Currently the only Directory implementations that respect this parameter are FSDirectory and Lucene.Net.Index.CompoundFileReader | |
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). | |
virtual 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 string | ToString () |
void | EnsureOpen () |
<throws> AlreadyClosedException if this Directory is closed </throws> | |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Closes the store to future operations, releasing associated memory. | |
Protected Attributes | |
HashMap< string, RAMFile > | fileMap = new HashMap<string, RAMFile>() |
long | internalSizeInBytes = 0 |
Additional Inherited Members | |
Static Public Member Functions inherited from Lucene.Net.Store.Directory | |
static void | Copy (Directory src, Directory dest, bool closeDirSrc) |
Copy contents of a directory src to a directory dest. If a file in src already exists in dest then the one in dest will be blindly overwritten. | |
Properties inherited from Lucene.Net.Store.Directory | |
virtual LockFactory | LockFactory [get] |
Get the LockFactory that this Directory instance is using for its locking implementation. Note that this may be null for Directory implementations that provide their own locking implementation. | |
bool | isOpen_ForNUnit [get] |
A memory-resident Directory implementation. Locking implementation is by default the SingleInstanceLockFactory but can be changed with Directory.SetLockFactory.
Definition at line 29 of file RAMDirectory.cs.
Lucene.Net.Store.RAMDirectory.RAMDirectory | ( | ) |
Constructs an empty Directory.
Definition at line 42 of file RAMDirectory.cs.
Lucene.Net.Store.RAMDirectory.RAMDirectory | ( | Directory | dir | ) |
Creates a new RAMDirectory
instance from a different Directory
implementation. This can be used to load a disk-based index into memory. This should be used only with indices that can fit into memory. Note that the resulting RAMDirectory
instance is fully independent from the original Directory
(it is a complete copy). Any subsequent changes to the original Directory
will not be visible in the RAMDirectory
instance.
dir | a Directory value |
System.IO.IOException | if an error occurs |
Definition at line 64 of file RAMDirectory.cs.
|
virtual |
Creates a new, empty file in the directory with the given name. Returns a stream writing this file.
Implements Lucene.Net.Store.Directory.
Definition at line 213 of file RAMDirectory.cs.
|
virtual |
Removes an existing file in the directory.
<throws> IOException if the file does not exist </throws>
Implements Lucene.Net.Store.Directory.
Definition at line 195 of file RAMDirectory.cs.
|
protectedvirtual |
Closes the store to future operations, releasing associated memory.
Implements Lucene.Net.Store.Directory.
Definition at line 245 of file RAMDirectory.cs.
|
virtual |
Returns true iff the named file exists in this directory.
Implements Lucene.Net.Store.Directory.
Definition at line 101 of file RAMDirectory.cs.
|
virtual |
Returns the length in bytes of a file in the directory.
<throws> IOException if the file does not exist </throws>
Implements Lucene.Net.Store.Directory.
Definition at line 167 of file RAMDirectory.cs.
|
virtual |
Returns the time the named file was last modified.
<throws> IOException if the file does not exist </throws>
Implements Lucene.Net.Store.Directory.
Definition at line 114 of file RAMDirectory.cs.
|
virtual |
Returns an array of strings, one for each file in the directory.
System.IO.IOException |
Implements Lucene.Net.Store.Directory.
Definition at line 83 of file RAMDirectory.cs.
|
virtual |
Returns a stream reading an existing file.
Implements Lucene.Net.Store.Directory.
Definition at line 231 of file RAMDirectory.cs.
long Lucene.Net.Store.RAMDirectory.SizeInBytes | ( | ) |
Return total size in bytes of all files in this directory. This is currently quantized to RAMOutputStream.BUFFER_SIZE.
Definition at line 184 of file RAMDirectory.cs.
|
virtual |
Set the modified time of an existing file to now.
<throws> IOException if the file does not exist </throws>
Implements Lucene.Net.Store.Directory.
Definition at line 133 of file RAMDirectory.cs.
|
protected |
Definition at line 34 of file RAMDirectory.cs.
|
protected |
Definition at line 35 of file RAMDirectory.cs.