Package org.apache.lucene.replicator
Class PerSessionDirectoryFactory
java.lang.Object
org.apache.lucene.replicator.PerSessionDirectoryFactory
- All Implemented Interfaces:
ReplicationClient.SourceDirectoryFactory
public class PerSessionDirectoryFactory
extends Object
implements ReplicationClient.SourceDirectoryFactory
A
ReplicationClient.SourceDirectoryFactory
which returns FSDirectory
under a dedicated session
directory. When a session is over, the entire directory is deleted.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorDescriptionPerSessionDirectoryFactory
(Path workDir) Constructor with the given sources mapping. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanupSession
(String sessionID) Called to denote that the replication actions for this session were finished and the directory is no longer needed.getDirectory
(String sessionID, String source) Returns theDirectory
to use for the given session and source.
-
Constructor Details
-
PerSessionDirectoryFactory
Constructor with the given sources mapping.
-
-
Method Details
-
getDirectory
Description copied from interface:ReplicationClient.SourceDirectoryFactory
Returns theDirectory
to use for the given session and source. Implementations may e.g. return different directories for different sessions, or the same directory for all sessions. In that case, it is advised to clean the directory before it is used for a new session.- Specified by:
getDirectory
in interfaceReplicationClient.SourceDirectoryFactory
- Throws:
IOException
- See Also:
-
cleanupSession
Description copied from interface:ReplicationClient.SourceDirectoryFactory
Called to denote that the replication actions for this session were finished and the directory is no longer needed.- Specified by:
cleanupSession
in interfaceReplicationClient.SourceDirectoryFactory
- Throws:
IOException
-