Interface | Description |
---|---|
ReplicationClient.ReplicationHandler |
Handler for revisions obtained by the client.
|
ReplicationClient.SourceDirectoryFactory |
Resolves a session and source into a
Directory to use for copying
the session files to. |
Replicator |
An interface for replicating files.
|
Revision |
A revision comprises lists of files that come from different sources and need
to be replicated together to e.g.
|
Class | Description |
---|---|
IndexAndTaxonomyReplicationHandler |
A
ReplicationClient.ReplicationHandler for replication of an index and taxonomy pair. |
IndexAndTaxonomyRevision |
A
Revision of a single index and taxonomy index files which comprises
the list of files from both indexes. |
IndexAndTaxonomyRevision.SnapshotDirectoryTaxonomyWriter |
A
DirectoryTaxonomyWriter which sets the underlying
IndexWriter 's IndexDeletionPolicy to
SnapshotDeletionPolicy . |
IndexInputInputStream |
An
InputStream which wraps an IndexInput . |
IndexReplicationHandler |
A
ReplicationClient.ReplicationHandler for replication of an index. |
IndexRevision |
A
Revision of a single index files which comprises the list of files
that are part of the current IndexCommit . |
LocalReplicator |
A
Replicator implementation for use by the side that publishes
Revision s, as well for clients to check for updates . |
PerSessionDirectoryFactory |
A
ReplicationClient.SourceDirectoryFactory which returns FSDirectory under a
dedicated session directory. |
ReplicationClient |
A client which monitors and obtains new revisions from a
Replicator . |
RevisionFile |
Describes a file in a
Revision . |
SessionToken |
Token for a replication session, for guaranteeing that source replicated
files will be kept safe until the replication completes.
|
Exception | Description |
---|---|
SessionExpiredException |
Exception indicating that a revision update session was expired due to lack
of activity.
|
// ++++++++++++++ SERVER SIDE ++++++++++++++ // IndexWriter publishWriter; // the writer used for indexing Replicator replicator = new LocalReplicator(); replicator.publish(new IndexRevision(publishWriter)); // ++++++++++++++ CLIENT SIDE ++++++++++++++ // // either LocalReplictor, or HttpReplicator if client and server are on different nodes Replicator replicator; // callback invoked after handler finished handling the revision and e.g. can reopen the reader. Callable<Boolean> callback = null; // can also be null if no callback is needed ReplicationHandler handler = new IndexReplicationHandler(indexDir, callback); SourceDirectoryFactory factory = new PerSessionDirectoryFactory(workDir); ReplicationClient client = new ReplicationClient(replicator, handler, factory); // invoke client manually client.updateNow(); // or, periodically client.startUpdateThread(100); // check for update every 100 milliseconds
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.