|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.replicator.IndexAndTaxonomyReplicationHandler
public class IndexAndTaxonomyReplicationHandler
A ReplicationClient.ReplicationHandler
for replication of an index and taxonomy pair.
See IndexReplicationHandler
for more detail. This handler ensures
that the search and taxonomy indexes are replicated in a consistent way.
NOTE: if you intend to recreate a taxonomy index, you should make sure to reopen an IndexSearcher and TaxonomyReader pair via the provided callback, to guarantee that both indexes are in sync. This handler does not prevent replicating such index and taxonomy pairs, and if they are reopened by a different thread, unexpected errors can occur, as well as inconsistency between the taxonomy and index readers.
IndexReplicationHandler
Field Summary | |
---|---|
static String |
INFO_STREAM_COMPONENT
The component used to log messages to the default InfoStream . |
Constructor Summary | |
---|---|
IndexAndTaxonomyReplicationHandler(Directory indexDir,
Directory taxoDir,
Callable<Boolean> callback)
Constructor with the given index directory and callback to notify when the indexes were updated. |
Method Summary | |
---|---|
Map<String,List<RevisionFile>> |
currentRevisionFiles()
Returns the current revision files held by the handler. |
String |
currentVersion()
Returns the current revision version held by the handler. |
void |
revisionReady(String version,
Map<String,List<RevisionFile>> revisionFiles,
Map<String,List<String>> copiedFiles,
Map<String,Directory> sourceDirectory)
Called when a new revision was obtained and is available (i.e. |
void |
setInfoStream(InfoStream infoStream)
Sets the InfoStream to use for logging messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String INFO_STREAM_COMPONENT
default
InfoStream
.
Constructor Detail |
---|
public IndexAndTaxonomyReplicationHandler(Directory indexDir, Directory taxoDir, Callable<Boolean> callback) throws IOException
IOException
Method Detail |
---|
public String currentVersion()
ReplicationClient.ReplicationHandler
currentVersion
in interface ReplicationClient.ReplicationHandler
public Map<String,List<RevisionFile>> currentRevisionFiles()
ReplicationClient.ReplicationHandler
currentRevisionFiles
in interface ReplicationClient.ReplicationHandler
public void revisionReady(String version, Map<String,List<RevisionFile>> revisionFiles, Map<String,List<String>> copiedFiles, Map<String,Directory> sourceDirectory) throws IOException
ReplicationClient.ReplicationHandler
revisionReady
in interface ReplicationClient.ReplicationHandler
version
- the version of the Revision
that was copiedrevisionFiles
- the files contained by this Revision
copiedFiles
- the files that were actually copiedsourceDirectory
- a mapping from a source of files to the Directory
they
were copied into
IOException
public void setInfoStream(InfoStream infoStream)
InfoStream
to use for logging messages.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |