Package org.apache.lucene.replicator
Class LocalReplicator
java.lang.Object
org.apache.lucene.replicator.LocalReplicator
- All Implemented Interfaces:
Closeable,AutoCloseable,Replicator
Deprecated.
use org.apache.lucene.replicator.nrt instead
A
Replicator implementation for use by the side that publishes Revisions, as well
for clients to check for updates. When a client needs to be
updated, it is returned a SessionToken through which it can obtain the files of that revision. As long as a revision is being replicated,
this replicator guarantees that it will not be released.
Replication sessions expire by default after DEFAULT_SESSION_EXPIRATION_THRESHOLD,
and the threshold can be configured through setExpirationThreshold(long).
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDeprecated.Threshold for expiring inactive sessions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckForUpdate(String currentVersion) Deprecated.Check whether the given version is up-to-date and returns aSessionTokenwhich can be used for fetching the revision files, otherwise returnsnull.voidclose()Deprecated.protected final voidDeprecated.Ensure that replicator is still open, or throwAlreadyClosedExceptionotherwise.longDeprecated.Returns the expiration threshold.obtainFile(String sessionID, String source, String fileName) Deprecated.Returns anInputStreamfor the requested file and source in the context of the givensession.voidDeprecated.Publish a newRevisionfor consumption by clients.voidDeprecated.Notify that the specifiedSessionTokenis no longer needed by the caller.voidsetExpirationThreshold(long expirationThreshold) Deprecated.Modify session expiration time - if a replication session is inactive that long it is automatically expired, and further attempts to operate within this session will throw aSessionExpiredException.
-
Field Details
-
DEFAULT_SESSION_EXPIRATION_THRESHOLD
public static final long DEFAULT_SESSION_EXPIRATION_THRESHOLDDeprecated.Threshold for expiring inactive sessions. Defaults to 30 minutes.- See Also:
-
-
Constructor Details
-
LocalReplicator
public LocalReplicator()Deprecated.
-
-
Method Details
-
ensureOpen
protected final void ensureOpen()Deprecated.Ensure that replicator is still open, or throwAlreadyClosedExceptionotherwise. -
checkForUpdate
Deprecated.Description copied from interface:ReplicatorCheck whether the given version is up-to-date and returns aSessionTokenwhich can be used for fetching the revision files, otherwise returnsnull.NOTE: when the returned session token is no longer needed, you should call
Replicator.release(String)so that the session resources can be reclaimed, including the revision files.- Specified by:
checkForUpdatein interfaceReplicator
-
close
Deprecated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getExpirationThreshold
public long getExpirationThreshold()Deprecated.Returns the expiration threshold.- See Also:
-
obtainFile
Deprecated.Description copied from interface:ReplicatorReturns anInputStreamfor the requested file and source in the context of the givensession.NOTE: it is the caller's responsibility to close the returned stream.
- Specified by:
obtainFilein interfaceReplicator- Throws:
IOException
-
publish
Deprecated.Description copied from interface:ReplicatorPublish a newRevisionfor consumption by clients. It is the caller's responsibility to verify that the revision files exist and can be read by clients. When the revision is no longer needed, it will bereleasedby the replicator.- Specified by:
publishin interfaceReplicator- Throws:
IOException
-
release
Deprecated.Description copied from interface:ReplicatorNotify that the specifiedSessionTokenis no longer needed by the caller.- Specified by:
releasein interfaceReplicator- Throws:
IOException
-
setExpirationThreshold
Deprecated.Modify session expiration time - if a replication session is inactive that long it is automatically expired, and further attempts to operate within this session will throw aSessionExpiredException.- Throws:
IOException
-