public class IndexAndTaxonomyRevision extends java.lang.Object implements Revision
Revision of a single index and taxonomy index files which comprises
the list of files from both indexes. This revision should be used whenever a
pair of search and taxonomy indexes need to be replicated together to
guarantee consistency of both on the replicating (client) side.IndexRevision| Modifier and Type | Class and Description |
|---|---|
static class |
IndexAndTaxonomyRevision.SnapshotDirectoryTaxonomyWriter
A
DirectoryTaxonomyWriter which sets the underlying
IndexWriter's IndexDeletionPolicy to
SnapshotDeletionPolicy. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
INDEX_SOURCE |
static java.lang.String |
TAXONOMY_SOURCE |
| Constructor and Description |
|---|
IndexAndTaxonomyRevision(IndexWriter indexWriter,
IndexAndTaxonomyRevision.SnapshotDirectoryTaxonomyWriter taxoWriter)
Constructor over the given
IndexWriter. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Revision o) |
int |
compareTo(java.lang.String version)
Compares the revision to the given version string.
|
java.util.Map<java.lang.String,java.util.List<RevisionFile>> |
getSourceFiles()
Returns the files that comprise this revision, as a mapping from a source
to a list of files.
|
java.lang.String |
getVersion()
Returns a string representation of the version of this revision.
|
java.io.InputStream |
open(java.lang.String source,
java.lang.String fileName)
Returns an
IndexInput for the given fileName and source. |
void |
release()
Called when this revision can be safely released, i.e.
|
static java.util.Map<java.lang.String,java.util.List<RevisionFile>> |
revisionFiles(IndexCommit indexCommit,
IndexCommit taxoCommit)
Returns a singleton map of the revision files from the given
IndexCommit. |
static java.lang.String |
revisionVersion(IndexCommit indexCommit,
IndexCommit taxoCommit)
Returns a String representation of a revision's version from the given
IndexCommits of the search and taxonomy indexes. |
java.lang.String |
toString() |
public static final java.lang.String INDEX_SOURCE
public static final java.lang.String TAXONOMY_SOURCE
public IndexAndTaxonomyRevision(IndexWriter indexWriter, IndexAndTaxonomyRevision.SnapshotDirectoryTaxonomyWriter taxoWriter) throws java.io.IOException
IndexWriter. Uses the last
IndexCommit found in the Directory managed by the given
writer.java.io.IOExceptionpublic static java.util.Map<java.lang.String,java.util.List<RevisionFile>> revisionFiles(IndexCommit indexCommit, IndexCommit taxoCommit) throws java.io.IOException
IndexCommit.java.io.IOExceptionpublic static java.lang.String revisionVersion(IndexCommit indexCommit, IndexCommit taxoCommit)
IndexCommits of the search and taxonomy indexes.public int compareTo(java.lang.String version)
RevisionComparable.compareTo(Object).public int compareTo(Revision o)
compareTo in interface java.lang.Comparable<Revision>public java.lang.String getVersion()
RevisionRevision.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.getVersion in interface Revisionpublic java.util.Map<java.lang.String,java.util.List<RevisionFile>> getSourceFiles()
RevisiongetSourceFiles in interface Revisionpublic java.io.InputStream open(java.lang.String source,
java.lang.String fileName)
throws java.io.IOException
RevisionIndexInput for the given fileName and source. It is the
caller's respnsibility to close the IndexInput when it has been
consumed.public void release()
throws java.io.IOException
Revisionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.