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.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
Lucene.Net.Store.FileSwitchDirectory Class Reference

Expert: A Directory instance that switches files between two other Directory instances. Files with the specified extensions are placed in the primary directory; others are placed in the secondary directory. The provided Set must not change once passed to this class, and must allow multiple threads to call contains at once. More...

Inherits Lucene.Net.Store.Directory.

Public Member Functions

 FileSwitchDirectory (System.Collections.Generic.HashSet< string > primaryExtensions, Directory primaryDir, Directory secondaryDir, bool doClose)
 
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 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 void DeleteFile (System.String name)
 Removes an existing file in the directory.
 
override long FileLength (System.String name)
 Returns the length of a 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 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.
 
- Public Member Functions inherited from Lucene.Net.Store.Directory
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>
 

Static Public Member Functions

static System.String GetExtension (System.String name)
 Utility method to return a file's extension.
 
- 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.
 

Protected Member Functions

override void Dispose (bool disposing)
 

Properties

virtual Directory PrimaryDir [get]
 Return the primary directory
 
virtual Directory SecondaryDir [get]
 Return the secondary directory
 
- 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]
 

Detailed Description

Expert: A Directory instance that switches files between two other Directory instances.

Files with the specified extensions are placed in the primary directory; others are placed in the secondary directory. The provided Set must not change once passed to this class, and must allow multiple threads to call contains at once.

NOTE: this API is new and experimental and is subject to suddenly change in the next release.

Definition at line 35 of file FileSwitchDirectory.cs.

Constructor & Destructor Documentation

Lucene.Net.Store.FileSwitchDirectory.FileSwitchDirectory ( System.Collections.Generic.HashSet< string >  primaryExtensions,
Directory  primaryDir,
Directory  secondaryDir,
bool  doClose 
)

Definition at line 43 of file FileSwitchDirectory.cs.

Member Function Documentation

override IndexOutput Lucene.Net.Store.FileSwitchDirectory.CreateOutput ( System.String  name)
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 152 of file FileSwitchDirectory.cs.

override void Lucene.Net.Store.FileSwitchDirectory.DeleteFile ( System.String  name)
virtual

Removes an existing file in the directory.

Implements Lucene.Net.Store.Directory.

Definition at line 142 of file FileSwitchDirectory.cs.

override void Lucene.Net.Store.FileSwitchDirectory.Dispose ( bool  disposing)
protectedvirtual

Implements Lucene.Net.Store.Directory.

Definition at line 67 of file FileSwitchDirectory.cs.

override bool Lucene.Net.Store.FileSwitchDirectory.FileExists ( System.String  name)
virtual

Returns true iff a file with the given name exists.

Implements Lucene.Net.Store.Directory.

Definition at line 127 of file FileSwitchDirectory.cs.

override long Lucene.Net.Store.FileSwitchDirectory.FileLength ( System.String  name)
virtual

Returns the length of a file in the directory.

Implements Lucene.Net.Store.Directory.

Definition at line 147 of file FileSwitchDirectory.cs.

override long Lucene.Net.Store.FileSwitchDirectory.FileModified ( System.String  name)
virtual

Returns the time the named file was last modified.

Implements Lucene.Net.Store.Directory.

Definition at line 132 of file FileSwitchDirectory.cs.

static System.String Lucene.Net.Store.FileSwitchDirectory.GetExtension ( System.String  name)
static

Utility method to return a file's extension.

Definition at line 104 of file FileSwitchDirectory.cs.

override System.String [] Lucene.Net.Store.FileSwitchDirectory.ListAll ( )
virtual

Returns an array of strings, one for each file in the directory.

Exceptions
System.IO.IOException

Implements Lucene.Net.Store.Directory.

Definition at line 95 of file FileSwitchDirectory.cs.

override IndexInput Lucene.Net.Store.FileSwitchDirectory.OpenInput ( System.String  name)
virtual

Returns a stream reading an existing file.

Implements Lucene.Net.Store.Directory.

Definition at line 162 of file FileSwitchDirectory.cs.

override void Lucene.Net.Store.FileSwitchDirectory.Sync ( System.String  name)
virtual

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.

Reimplemented from Lucene.Net.Store.Directory.

Definition at line 157 of file FileSwitchDirectory.cs.

override void Lucene.Net.Store.FileSwitchDirectory.TouchFile ( System.String  name)
virtual

Set the modified time of an existing file to now.

Implements Lucene.Net.Store.Directory.

Definition at line 137 of file FileSwitchDirectory.cs.

Property Documentation

virtual Directory Lucene.Net.Store.FileSwitchDirectory.PrimaryDir
get

Return the primary directory

Definition at line 57 of file FileSwitchDirectory.cs.

virtual Directory Lucene.Net.Store.FileSwitchDirectory.SecondaryDir
get

Return the secondary directory

Definition at line 63 of file FileSwitchDirectory.cs.


The documentation for this class was generated from the following file: