Package org.apache.lucene.replicator
Class IndexRevision
- java.lang.Object
-
- org.apache.lucene.replicator.IndexRevision
-
- All Implemented Interfaces:
Comparable<Revision>,Revision
@Deprecated public class IndexRevision extends Object implements Revision
Deprecated.use org.apache.lucene.replicator.nrt insteadARevisionof a single index files which comprises the list of files that are part of the currentIndexCommit. To ensure the files are not deleted byIndexWriterfor as long as this revision stays alive (i.e. untilrelease()), the current commit point is snapshotted, usingSnapshotDeletionPolicy(this means that the given writer'sconfigshould returnSnapshotDeletionPolicy).When this revision is
released, it releases the obtained snapshot as well as callsIndexWriter.deleteUnusedFiles()so that the snapshotted files are deleted (if they are no longer needed).- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description IndexRevision(IndexWriter writer)Deprecated.Constructor over the givenIndexWriter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompareTo(String version)Deprecated.Compares the revision to the given version string.intcompareTo(Revision o)Deprecated.Map<String,List<RevisionFile>>getSourceFiles()Deprecated.Returns the files that comprise this revision, as a mapping from a source to a list of files.StringgetVersion()Deprecated.Returns a string representation of the version of this revision.InputStreamopen(String source, String fileName)Deprecated.Returns anIndexInputfor the given fileName and source.voidrelease()Deprecated.Called when this revision can be safely released, i.e.static Map<String,List<RevisionFile>>revisionFiles(IndexCommit commit)Deprecated.Returns a singleton map of the revision files from the givenIndexCommit.static StringrevisionVersion(IndexCommit commit)Deprecated.Returns a String representation of a revision's version from the givenIndexCommit.StringtoString()Deprecated.
-
-
-
Constructor Detail
-
IndexRevision
public IndexRevision(IndexWriter writer) throws IOException
Deprecated.Constructor over the givenIndexWriter. Uses the lastIndexCommitfound in theDirectorymanaged by the given writer.- Throws:
IOException
-
-
Method Detail
-
revisionFiles
public static Map<String,List<RevisionFile>> revisionFiles(IndexCommit commit) throws IOException
Deprecated.Returns a singleton map of the revision files from the givenIndexCommit.- Throws:
IOException
-
revisionVersion
public static String revisionVersion(IndexCommit commit)
Deprecated.Returns a String representation of a revision's version from the givenIndexCommit.
-
compareTo
public int compareTo(String version)
Deprecated.Description copied from interface:RevisionCompares the revision to the given version string. Behaves likeComparable.compareTo(Object).
-
compareTo
public int compareTo(Revision o)
Deprecated.- Specified by:
compareToin interfaceComparable<Revision>
-
getVersion
public String getVersion()
Deprecated.Description copied from interface:RevisionReturns a string representation of the version of this revision. The version is used byRevision.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.- Specified by:
getVersionin interfaceRevision
-
getSourceFiles
public Map<String,List<RevisionFile>> getSourceFiles()
Deprecated.Description copied from interface:RevisionReturns the files that comprise this revision, as a mapping from a source to a list of files.- Specified by:
getSourceFilesin interfaceRevision
-
open
public InputStream open(String source, String fileName) throws IOException
Deprecated.Description copied from interface:RevisionReturns anIndexInputfor the given fileName and source. It is the caller's responsibility to close theIndexInputwhen it has been consumed.- Specified by:
openin interfaceRevision- Throws:
IOException
-
release
public void release() throws IOExceptionDeprecated.Description copied from interface:RevisionCalled when this revision can be safely released, i.e. where there are no more references to it.- Specified by:
releasein interfaceRevision- Throws:
IOException
-
-