Class BaseDirectoryWrapper
Calls check index on dispose.
Implements
Inherited Members
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.TestFramework.dll
Syntax
public class BaseDirectoryWrapper : FilterDirectory, IDisposable
Constructors
BaseDirectoryWrapper(Directory)
Calls check index on dispose.
Declaration
public BaseDirectoryWrapper(Directory @delegate)
Parameters
Type | Name | Description |
---|---|---|
Directory | delegate |
Properties
CheckIndexOnDispose
Set whether or not checkindex should be run on dispose
Declaration
public virtual bool CheckIndexOnDispose { get; set; }
Property Value
Type | Description |
---|---|
bool |
CrossCheckTermVectorsOnDispose
Calls check index on dispose.
Declaration
public virtual bool CrossCheckTermVectorsOnDispose { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsOpen
Gets a value indicating whether the current Lucene.Net.Store.Directory instance is open.
Expert: This is useful for implementing the Lucene.Net.Store.Directory.EnsureOpen() logic.Declaration
public virtual bool IsOpen { get; protected set; }
Property Value
Type | Description |
---|---|
bool |
Methods
CompareAndSetIsOpen(bool, bool)
Atomically sets the value to the given updated value
if the current value ==
the expected value.
protected override void Dispose(bool disposing)
{
if (!CompareAndSetIsOpen(expect: true, update: false)) return;
// Dispose unmanaged resources
if (disposing)
{
// Dispose managed resources
}
}
Declaration
protected bool CompareAndSetIsOpen(bool expect, bool update)
Parameters
Type | Name | Description |
---|---|---|
bool | expect | The expected value (the comparand). |
bool | update | The new value. |
Returns
Type | Description |
---|---|
bool |
|
Copy(Directory, string, string, IOContext)
Copies the file src
to Lucene.Net.Store.Directoryto
under the new
file name dest
.
Directory to; // the directory to copy to
foreach (string file in dir.ListAll()) {
dir.Copy(to, file, newFile, IOContext.DEFAULT); // newFile can be either file, or a new name
}
NOTE: this method does not check whether dest
exist and will
overwrite it if it does.
Declaration
public override void Copy(Directory to, string src, string dest, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
Directory | to | |
string | src | |
string | dest | |
IOContext | context |
Overrides
CreateSlicer(string, IOContext)
Creates an Lucene.Net.Store.Directory.IndexInputSlicer for the given file name. Lucene.Net.Store.Directory.IndexInputSlicer allows other Lucene.Net.Store.Directory implementations to efficiently open one or more sliced Lucene.Net.Store.IndexInput instances from a single file handle. The underlying file handle is kept open until the Lucene.Net.Store.Directory.IndexInputSlicer is closed.
Throws FileNotFoundException if the file does not exist.Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public override Directory.IndexInputSlicer CreateSlicer(string name, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
IOContext | context |
Returns
Type | Description |
---|---|
Directory.IndexInputSlicer |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | if an IOException occurs |
Dispose(bool)
Disposes the store.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |