Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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).
    Inheritance
    object
    IndexRevision
    Implements
    IRevision
    IComparable<IRevision>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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:

    Value Meaning
    Less than zero This instance precedes other in the sort order.
    Zero This instance occurs in the same position in the sort order as other.
    Greater than zero This instance follows other in the sort order.
    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
    object.ToString()
    Remarks

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Implements

    IRevision
    IComparable<T>
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.