Class IndexReplicationHandler

java.lang.Object
org.apache.lucene.replicator.IndexReplicationHandler
All Implemented Interfaces:
ReplicationClient.ReplicationHandler

public class IndexReplicationHandler extends Object implements ReplicationClient.ReplicationHandler
A ReplicationClient.ReplicationHandler for replication of an index. Implements revisionReady(java.lang.String, java.util.Map<java.lang.String, java.util.List<org.apache.lucene.replicator.RevisionFile>>, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, java.util.Map<java.lang.String, org.apache.lucene.store.Directory>) by copying the files pointed by the client resolver to the index Directory and then touches the index with IndexWriter to make sure any unused files are deleted.

NOTE: this handler assumes that IndexWriter is not opened by another process on the index directory. In fact, opening an IndexWriter on the same directory to which files are copied can lead to undefined behavior, where some or all the files will be deleted, override other files or simply create a mess. When you replicate an index, it is best if the index is never modified by IndexWriter, except the one that is open on the source index, from which you replicate.

This handler notifies the application via a provided Callable when an updated index commit was made available for it.

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