|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.replicator.IndexAndTaxonomyRevision
public class IndexAndTaxonomyRevision
A 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
Nested Class Summary | |
---|---|
static class |
IndexAndTaxonomyRevision.SnapshotDirectoryTaxonomyWriter
A DirectoryTaxonomyWriter which sets the underlying
IndexWriter 's IndexDeletionPolicy to
SnapshotDeletionPolicy . |
Field Summary | |
---|---|
static String |
INDEX_SOURCE
|
static String |
TAXONOMY_SOURCE
|
Constructor Summary | |
---|---|
IndexAndTaxonomyRevision(IndexWriter indexWriter,
IndexAndTaxonomyRevision.SnapshotDirectoryTaxonomyWriter taxoWriter)
Constructor over the given IndexWriter . |
Method Summary | |
---|---|
int |
compareTo(Revision o)
|
int |
compareTo(String version)
Compares the revision to the given version string. |
Map<String,List<RevisionFile>> |
getSourceFiles()
Returns the files that comprise this revision, as a mapping from a source to a list of files. |
String |
getVersion()
Returns a string representation of the version of this revision. |
InputStream |
open(String source,
String fileName)
Returns an IndexInput for the given fileName and source. |
void |
release()
Called when this revision can be safely released, i.e. |
static Map<String,List<RevisionFile>> |
revisionFiles(IndexCommit indexCommit,
IndexCommit taxoCommit)
Returns a singleton map of the revision files from the given IndexCommit . |
static String |
revisionVersion(IndexCommit indexCommit,
IndexCommit taxoCommit)
Returns a String representation of a revision's version from the given IndexCommit s of the search and taxonomy indexes. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String INDEX_SOURCE
public static final String TAXONOMY_SOURCE
Constructor Detail |
---|
public IndexAndTaxonomyRevision(IndexWriter indexWriter, IndexAndTaxonomyRevision.SnapshotDirectoryTaxonomyWriter taxoWriter) throws IOException
IndexWriter
. Uses the last
IndexCommit
found in the Directory
managed by the given
writer.
IOException
Method Detail |
---|
public static Map<String,List<RevisionFile>> revisionFiles(IndexCommit indexCommit, IndexCommit taxoCommit) throws IOException
IndexCommit
.
IOException
public static String revisionVersion(IndexCommit indexCommit, IndexCommit taxoCommit)
IndexCommit
s of the search and taxonomy indexes.
public int compareTo(String version)
Revision
Comparable.compareTo(Object)
.
compareTo
in interface Revision
public int compareTo(Revision o)
compareTo
in interface Comparable<Revision>
public String getVersion()
Revision
Revision.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 Revision
public Map<String,List<RevisionFile>> getSourceFiles()
Revision
getSourceFiles
in interface Revision
public InputStream open(String source, String fileName) throws IOException
Revision
IndexInput
for the given fileName and source. It is the
caller's respnsibility to close the IndexInput
when it has been
consumed.
open
in interface Revision
IOException
public void release() throws IOException
Revision
release
in interface Revision
IOException
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |