Class LocalReplicator

java.lang.Object
org.apache.lucene.replicator.LocalReplicator
All Implemented Interfaces:
Closeable, AutoCloseable, Replicator

@Deprecated public class LocalReplicator extends Object implements 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 Details

    • DEFAULT_SESSION_EXPIRATION_THRESHOLD

      public static final long DEFAULT_SESSION_EXPIRATION_THRESHOLD
      Deprecated.
      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 throw AlreadyClosedException otherwise.
    • checkForUpdate

      public SessionToken checkForUpdate(String currentVersion)
      Deprecated.
      Description copied from interface: Replicator
      Check whether the given version is up-to-date and returns a SessionToken which can be used for fetching the revision files, otherwise returns null.

      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:
      checkForUpdate in interface Replicator
    • close

      public void close() throws IOException
      Deprecated.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getExpirationThreshold

      public long getExpirationThreshold()
      Deprecated.
      Returns the expiration threshold.
      See Also:
    • obtainFile

      public InputStream obtainFile(String sessionID, String source, String fileName) throws IOException
      Deprecated.
      Description copied from interface: Replicator
      Returns an InputStream for the requested file and source in the context of the given session.

      NOTE: it is the caller's responsibility to close the returned stream.

      Specified by:
      obtainFile in interface Replicator
      Throws:
      IOException
    • publish

      public void publish(Revision revision) throws IOException
      Deprecated.
      Description copied from interface: Replicator
      Publish a new Revision for 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 be released by the replicator.
      Specified by:
      publish in interface Replicator
      Throws:
      IOException
    • release

      public void release(String sessionID) throws IOException
      Deprecated.
      Description copied from interface: Replicator
      Notify that the specified SessionToken is no longer needed by the caller.
      Specified by:
      release in interface Replicator
      Throws:
      IOException
    • setExpirationThreshold

      public void setExpirationThreshold(long expirationThreshold) throws IOException
      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 a SessionExpiredException.
      Throws:
      IOException