Class IndexRevision
A IRevision of a single index files which comprises the list of files that are part of the current Lucene.Net.Index.IndexCommit. To ensure the files are not deleted by Lucene.Net.Index.IndexWriter for as long as this revision stays alive (i.e. until Release(), the current commit point is snapshotted, using Lucene.Net.Index.SnapshotDeletionPolicy (this means that the given writer's Lucene.Net.Index.IndexWriterConfig.IndexDeletionPolicy should return Lucene.Net.Index.SnapshotDeletionPolicy).
When this revision is Release()d, it releases the obtained snapshot as well as calls Lucene.Net.Index.IndexWriter.DeleteUnusedFiles() so that the snapshotted files are deleted (if they are no longer needed).Inherited Members
Namespace: Lucene.Net.Replicator
Assembly: Lucene.Net.Replicator.dll
Syntax
public class IndexRevision : IRevision, IComparable<IRevision>
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
Constructors
IndexRevision(IndexWriter)
Constructor over the given Lucene.Net.Index.IndexWriter. Uses the last Lucene.Net.Index.IndexCommit found in the Lucene.Net.Store.Directory managed by the given writer.
Declaration
public IndexRevision(IndexWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IndexWriter | writer |
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
Properties
SourceFiles
Returns the files that comprise this revision, as a mapping from a source to a list of files.
Declaration
public virtual IDictionary<string, IList<RevisionFile>> SourceFiles { get; }
Property Value
Type | Description |
---|---|
IDictionary<string, IList<RevisionFile>> |
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
Version
Returns a string representation of the version of this revision. The version is used by CompareTo(string) as well as to serialize/deserialize revision information. Therefore it must be self descriptive as well as be able to identify one revision from another.
Declaration
public virtual string Version { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
Methods
CompareTo(IRevision)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public virtual int CompareTo(IRevision other)
Parameters
Type | Name | Description |
---|---|---|
IRevision | other | An object to compare with this instance. |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
int | A value that indicates the relative order of the objects being compared. The return value has these meanings:
|
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
CompareTo(string)
Compares the revision to the given version string. Behaves like CompareTo(T)
Declaration
public virtual int CompareTo(string version)
Parameters
Type | Name | Description |
---|---|---|
string | version |
Returns
Type | Description |
---|---|
int |
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
Open(string, string)
Returns a Stream for the given fileName
and source
. It is the
caller's respnsibility to dispose the Stream when it has been
consumed.
Declaration
public virtual Stream Open(string source, string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | source | |
string | fileName |
Returns
Type | Description |
---|---|
Stream |
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
Exceptions
Type | Condition |
---|---|
IOException |
Release()
Called when this revision can be safely released, i.e. where there are no more references to it.
Declaration
public virtual void Release()
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
Exceptions
Type | Condition |
---|---|
IOException |
RevisionFiles(IndexCommit)
Returns a singleton map of the revision files from the given Lucene.Net.Index.IndexCommit.
Declaration
public static IDictionary<string, IList<RevisionFile>> RevisionFiles(IndexCommit commit)
Parameters
Type | Name | Description |
---|---|---|
IndexCommit | commit |
Returns
Type | Description |
---|---|
IDictionary<string, IList<RevisionFile>> |
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
RevisionVersion(IndexCommit)
Returns a string representation of a revision's version from the given Lucene.Net.Index.IndexCommit
Declaration
public static string RevisionVersion(IndexCommit commit)
Parameters
Type | Name | Description |
---|---|---|
IndexCommit | commit |
Returns
Type | Description |
---|---|
string |
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |
Overrides
Remarks
Note
This API is experimental and might change in incompatible ways in the next release.