Hi to all,
I'm trying to use the Replicator
(http://lucene.apache.org/core/4_7_0/replicator/index.html?org/apache/lucene/replicator/package-summary.html)
to backup my indexes while indexing.
We have a lot of writer opened at the same time committed every 5 minutes.
So for each writer I associated a localreplicator:
writer = new IndexWriter(directory, config);
replicator = new LocalReplicator();
then, when I do a commit
writer.commit();
replicator.publish(new IndexRevision(writer));
On the other side, I've a service running on a separate thread that
for each IndexDir creates this:
private final List<ReplicationClient> replicators;
public void initialize() {
Directory dir = getDirFromConf) ; //internal
Replicator replicator = new LocalReplicator();
Callable<Boolean> callback = null;
ReplicationHandler handler = new IndexReplicationHandler(dir, callback);
File workDir = new File("/mnt/storage/backup/" + card.getId());
SourceDirectoryFactory factory = new PerSessionDirectoryFactory(workDir);
ReplicationClient client = new ReplicationClient(replicator, handler, factory);
replicators.add(client); //a list of client
}
Then it is called by a schedule to to replication:
public void doBackup() {
for (ReplicationClient client : replicators) {
log.info("activating client:: " + client);
client.updateNow();
}
}
This is not working.
I'm doing it wrong, but I don't know where.
The java doc and the old blog abut replicator aren't helping me.
Regards,
RF
--
Roberto Franchini
"L'impossibile รจ inevitabile"
jabber:[email protected] skype:ro.franchini
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]